build/lattice: improve special_overrides names (vendor_family)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 28 Oct 2018 14:40:10 +0000 (15:40 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 28 Oct 2018 14:40:10 +0000 (15:40 +0100)
litex/build/lattice/common.py
litex/build/lattice/diamond.py
litex/build/lattice/icestorm.py

index b6d8ec1af6ac0dfe573f6cccde52e91525e88eac..12379b279654c66457473d4d5d27b43cc27d51ba 100644 (file)
@@ -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
 }
index 276cc408220017dbe2869483d5ab06e9fddcb288..327799eba74b06bdbd35e4262556c421704b7851 100644 (file)
@@ -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):
index 4e281c4dc5c709d033f8311d730d9115251db209..f5b3586bf40bb0d3f2dd992240a98e8301488d82 100644 (file)
@@ -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