vendor.lattice_ice40: normalize device names.
Right now the device name in the board file is just the option nextpnr uses, but that's overnormalized and doesn't quite match the chip names used elsewhere. It is even worse for ECP5 in terms of mismatch with chip names, and for ECP5 we need to support other toolchains as well, so let's handle this uniformly everywhere.
This commit is contained in:
parent
4379a5d6fe
commit
452c4b380b
16
nmigen/vendor/lattice_ice40.py
vendored
16
nmigen/vendor/lattice_ice40.py
vendored
|
@ -35,6 +35,18 @@ class LatticeICE40Platform(TemplatedPlatform):
|
||||||
device = abstractproperty()
|
device = abstractproperty()
|
||||||
package = abstractproperty()
|
package = abstractproperty()
|
||||||
|
|
||||||
|
_nextpnr_device_options = {
|
||||||
|
"iCE40LP384": "--lp384",
|
||||||
|
"iCE40LP1K": "--lp1k",
|
||||||
|
"iCE40LP4K": "--lp8k",
|
||||||
|
"iCE40LP8K": "--lp8k",
|
||||||
|
"iCE40HX1K": "--hx1k",
|
||||||
|
"iCE40HX4K": "--hx8k",
|
||||||
|
"iCE40HX8K": "--hx8k",
|
||||||
|
"iCE40UP5K": "--up5k",
|
||||||
|
"iCE5LP4K": "--u4k",
|
||||||
|
}
|
||||||
|
|
||||||
file_templates = {
|
file_templates = {
|
||||||
**TemplatedPlatform.build_script_templates,
|
**TemplatedPlatform.build_script_templates,
|
||||||
"{{name}}.il": r"""
|
"{{name}}.il": r"""
|
||||||
|
@ -83,8 +95,8 @@ class LatticeICE40Platform(TemplatedPlatform):
|
||||||
{{quiet("-q")}}
|
{{quiet("-q")}}
|
||||||
{{get_override("nextpnr_opts")|default(["--placer","heap"])|join(" ")}}
|
{{get_override("nextpnr_opts")|default(["--placer","heap"])|join(" ")}}
|
||||||
-l {{name}}.tim
|
-l {{name}}.tim
|
||||||
--{{platform.device}}
|
{{platform._nextpnr_device_options[platform.device]}}
|
||||||
--package {{platform.package}}
|
--package {{platform.package|lower}}
|
||||||
--json {{name}}.json
|
--json {{name}}.json
|
||||||
--pcf {{name}}.pcf
|
--pcf {{name}}.pcf
|
||||||
--pre-pack {{name}}_pre_pack.py
|
--pre-pack {{name}}_pre_pack.py
|
||||||
|
|
Loading…
Reference in a new issue