targets/simple: add dummy SDRAM + flash boot address
authorSebastien Bourdeauducq <sb@m-labs.hk>
Tue, 8 Apr 2014 13:25:49 +0000 (15:25 +0200)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Tue, 8 Apr 2014 13:25:49 +0000 (15:25 +0200)
targets/simple.py

index ed8fbdee09dcaeff8cd537c6648630ea7d46fa42..4e5f752155870ca7c9893b4890227ee61c768597 100644 (file)
@@ -1,4 +1,5 @@
 from migen.fhdl.std import *
+from migen.bus import wishbone
 
 from misoclib import gpio, spiflash
 from misoclib.gensoc import GenSoC
@@ -19,8 +20,15 @@ class SimpleSoC(GenSoC):
                # BIOS is in SPI flash
                self.submodules.spiflash = spiflash.SpiFlash(platform.request("spiflash2x"),
                        cmd=0xefef, cmd_width=16, addr_width=24, dummy=4)
+               self.flash_boot_address = 0x70000
                self.register_rom(self.spiflash.bus)
 
+               # TODO: use on-board SDRAM instead of block RAM
+               sys_ram_size = 32*1024
+               self.submodules.sys_ram = wishbone.SRAM(sys_ram_size)
+               self.add_wb_slave(lambda a: a[27:29] == 2, self.sys_ram.bus)
+               self.add_cpu_memory_region("sdram", 0x40000000, sys_ram_size)
+
                self.submodules.leds = gpio.GPIOOut(platform.request("user_led"))
 
 default_subtarget = SimpleSoC