databits = len(self.pads.dq.oe)
self.dfi = Interface(addressbits, bankbits, nranks, 4*databits, 4)
- def elaborate(self, platform):
- m = Module()
-
+ # PHY settings -----------------------------------------------------------------------------
tck = 2/(2*2*self._sys_clk_freq)
nphases = 2
databits = len(self.pads.dq.oe)
nranks = 1 if not hasattr(self.pads, "cs_n") else len(self.pads.cs_n)
addressbits = len(self.pads.a.o)
bankbits = len(self.pads.ba.o)
-
- # Init -------------------------------------------------------------------------------------
- m.submodules.init = DomainRenamer("init")(ECP5DDRPHYInit("sys2x"))
-
- # Parameters -------------------------------------------------------------------------------
cl, cwl = get_cl_cw("DDR3", tck)
cl_sys_latency = get_sys_latency(nphases, cl)
cwl_sys_latency = get_sys_latency(nphases, cwl)
-
- # Observation
- self.datavalid = Signal(databits//8)
-
- # PHY settings -----------------------------------------------------------------------------
rdcmdphase, rdphase = get_sys_phases(nphases, cl_sys_latency, cl)
wrcmdphase, wrphase = get_sys_phases(nphases, cwl_sys_latency, cwl)
self.settings = PhySettings(
write_latency = cwl_sys_latency
)
+ def elaborate(self, platform):
+ m = Module()
+
+ tck = 2/(2*2*self._sys_clk_freq)
+ nphases = 2
+ databits = len(self.pads.dq.oe)
+ nranks = 1 if not hasattr(self.pads, "cs_n") else len(self.pads.cs_n)
+ addressbits = len(self.pads.a.o)
+ bankbits = len(self.pads.ba.o)
+
+ # Init -------------------------------------------------------------------------------------
+ m.submodules.init = DomainRenamer("init")(ECP5DDRPHYInit("sys2x"))
+
+ # Parameters -------------------------------------------------------------------------------
+ cl, cwl = get_cl_cw("DDR3", tck)
+ cl_sys_latency = get_sys_latency(nphases, cl)
+ cwl_sys_latency = get_sys_latency(nphases, cwl)
+
+ # Observation
+ self.datavalid = Signal(databits//8)
+
# DFI Interface ----------------------------------------------------------------------------
dfi = self.dfi
- # # #
-
bl8_chunk = Signal()
rddata_en = Signal(self.settings.read_latency)