From: Florent Kermarrec Date: Wed, 29 Jul 2020 09:10:05 +0000 (+0200) Subject: integration/soc/add_sdram: allow the CPU to add the direct memory buses when adding... X-Git-Tag: 24jan2021_ls180~47 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1938ce363d21b6a21678ab4dfa9f84eb622417a6;p=litex.git integration/soc/add_sdram: allow the CPU to add the direct memory buses when adding the sdram. This is useful for CPUs elaborated at buildtime to use sdram's native data width on the CPU memory ports. --- diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index 838e65b3..40ae46a5 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -1157,6 +1157,13 @@ class LiteXSoC(SoC): # Add SDRAM region self.bus.add_region("main_ram", SoCRegion(origin=origin, size=sdram_size)) + # Add CPU's direct memory buses (if not already declared) ---------------------------------- + if hasattr(self.cpu, "add_memory_buses"): + self.cpu.add_memory_buses( + address_width = 32, + data_width = self.sdram.crossbar.controller.data_width + ) + # SoC [<--> L2 Cache] <--> LiteDRAM -------------------------------------------------------- if len(self.cpu.memory_buses): # When CPU has at least a direct memory bus, connect them directly to LiteDRAM.