build/generic_platform: use list for sources instead of set
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 20 Jul 2018 08:01:33 +0000 (10:01 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 20 Jul 2018 08:01:33 +0000 (10:01 +0200)
Ideally, we want to use an ordered set (to be able to keep compilation order), to avoid using an external package, we use a list.

litex/build/altera/quartus.py
litex/build/generic_platform.py
litex/build/lattice/diamond.py
litex/build/lattice/icestorm.py
litex/build/xilinx/ise.py
litex/build/xilinx/vivado.py

index 4dae8edf3db9794b9bd3841e6367edd24c123be4..0dcdb53ada3e52f633c720c62f999ad6584f2943 100644 (file)
@@ -127,7 +127,7 @@ class AlteraQuartusToolchain:
         named_sc, named_pc = platform.resolve_signals(v_output.ns)
         v_file = build_name + ".v"
         v_output.write(v_file)
-        sources = platform.sources | {(v_file, "verilog", "work")}
+        sources = platform.sources + [(v_file, "verilog", "work")]
         _build_files(platform.device,
                      sources,
                      platform.verilog_include_paths,
index c4c1e3ba9614b4d6e123df19cb2a37d2b7c38d9f..dbf277dea46d3b2be0d235991512fbe3e4421cb5 100644 (file)
@@ -261,7 +261,7 @@ class GenericPlatform:
         if name is None:
             name = self.__module__.split(".")[-1]
         self.name = name
-        self.sources = set()
+        self.sources = []
         self.verilog_include_paths = set()
         self.finalized = False
 
@@ -323,7 +323,7 @@ class GenericPlatform:
         if library is None:
             library = "work"
 
-        self.sources.add((os.path.abspath(filename), language, library))
+        self.sources.append((os.path.abspath(filename), language, library))
 
     def add_sources(self, path, *filenames, language=None, library=None):
         for f in filenames:
index e8486e333c5c1495d4b568c567d40af3570479fa..276cc408220017dbe2869483d5ab06e9fddcb288 100644 (file)
@@ -110,7 +110,7 @@ class LatticeDiamondToolchain:
         named_sc, named_pc = platform.resolve_signals(v_output.ns)
         v_file = build_name + ".v"
         v_output.write(v_file)
-        sources = platform.sources | {(v_file, "verilog", "work")}
+        sources = platform.sources + [(v_file, "verilog", "work")]
         _build_files(platform.device, sources, platform.verilog_include_paths, build_name)
 
         tools.write_to_file(build_name + ".lpf", _build_lpf(named_sc, named_pc))
index c64634743098de57da634e43c5eba23a704b2c5f..7c06f740e5df5e5b1d5b8b10ee792d5eec6c7be0 100644 (file)
@@ -173,7 +173,7 @@ class LatticeIceStormToolchain:
         return series_size_str[2:]
 
     def gen_read_files(self, platform, main):
-        sources = platform.sources | {(main, "verilog", "work")}
+        sources = platform.sources + [(main, "verilog", "work")]
         incflags = ""
         read_files = list()
         for path in platform.verilog_include_paths:
index 5722f530bc25522163324325196877b70c0f969f..ef561f4b92d7973b0d9e80630974727b68709495 100644 (file)
@@ -181,7 +181,7 @@ class XilinxISEToolchain:
                 named_sc, named_pc = platform.resolve_signals(vns)
                 v_file = build_name + ".v"
                 v_output.write(v_file)
-                sources = platform.sources | {(v_file, "verilog", "work")}
+                sources = platform.sources + [(v_file, "verilog", "work")]
                 if mode in ("xst", "cpld"):
                     _build_xst_files(platform.device, sources, platform.verilog_include_paths, build_name, self.xst_opt)
                     isemode = mode
index 7a19b75bcde6a1138b61daf8d100c4181352d92b..3d40e9be1e583fd1b8ef9b3be5c08aba4a51b09f 100644 (file)
@@ -223,7 +223,7 @@ class XilinxVivadoToolchain:
         named_sc, named_pc = platform.resolve_signals(v_output.ns)
         v_file = build_name + ".v"
         v_output.write(v_file)
-        sources = platform.sources | {(v_file, "verilog", "work")}
+        sources = platform.sources + [(v_file, "verilog", "work")]
         edifs = platform.edifs
         ips = platform.ips
         self._build_batch(platform, sources, edifs, ips, build_name)