soc/integration/soc_core: add integrated_rom_init to allow initializing rom with...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 7 Dec 2017 16:57:23 +0000 (17:57 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 8 Dec 2017 09:18:01 +0000 (10:18 +0100)
litex/soc/integration/builder.py
litex/soc/integration/soc_core.py

index 8a3ea07b8a1c9e63de934a914b1d9c1c7790b82b..b5fd06b58523e3d8d95d1d5ca61f7189a04e2296 100644 (file)
@@ -146,7 +146,8 @@ class Builder:
             self._generate_includes()
             self._generate_software()
             if self.soc.integrated_rom_size and self.compile_software:
-               self._initialize_rom()
+                if not self.soc.integrated_rom_initialized:
+                    self._initialize_rom()
 
         if self.csr_csv is not None:
             self._generate_csr_csv()
index 1e050c0fc045f692018528ab65474f47cbecf3b7..dc2619b96f65fa8fd5aece5f8a82dd9cd72f09ff 100644 (file)
@@ -61,7 +61,7 @@ class SoCCore(Module):
     }
     def __init__(self, platform, clk_freq,
                 cpu_type="lm32", cpu_reset_address=0x00000000,
-                integrated_rom_size=0,
+                integrated_rom_size=0, integrated_rom_init=[],
                 integrated_sram_size=4096,
                 integrated_main_ram_size=0, integrated_main_ram_init=[],
                 shadow_base=0x80000000,
@@ -82,6 +82,7 @@ class SoCCore(Module):
         self.config["CPU_RESET_ADDR"] = self.cpu_reset_address
 
         self.integrated_rom_size = integrated_rom_size
+        self.integrated_rom_initialized = integrated_rom_init != []
         self.integrated_sram_size = integrated_sram_size
         self.integrated_main_ram_size = integrated_main_ram_size
 
@@ -114,7 +115,7 @@ class SoCCore(Module):
         self.config["CPU_TYPE"] = str(cpu_type).upper()
 
         if integrated_rom_size:
-            self.submodules.rom = wishbone.SRAM(integrated_rom_size, read_only=True)
+            self.submodules.rom = wishbone.SRAM(integrated_rom_size, read_only=True, init=integrated_rom_init)
             self.register_rom(self.rom.bus, integrated_rom_size)
 
         if integrated_sram_size: