diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index cafa8c404..f6b384cb6 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -1192,7 +1192,7 @@ class LiteXSoC(SoC): self.bus.add_master(name="jtagbone", master=self.jtagbone.wishbone) # Add SDRAM ------------------------------------------------------------------------------------ - def add_sdram(self, name, phy, module, origin, size=None, with_bist=False, with_soc_interconnect=True, + def add_sdram(self, name, phy, module, origin=None, size=None, with_bist=False, with_soc_interconnect=True, l2_cache_size = 8192, l2_cache_min_data_width = 128, l2_cache_reverse = True, @@ -1250,7 +1250,7 @@ class LiteXSoC(SoC): sdram_size = min(sdram_size, size) # Add SDRAM region. - self.bus.add_region("main_ram", SoCRegion(origin=origin, size=sdram_size)) + self.bus.add_region("main_ram", SoCRegion(origin=self.mem_map.get("main_ram", origin), size=sdram_size)) # Add CPU's direct memory buses (if not already declared) ---------------------------------- if hasattr(self.cpu, "add_memory_buses"):