Commit 67679668 authored by William D. Jones's avatar William D. Jones Committed by Sébastien Bourdeauducq
Browse files

lattice/icestorm: Add attribute support (keep).

parent 2274a75b
......@@ -82,6 +82,23 @@ icepack {icepack_opt} {build_name}.txt {build_name}.bin{fail_stmt}
class LatticeIceStormToolchain:
attr_translate = {
"keep": ("keep", "true"),
"no_retiming": None, # yosys does not do retiming
"async_reg": None,
# The next 5 attributes are Vivado-specific. Ignore.
"mr_ff": None,
"mr_false_path": None, # user-defined attribute
"ars_ff1": None, # user-defined attribute
"ars_ff2": None, # user-defined attribute
"ars_false_path": None, # user-defined attribute
# Shift reg primitive issues are ISE-specific. Ignore.
"no_shreg_extract": None
}
def __init__(self):
self.yosys_opt = "-q"
self.pnr_opt = "-q"
......
......@@ -18,7 +18,13 @@ class LatticePlatform(GenericPlatform):
def get_verilog(self, *args, special_overrides=dict(), **kwargs):
so = dict(common.lattice_special_overrides)
so.update(special_overrides)
return GenericPlatform.get_verilog(self, *args, special_overrides=so, **kwargs)
if isinstance(self.toolchain, diamond.LatticeDiamondToolchain):
return GenericPlatform.get_verilog(self, *args, special_overrides=so, **kwargs)
elif isinstance(self.toolchain, icestorm.LatticeIceStormToolchain):
return GenericPlatform.get_verilog(self, *args, special_overrides=so,
attr_translate=self.toolchain.attr_translate, **kwargs)
else:
raise ValueError("Unknown toolchain")
def build(self, *args, **kwargs):
return self.toolchain.build(self, *args, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment