build/lattice: improve special_overrides names (vendor_family)
This commit is contained in:
parent
60665358d4
commit
d029cd243d
|
@ -4,7 +4,7 @@ from migen.genlib.io import *
|
|||
from migen.genlib.resetsync import AsyncResetSynchronizer
|
||||
|
||||
|
||||
class DiamondAsyncResetSynchronizerImpl(Module):
|
||||
class LatticeECPXAsyncResetSynchronizerImpl(Module):
|
||||
def __init__(self, cd, async_reset):
|
||||
rst1 = Signal()
|
||||
self.specials += [
|
||||
|
@ -15,13 +15,13 @@ class DiamondAsyncResetSynchronizerImpl(Module):
|
|||
]
|
||||
|
||||
|
||||
class DiamondAsyncResetSynchronizer:
|
||||
class LatticeECPXAsyncResetSynchronizer:
|
||||
@staticmethod
|
||||
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):
|
||||
self.specials += Instance("ODDRXD1",
|
||||
synthesis_directive="ODDRAPPS=\"SCLK_ALIGNED\"",
|
||||
|
@ -29,18 +29,18 @@ class DiamondDDROutputImpl(Module):
|
|||
i_DA=i1, i_DB=i2, o_Q=o)
|
||||
|
||||
|
||||
class DiamondDDROutput:
|
||||
class LatticeECPXDDROutput:
|
||||
@staticmethod
|
||||
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 = {
|
||||
AsyncResetSynchronizer: DiamondAsyncResetSynchronizer,
|
||||
DDROutput: DiamondDDROutput
|
||||
lattice_ecpx_special_overrides = {
|
||||
AsyncResetSynchronizer: LatticeECPXAsyncResetSynchronizer,
|
||||
DDROutput: LatticeECPXDDROutput
|
||||
}
|
||||
|
||||
|
||||
class IcestormAsyncResetSynchronizerImpl(Module):
|
||||
class LatticeiCE40AsyncResetSynchronizerImpl(Module):
|
||||
def __init__(self, cd, async_reset):
|
||||
rst1 = Signal()
|
||||
self.specials += [
|
||||
|
@ -51,13 +51,13 @@ class IcestormAsyncResetSynchronizerImpl(Module):
|
|||
]
|
||||
|
||||
|
||||
class IcestormAsyncResetSynchronizer:
|
||||
class LatticeiCE40AsyncResetSynchronizer:
|
||||
@staticmethod
|
||||
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):
|
||||
self.specials += Instance("SB_IO",
|
||||
p_PIN_TYPE=C(0b011000, 6),
|
||||
|
@ -72,12 +72,12 @@ class IcestormDifferentialOutputImpl(Module):
|
|||
i_D_OUT_0=~i)
|
||||
|
||||
|
||||
class IcestormDifferentialOutput:
|
||||
class LatticeiCE40DifferentialOutput:
|
||||
@staticmethod
|
||||
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 = {
|
||||
AsyncResetSynchronizer: IcestormAsyncResetSynchronizer,
|
||||
DifferentialOutput: IcestormDifferentialOutput
|
||||
lattice_ice40_special_overrides = {
|
||||
AsyncResetSynchronizer: LatticeiCE40AsyncResetSynchronizer,
|
||||
DifferentialOutput: LatticeiCE40DifferentialOutput
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ def _run_diamond(build_name, toolchain_path, ver=None):
|
|||
class LatticeDiamondToolchain:
|
||||
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",
|
||||
toolchain_path="/opt/Diamond", run=True, **kwargs):
|
||||
|
|
|
@ -91,7 +91,7 @@ class LatticeIceStormToolchain:
|
|||
"no_shreg_extract": None
|
||||
}
|
||||
|
||||
special_overrides = common.icestorm_special_overrides
|
||||
special_overrides = common.lattice_ice40_special_overrides
|
||||
|
||||
def __init__(self):
|
||||
# Variables within replacement fields should be backend-aware and
|
||||
|
|
Loading…
Reference in New Issue