soc_sdram/kcu105: add optional main_ram_size_limit and use it on KCU105 to limit...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 7 Nov 2019 08:00:54 +0000 (09:00 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 7 Nov 2019 08:00:54 +0000 (09:00 +0100)
CSR map will need to be updated to support the 2GB.

litex/boards/targets/kcu105.py
litex/soc/integration/soc_sdram.py

index a48c86c15f232626479e0f5687e9556b0f38c2c5..de12b48f4a1e437ea618d309c6baa14f14e0b5ba 100755 (executable)
@@ -96,8 +96,8 @@ class BaseSoC(SoCSDRAM):
         sdram_module = EDY4016A(sys_clk_freq, "1:4")
         self.register_sdram(self.ddrphy,
                             sdram_module.geom_settings,
-                            sdram_module.timing_settings)
-
+                            sdram_module.timing_settings,
+                            main_ram_size_limit=0x40000000)
 
 # EthernetSoC ------------------------------------------------------------------------------------------
 
index a8ac01edbb866e1400fe757afd8b40c14e9478ec..c5db62b5bbe958ca8c1c306dbf8a2122a7cd73ed 100644 (file)
@@ -42,7 +42,7 @@ class SoCSDRAM(SoCCore):
             raise FinalizeError
         self._wb_sdram_ifs.append(interface)
 
-    def register_sdram(self, phy, geom_settings, timing_settings, **kwargs):
+    def register_sdram(self, phy, geom_settings, timing_settings, main_ram_size_limit=None, **kwargs):
         assert not self._sdram_phy
         self._sdram_phy.append(phy) # encapsulate in list to prevent CSR scanning
 
@@ -62,6 +62,8 @@ class SoCSDRAM(SoCCore):
         main_ram_size = 2**(geom_settings.bankbits +
                             geom_settings.rowbits +
                             geom_settings.colbits)*phy.settings.databits//8
+        if main_ram_size_limit is not None:
+            main_ram_size = min(main_ram_size, main_ram_size_limit)
 
         # SoC [<--> L2 Cache] <--> LiteDRAM ----------------------------------------------------
         if self.cpu.name == "rocket":