add 3x EINTs to ls180soc
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Sep 2020 11:17:34 +0000 (12:17 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 19 Sep 2020 11:17:34 +0000 (12:17 +0100)
src/soc/litex/florent/libresoc/core.py
src/soc/litex/florent/libresoc/ls180.py
src/soc/litex/florent/ls180soc.py

index 311e8cfac2b93464727c71e4b64bd4ff92be5153..dd416ee8de5ec45e00b5f7c4dd028b9a4a1b0ea4 100644 (file)
@@ -2,7 +2,7 @@ import os
 
 from migen import ClockSignal, ResetSignal, Signal, Instance, Cat
 
-from litex.soc.interconnect import wishbone
+from litex.soc.interconnect import wishbone as wb
 from litex.soc.cores.cpu import CPU
 
 CPU_VARIANTS = ["standard", "standard32"]
@@ -51,19 +51,19 @@ class LibreSoC(CPU):
         self.platform     = platform
         self.variant      = variant
         self.reset        = Signal()
-        self.interrupt    = Signal(4)
+        self.interrupt    = Signal(16)
 
         if variant == "standard32":
             self.data_width           = 32
-            self.dbus = dbus = wishbone.Interface(data_width=32, adr_width=30)
+            self.dbus = dbus = wb.Interface(data_width=32, adr_width=30)
         else:
-            self.dbus = dbus = wishbone.Interface(data_width=64, adr_width=29)
+            self.dbus = dbus = wb.Interface(data_width=64, adr_width=29)
             self.data_width           = 64
-        self.ibus = ibus = wishbone.Interface(data_width=64, adr_width=29)
+        self.ibus = ibus = wb.Interface(data_width=64, adr_width=29)
 
-        self.xics_icp = icp = wishbone.Interface(data_width=32, adr_width=30)
-        self.xics_ics = ics = wishbone.Interface(data_width=32, adr_width=30)
-        self.simple_gpio = gpio = wishbone.Interface(data_width=32, adr_width=30)
+        self.xics_icp = icp = wb.Interface(data_width=32, adr_width=30)
+        self.xics_ics = ics = wb.Interface(data_width=32, adr_width=30)
+        self.simple_gpio = gpio = wb.Interface(data_width=32, adr_width=30)
 
         self.periph_buses = [ibus, dbus]
         self.memory_buses = []
index f6ee02c15e0467229bc61533895aca528e789578..5b392ef89121a3b338bc3838f9a4a46f9308df45 100644 (file)
@@ -81,9 +81,13 @@ for i in range(8):
 pinsin = ' '.join(pinsin)
 pinsout = ' '.join(pinsout)
 
+# 8 GPIO in, 8 GPIO out
 _io.append( ("gpio_in", 8, Pins(pinsin), IOStandard("LVCMOS33")) )
 _io.append( ("gpio_out", 8, Pins(pinsout), IOStandard("LVCMOS33")) )
 
+# 3 External INT wires
+_io.append( ("eint", 3, Pins("E0 E1 E2"), IOStandard("LVCMOS33")) )
+
 # Platform -----------------------------------------------------------------------------------------
 
 class LS180Platform(GenericPlatform):
index a00ba5f0d582f77e831cbe5bb6119733425ccbc6..cdbcef133a61d16e882c0f9d23b16cf0d8654f0f 100755 (executable)
@@ -38,20 +38,6 @@ from microwatt import Microwatt
 from litex.soc.integration.soc import SoCCSRHandler
 SoCCSRHandler.supported_address_width.append(12)
 
-# LiteScope IO -------------------------------------------------
-
-class SoCGPIO(Module, AutoCSR):
-    def __init__(self, in_pads, out_pads):
-        self.input  = Signal(len(in_pads))
-        self.output = Signal(len(out_pads))
-
-        # # #
-
-        self.submodules.gpio = GPIOInOut(self.input, self.output)
-
-    def get_csrs(self):
-        return self.gpio.get_csrs()
-
 
 # LibreSoCSim -----------------------------------------------------------------
 
@@ -223,6 +209,8 @@ class LibreSoCSim(SoCCore):
         )
         self.add_csr("spi_master")
 
+        # EINTs - very simple, wire up top 3 bits to ls180 "eint" pins
+        self.comb += self.cpu.interrupt[12:16].eq(platform.request("eint"))
 
         # Debug ---------------------------------------------------------------
         if not debug: