From d029cd243d7d5830eab90d6871bd5e31da135dbd Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sun, 28 Oct 2018 15:40:10 +0100 Subject: [PATCH] build/lattice: improve special_overrides names (vendor_family) --- litex/build/lattice/common.py | 36 ++++++++++++++++----------------- litex/build/lattice/diamond.py | 2 +- litex/build/lattice/icestorm.py | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/litex/build/lattice/common.py b/litex/build/lattice/common.py index b6d8ec1af..12379b279 100644 --- a/litex/build/lattice/common.py +++ b/litex/build/lattice/common.py @@ -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 } diff --git a/litex/build/lattice/diamond.py b/litex/build/lattice/diamond.py index 276cc4082..327799eba 100644 --- a/litex/build/lattice/diamond.py +++ b/litex/build/lattice/diamond.py @@ -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): diff --git a/litex/build/lattice/icestorm.py b/litex/build/lattice/icestorm.py index 4e281c4dc..f5b3586bf 100644 --- a/litex/build/lattice/icestorm.py +++ b/litex/build/lattice/icestorm.py @@ -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