sdram: define MT46V32M16 and use it on m1/mixxeo

This commit is contained in:
Florent Kermarrec 2015-03-21 17:04:58 +01:00
parent de2f1c31d5
commit fd2f8d4bb4
2 changed files with 19 additions and 14 deletions

View File

@ -62,6 +62,22 @@ class MT48LC4M16(SDRAMModule):
SDRAMModule.__init__(self, clk_freq, self.geom_settings, self.timing_settings) SDRAMModule.__init__(self, clk_freq, self.geom_settings, self.timing_settings)
# DDR # 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 # LPDDR

View File

@ -6,6 +6,7 @@ from mibuild.generic_platform import ConstraintError
from misoclib.others import mxcrg from misoclib.others import mxcrg
from misoclib.mem import sdram from misoclib.mem import sdram
from misoclib.mem.sdram.module import MT46V32M16
from misoclib.mem.sdram.phy import s6ddrphy from misoclib.mem.sdram.phy import s6ddrphy
from misoclib.mem.flash import norflash16 from misoclib.mem.flash import norflash16
from misoclib.cpu.peripherals import gpio from misoclib.cpu.peripherals import gpio
@ -41,19 +42,7 @@ class BaseSoC(SDRAMSoC):
self.submodules.crg = mxcrg.MXCRG(_MXClockPads(platform), self.clk_freq) self.submodules.crg = mxcrg.MXCRG(_MXClockPads(platform), self.clk_freq)
if not self.with_main_ram: if not self.with_main_ram:
sdram_geom_settings = sdram.GeomSettings( sdram_module = MT46V32M16(self.clk_freq)
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_controller_settings = sdram.ControllerSettings( sdram_controller_settings = sdram.ControllerSettings(
req_queue_size=8, req_queue_size=8,
read_time=32, read_time=32,
@ -61,7 +50,7 @@ class BaseSoC(SDRAMSoC):
) )
self.submodules.ddrphy = s6ddrphy.S6DDRPHY(platform.request("ddram"), memtype="DDR", self.submodules.ddrphy = s6ddrphy.S6DDRPHY(platform.request("ddram"), memtype="DDR",
rd_bitslip=0, wr_bitslip=3, dqs_ddr_alignment="C1") 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) sdram_controller_settings)