build/lattice: improve special_overrides names (vendor_family)

This commit is contained in:
Florent Kermarrec 2018-10-28 15:40:10 +01:00
parent 60665358d4
commit d029cd243d
3 changed files with 20 additions and 20 deletions

View File

@ -4,7 +4,7 @@ from migen.genlib.io import *
from migen.genlib.resetsync import AsyncResetSynchronizer from migen.genlib.resetsync import AsyncResetSynchronizer
class DiamondAsyncResetSynchronizerImpl(Module): class LatticeECPXAsyncResetSynchronizerImpl(Module):
def __init__(self, cd, async_reset): def __init__(self, cd, async_reset):
rst1 = Signal() rst1 = Signal()
self.specials += [ self.specials += [
@ -15,13 +15,13 @@ class DiamondAsyncResetSynchronizerImpl(Module):
] ]
class DiamondAsyncResetSynchronizer: class LatticeECPXAsyncResetSynchronizer:
@staticmethod @staticmethod
def lower(dr): def lower(dr):
return DiamondAsyncResetSynchronizerImpl(dr.cd, dr.async_reset) return LatticeECPXAsyncResetSynchronizerImpl(dr.cd, dr.async_reset)
class DiamondDDROutputImpl(Module): class LatticeECPXDDROutputImpl(Module):
def __init__(self, i1, i2, o, clk): def __init__(self, i1, i2, o, clk):
self.specials += Instance("ODDRXD1", self.specials += Instance("ODDRXD1",
synthesis_directive="ODDRAPPS=\"SCLK_ALIGNED\"", synthesis_directive="ODDRAPPS=\"SCLK_ALIGNED\"",
@ -29,18 +29,18 @@ class DiamondDDROutputImpl(Module):
i_DA=i1, i_DB=i2, o_Q=o) i_DA=i1, i_DB=i2, o_Q=o)
class DiamondDDROutput: class LatticeECPXDDROutput:
@staticmethod @staticmethod
def lower(dr): def lower(dr):
return DiamondDDROutputImpl(dr.i1, dr.i2, dr.o, dr.clk) return LatticeECPXDDROutputImpl(dr.i1, dr.i2, dr.o, dr.clk)
diamond_special_overrides = { lattice_ecpx_special_overrides = {
AsyncResetSynchronizer: DiamondAsyncResetSynchronizer, AsyncResetSynchronizer: LatticeECPXAsyncResetSynchronizer,
DDROutput: DiamondDDROutput DDROutput: LatticeECPXDDROutput
} }
class IcestormAsyncResetSynchronizerImpl(Module): class LatticeiCE40AsyncResetSynchronizerImpl(Module):
def __init__(self, cd, async_reset): def __init__(self, cd, async_reset):
rst1 = Signal() rst1 = Signal()
self.specials += [ self.specials += [
@ -51,13 +51,13 @@ class IcestormAsyncResetSynchronizerImpl(Module):
] ]
class IcestormAsyncResetSynchronizer: class LatticeiCE40AsyncResetSynchronizer:
@staticmethod @staticmethod
def lower(dr): def lower(dr):
return IcestormAsyncResetSynchronizerImpl(dr.cd, dr.async_reset) return LatticeiCE40AsyncResetSynchronizerImpl(dr.cd, dr.async_reset)
class IcestormDifferentialOutputImpl(Module): class LatticeiCE40DifferentialOutputImpl(Module):
def __init__(self, i, o_p, o_n): def __init__(self, i, o_p, o_n):
self.specials += Instance("SB_IO", self.specials += Instance("SB_IO",
p_PIN_TYPE=C(0b011000, 6), p_PIN_TYPE=C(0b011000, 6),
@ -72,12 +72,12 @@ class IcestormDifferentialOutputImpl(Module):
i_D_OUT_0=~i) i_D_OUT_0=~i)
class IcestormDifferentialOutput: class LatticeiCE40DifferentialOutput:
@staticmethod @staticmethod
def lower(dr): def lower(dr):
return IcestormDifferentialOutputImpl(dr.i, dr.o_p, dr.o_n) return LatticeiCE40DifferentialOutputImpl(dr.i, dr.o_p, dr.o_n)
icestorm_special_overrides = { lattice_ice40_special_overrides = {
AsyncResetSynchronizer: IcestormAsyncResetSynchronizer, AsyncResetSynchronizer: LatticeiCE40AsyncResetSynchronizer,
DifferentialOutput: IcestormDifferentialOutput DifferentialOutput: LatticeiCE40DifferentialOutput
} }

View File

@ -94,7 +94,7 @@ def _run_diamond(build_name, toolchain_path, ver=None):
class LatticeDiamondToolchain: class LatticeDiamondToolchain:
attr_translate = DummyAttrTranslate() attr_translate = DummyAttrTranslate()
special_overrides = common.diamond_special_overrides special_overrides = common.lattice_ecpx_special_overrides
def build(self, platform, fragment, build_dir="build", build_name="top", def build(self, platform, fragment, build_dir="build", build_name="top",
toolchain_path="/opt/Diamond", run=True, **kwargs): toolchain_path="/opt/Diamond", run=True, **kwargs):

View File

@ -91,7 +91,7 @@ class LatticeIceStormToolchain:
"no_shreg_extract": None "no_shreg_extract": None
} }
special_overrides = common.icestorm_special_overrides special_overrides = common.lattice_ice40_special_overrides
def __init__(self): def __init__(self):
# Variables within replacement fields should be backend-aware and # Variables within replacement fields should be backend-aware and