SDRAMModule.__init__(self, clk_freq, self.geom_settings, self.timing_settings)
# DDR
+class MT46V32M16(SDRAMModule):
+ geom_settings = {
+ "nbanks": 4,
+ "nrows": 8192,
+ "ncols": 1024
+ }
+ timing_settings = {
+ "tRP": 15,
+ "tRCD": 15,
+ "tWR": 15,
+ "tWTR": 2,
+ "tREFI": 7800,
+ "tRFC": 70
+ }
+ def __init__(self, clk_freq):
+ SDRAMModule.__init__(self, clk_freq, self.geom_settings, self.timing_settings)
# LPDDR
from misoclib.others import mxcrg
from misoclib.mem import sdram
+from misoclib.mem.sdram.module import MT46V32M16
from misoclib.mem.sdram.phy import s6ddrphy
from misoclib.mem.flash import norflash16
from misoclib.cpu.peripherals import gpio
self.submodules.crg = mxcrg.MXCRG(_MXClockPads(platform), self.clk_freq)
if not self.with_main_ram:
- sdram_geom_settings = sdram.GeomSettings(
- bank_a=2,
- row_a=13,
- col_a=10
- )
- sdram_timing_settings = sdram.TimingSettings(
- tRP=self.ns(15),
- tRCD=self.ns(15),
- tWR=self.ns(15),
- tWTR=2,
- tREFI=self.ns(7800, False),
- tRFC=self.ns(70),
- )
+ sdram_module = MT46V32M16(self.clk_freq)
sdram_controller_settings = sdram.ControllerSettings(
req_queue_size=8,
read_time=32,
)
self.submodules.ddrphy = s6ddrphy.S6DDRPHY(platform.request("ddram"), memtype="DDR",
rd_bitslip=0, wr_bitslip=3, dqs_ddr_alignment="C1")
- self.register_sdram_phy(self.ddrphy, sdram_geom_settings, sdram_timing_settings,
+ self.register_sdram_phy(self.ddrphy, sdram_module.geom_settings, sdram_module.timing_settings,
sdram_controller_settings)