targets/nexys4ddr: use SoCCore and add_sdram to avoid use of specific SoCSDRAM.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 2 Mar 2020 08:01:05 +0000 (09:01 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 2 Mar 2020 08:01:05 +0000 (09:01 +0100)
litex/boards/targets/nexys4ddr.py
litex/soc/integration/soc_sdram.py

index 0caba97b63de9c288df14deadcb5dd27a1f6318f..c65dcf23bd5eb6b97d02c618c63bed2353bd39b3 100755 (executable)
@@ -10,6 +10,7 @@ from migen import *
 from litex.boards.platforms import nexys4ddr
 
 from litex.soc.cores.clock import *
+from litex.soc.integration.soc_core import *
 from litex.soc.integration.soc_sdram import *
 from litex.soc.integration.builder import *
 
@@ -53,7 +54,7 @@ class _CRG(Module):
 
 # BaseSoC ------------------------------------------------------------------------------------------
 
-class BaseSoC(SoCSDRAM):
+class BaseSoC(SoCCore):
     def __init__(self, sys_clk_freq=int(75e6), with_ethernet=False, **kwargs):
         platform = nexys4ddr.Platform()
 
@@ -70,10 +71,15 @@ class BaseSoC(SoCSDRAM):
                 nphases      = 2,
                 sys_clk_freq = sys_clk_freq)
             self.add_csr("ddrphy")
-            sdram_module = MT47H64M16(sys_clk_freq, "1:2")
-            self.register_sdram(self.ddrphy,
-                geom_settings   = sdram_module.geom_settings,
-                timing_settings = sdram_module.timing_settings)
+            self.add_sdram("sdram",
+                phy                     = self.ddrphy,
+                module                  = MT47H64M16(sys_clk_freq, "1:2"),
+                origin                  = self.mem_map["main_ram"],
+                size                    = kwargs["max_sdram_size"],
+                l2_cache_size           = kwargs["l2_size"],
+                l2_cache_min_data_width = kwargs["min_l2_data_width"],
+                l2_cache_reverse        = True
+            )
 
         # Ethernet ---------------------------------------------------------------------------------
         if with_ethernet:
index 6c6f3c7024915a221dcd21e8e10ea55db2efd3af..9eecaa5678712c0d88d39d55c8d36859d38f0c57 100644 (file)
@@ -54,7 +54,7 @@ def soc_sdram_args(parser):
     # L2 Cache
     parser.add_argument("--l2-size", default=8192,
                         help="L2 cache size (default=8192)")
-    parser.add_argument("--min-l2-datawidth", default=128,
+    parser.add_argument("--min-l2-data-width", default=128,
                         help="Minimum L2 cache datawidth (default=128)")
 
     # SDRAM