From 479773418d1bba6c40560417168c5f15596aa73e Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 10 May 2022 15:16:58 +0200 Subject: [PATCH] tools/litex_soc_gen: Add identifier, move wb_region to IOs and add optional debug. --- litex/tools/litex_soc_gen.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/litex/tools/litex_soc_gen.py b/litex/tools/litex_soc_gen.py index 5e235ad21..570f86023 100755 --- a/litex/tools/litex_soc_gen.py +++ b/litex/tools/litex_soc_gen.py @@ -45,6 +45,11 @@ def get_uart_ios(): ) ] +def get_debug_ios(debug_width=8): + return [ + ("debug", 0, Pins(debug_width)), + ] + # Platform ----------------------------------------------------------------------------------------- class Platform(GenericPlatform): @@ -72,7 +77,7 @@ class LiteXSoCGenerator(SoCMini): # SoC -------------------------------------------------------------------------------------- if kwargs["uart_name"] == "serial": kwargs["uart_name"] = "uart" - SoCCore.__init__(self, platform, clk_freq=sys_clk_freq, **kwargs) + SoCCore.__init__(self, platform, clk_freq=sys_clk_freq, ident=f"LiteX standalone SoC - {name}", **kwargs) # MMAP Slave Interface --------------------------------------------------------------------- s_bus = { @@ -92,12 +97,22 @@ class LiteXSoCGenerator(SoCMini): "axi-lite" : axi.AXILiteInterface(), }[kwargs["bus_standard"]] - wb_region = SoCRegion(origin=0x2000_0000, size=0x1000_0000, cached=True) # FIXME. + wb_region = SoCRegion(origin=0xa000_0000, size=0x1000_0000, cached=False) # FIXME. self.bus.add_slave(name="mmap_m", slave=m_bus, region=wb_region) platform.add_extension(m_bus.get_ios("mmap_m")) wb_pads = platform.request("mmap_m") self.comb += m_bus.connect_to_pads(wb_pads, mode="master") + # Debug ------------------------------------------------------------------------------------ + platform.add_extension(get_debug_ios()) + debug_pads = platform.request("debug") + self.comb += [ + # Export Signal(s) for debug. + debug_pads[0].eq(0), # 0. + debug_pads[1].eq(1), # 1. + # Etc... + ] + # Build -------------------------------------------------------------------------------------------- def main(): # Arguments.