self.xics_icp = icp = wishbone.Interface(data_width=32, adr_width=5)
self.xics_ics = ics = wishbone.Interface(data_width=32, adr_width=14)
+ self.simple_gpio = gpio = wishbone.Interface(data_width=32, adr_width=5)
- self.ics_buses = [icp, ics]
self.periph_buses = [ibus, dbus]
self.memory_buses = []
self.cpu_params.update(make_wb_bus("dbus_", dbus))
self.cpu_params.update(make_wb_bus("ics_wb_", ics))
self.cpu_params.update(make_wb_bus("icp_wb_", icp))
+ self.cpu_params.update(make_wb_bus("gpio_wb_", gpio))
# add verilog sources
self.add_sources(platform)
# "hello_world/hello_world.bin"
# reserve XICS ICP and XICS memory addresses.
- # TODO: not have these conflict with csr locations
self.mem_map['icp'] = 0xc0004000
self.mem_map['ics'] = 0xc0005000
+ self.mem_map['gpio'] = 0xc0007000
#self.csr_map["icp"] = 8 # 8 x 0x800 == 0x4000
#self.csr_map["ics"] = 10 # 10 x 0x800 == 0x5000
)
self.platform.name = "sim"
- # XICS interrupt devices
- icp_addr = self.mem_map['icp']
- icp_wb = self.cpu.xics_icp
- icp_region = SoCRegion(origin=icp_addr, size=0x1000, cached=False)
- self.bus.add_slave(name='icp', slave=icp_wb, region=icp_region)
+ if cpu == "libresoc":
+ # XICS interrupt devices
+ icp_addr = self.mem_map['icp']
+ icp_wb = self.cpu.xics_icp
+ icp_region = SoCRegion(origin=icp_addr, size=0x1000, cached=False)
+ self.bus.add_slave(name='icp', slave=icp_wb, region=icp_region)
+
+ ics_addr = self.mem_map['ics']
+ ics_wb = self.cpu.xics_ics
+ ics_region = SoCRegion(origin=ics_addr, size=0x20, cached=False)
+ self.bus.add_slave(name='ics', slave=ics_wb, region=ics_region)
+
+ # Simple GPIO peripheral
+ gpio_addr = self.mem_map['gpio']
+ gpio_wb = self.cpu.simple_gpio
+ gpio_region = SoCRegion(origin=gpio_addr, size=0x20, cached=False)
+ self.bus.add_slave(name='gpio', slave=gpio_wb, region=gpio_region)
- ics_addr = self.mem_map['ics']
- ics_wb = self.cpu.xics_ics
- ics_region = SoCRegion(origin=ics_addr, size=0x20, cached=False)
- self.bus.add_slave(name='ics', slave=ics_wb, region=ics_region)
# CRG -----------------------------------------------------------------
self.submodules.crg = CRG(platform.request("sys_clk"))