not for any good reason, separate adding the uart16550 verilog source
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 13 Feb 2022 14:25:44 +0000 (14:25 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 13 Feb 2022 14:25:44 +0000 (14:25 +0000)
examples/ls2.py

index 09d4043d5344df7399100c253a17947640ea5dbe..711299e67ccc6b10ca52863e8520b67e9e0ec085 100644 (file)
@@ -82,12 +82,7 @@ class DDR3SoC(SoC, Elaboratable):
         self._decoder.add(self.ram.bus, addr=0x8000000) # SRAM at 0x8000_000
 
         # UART
-        opencores_16550 = "../../uart16550/rtl/verilog"
-        pth = os.path.split(__file__)[0]
-        pth = os.path.join(pth, opencores_16550)
-        fname = os.path.abspath(pth)
-        print (fname)
-        self.uart = UART16550(verilog_src_dir=fname)
+        self.uart = UART16550()
         umap = MemoryMap(addr_width=7, data_width=8, name="uart_map")
         #umap.add_resource(self._mem, name="mem", size=1<<5)
         self.uart.bus.memory_map = umap
@@ -148,6 +143,16 @@ class DDR3SoC(SoC, Elaboratable):
             # wire up the CPU interrupts
             comb += self.cpu.ip.eq(self.intc.ip)
 
+        # add uart16550 verilog source. assumes a directory
+        # structure where ls2 has been checked out in a common
+        # subdirectory as https://github.com/freecores/uart16550
+        opencores_16550 = "../../uart16550/rtl/verilog"
+        pth = os.path.split(__file__)[0]
+        pth = os.path.join(pth, opencores_16550)
+        fname = os.path.abspath(pth)
+        print (fname)
+        self.uart.add_verilog_source(fname, platform)
+
         return m