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"]
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 = []
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):
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 -----------------------------------------------------------------
)
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: