cpu/vexriscv: use specific mem_map for linux variant
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 7 Oct 2019 06:49:32 +0000 (08:49 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 7 Oct 2019 06:50:03 +0000 (08:50 +0200)
litex/soc/cores/cpu/vexriscv/core.py

index e70f3865791c87c7e7cc77a24230a78001be6c16..3ae10fb86321f029f37184055ebe3e0d1ee5c8b7 100644 (file)
@@ -81,6 +81,15 @@ class VexRiscv(CPU, AutoCSR):
     gcc_triple           = ("riscv64-unknown-elf", "riscv32-unknown-elf", "riscv-none-embed")
     linker_output_format = "elf32-littleriscv"
 
+    @property
+    def mem_map_linux(self):
+        return {
+            "rom":          0x00000000,
+            "sram":         0x10000000,
+            "main_ram":     0xc0000000,
+            "csr":          0xf0000000,
+        }
+
     @property
     def gcc_flags(self):
         flags = GCC_FLAGS[self.variant]
@@ -132,6 +141,7 @@ class VexRiscv(CPU, AutoCSR):
 
         if "linux" in variant:
             self.add_timer()
+            self.mem_map = self.mem_map_linux
 
         if "debug" in variant:
             self.add_debug()