cpu_boot_file="software/bios/bios.bin",
with_rom=False, rom_size=0x8000,
with_sram=True, sram_size=4096,
- with_sdram=False, sdram_size=64*1024,
+ with_main_ram=False, main_ram_size=64*1024,
with_csr=True, csr_data_width=8, csr_address_width=14,
with_uart=True, uart_baudrate=115200,
with_identifier=True,
self.with_sram = with_sram
self.sram_size = sram_size
- self.with_sdram = with_sdram
- self.sdram_size = sdram_size
+ self.with_main_ram = with_main_ram
+ self.main_ram_size = main_ram_size
self.with_uart = with_uart
self.uart_baudrate = uart_baudrate
self.submodules.sram = wishbone.SRAM(sram_size)
self.register_mem("sram", self.mem_map["sram"], self.sram.bus, sram_size)
- if with_sdram:
- self.submodules.sdram = wishbone.SRAM(sdram_size)
- self.register_mem("sdram", self.mem_map["sdram"], self.sdram.bus, sdram_size)
+ # Note: Main Ram can be used when no external SDRAM is available and use SDRAM mapping.
+ if with_main_ram:
+ self.submodules.main_ram = wishbone.SRAM(main_ram_size)
+ self.register_mem("sdram", self.mem_map["sdram"], self.main_ram.bus, main_ram_size)
elif cpu_or_bridge is not None and not isinstance(cpu_or_bridge, CPU):
self._wb_masters += [cpu_or_bridge.wishbone]
else:
self.submodules.wishbone2lasmi = wishbone2lasmi.WB2LASMI(self.l2_size//4, self.sdram.crossbar.get_master())
lasmic = self.sdram.controller.lasmic
- sdram_size = 2**lasmic.aw*lasmic.dw*lasmic.nbanks//8
- self.register_mem("sdram", self.mem_map["sdram"], self.wishbone2lasmi.wishbone, sdram_size)
+ main_ram_size = 2**lasmic.aw*lasmic.dw*lasmic.nbanks//8
+ self.register_mem("sdram", self.mem_map["sdram"], self.wishbone2lasmi.wishbone, main_ram_size)
# MINICON frontend
elif self.ramcon_type == "minicon":
sdram_width = flen(self.sdram.controller.bus.dat_r)
- sdram_size = 2**(sdram_geom.bank_a+sdram_geom.row_a+sdram_geom.col_a)*sdram_width//8
+ main_ram_size = 2**(sdram_geom.bank_a+sdram_geom.row_a+sdram_geom.col_a)*sdram_width//8
if sdram_width == 32:
- self.register_mem("sdram", self.mem_map["sdram"], self.sdram.controller.bus, sdram_size)
+ self.register_mem("sdram", self.mem_map["sdram"], self.sdram.controller.bus, main_ram_size)
elif sdram_width < 32:
self.submodules.downconverter = downconverter = wishbone.DownConverter(32, sdram_width)
self.comb += Record.connect(downconverter.wishbone_o, self.sdram.controller.bus)
- self.register_mem("sdram", self.mem_map["sdram"], downconverter.wishbone_i, sdram_size)
+ self.register_mem("sdram", self.mem_map["sdram"], downconverter.wishbone_i, main_ram_size)
else:
raise NotImplementedError("Unsupported SDRAM width of {} > 32".format(sdram_width))
def do_finalize(self):
- if not self.with_sdram:
+ if not self.with_main_ram:
if not self._sdram_phy_registered:
raise FinalizeError("Need to call SDRAMSoC.register_sdram_phy()")
SoC.do_finalize(self)
self.submodules.crg = _CRG(platform)
- if not self.with_sdram:
+ if not self.with_main_ram:
sdram_geom = sdram.GeomSettings(
bank_a=2,
row_a=13,
self.submodules.crg = _CRG(platform)
- if not self.with_sdram:
+ if not self.with_main_ram:
sdram_geom = sdram.GeomSettings(
bank_a=3,
row_a=16,
self.submodules.crg = mxcrg.MXCRG(_MXClockPads(platform), self.clk_freq)
- if not self.with_sdram:
+ if not self.with_main_ram:
sdram_geom = sdram.GeomSettings(
bank_a=2,
row_a=13,
self.submodules.crg = _CRG(platform, clk_freq)
- if not self.with_sdram:
+ if not self.with_main_ram:
sdram_geom = sdram.GeomSettings(
bank_a=2,
row_a=13,
self.submodules.crg = _CRG(platform, clk_freq)
- if not self.with_sdram:
+ if not self.with_main_ram:
sdram_geom = sdram.GeomSettings(
bank_a=2,
row_a=12,
SoC.__init__(self, platform,
clk_freq=int((1/(platform.default_clk_period))*1000000000),
with_rom=True,
- with_sdram=True, sdram_size=16*1024,
+ with_main_ram=True, main_ram_size=16*1024,
**kwargs)
class MiniSoC(BaseSoC):