generic_platform: use set for sources
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 12 Nov 2018 10:47:39 +0000 (11:47 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 12 Nov 2018 10:47:39 +0000 (11:47 +0100)
litex/build/generic_platform.py

index dbf277dea46d3b2be0d235991512fbe3e4421cb5..c4c1e3ba9614b4d6e123df19cb2a37d2b7c38d9f 100644 (file)
@@ -261,7 +261,7 @@ class GenericPlatform:
         if name is None:
             name = self.__module__.split(".")[-1]
         self.name = name
-        self.sources = []
+        self.sources = set()
         self.verilog_include_paths = set()
         self.finalized = False
 
@@ -323,7 +323,7 @@ class GenericPlatform:
         if library is None:
             library = "work"
 
-        self.sources.append((os.path.abspath(filename), language, library))
+        self.sources.add((os.path.abspath(filename), language, library))
 
     def add_sources(self, path, *filenames, language=None, library=None):
         for f in filenames: