phy/usddrphy: cleanup/simplify read control path.

This commit is contained in:
Florent Kermarrec 2020-04-16 12:04:55 +02:00
parent cd671f9b11
commit 1462a4375b
1 changed files with 11 additions and 10 deletions

View File

@ -493,17 +493,18 @@ class USDDRPHY(Module, AutoCSR):
dfi.phases[2].rddata[databits+i].eq(dq_bitslip.o[5]), dfi.phases[2].rddata[databits+i].eq(dq_bitslip.o[5]),
dfi.phases[3].rddata[databits+i].eq(dq_bitslip.o[7]), dfi.phases[3].rddata[databits+i].eq(dq_bitslip.o[7]),
] ]
# Read Control Path ------------------------------------------------------------------------ # Read Control Path ------------------------------------------------------------------------
# Read latency = OSERDESE3 latency + cl_sys_latency + ISERDESE3 latency + Bitslip latency. # Creates a shift register of read commands coming from the DFI interface. This shift register
rddata_en = dfi.phases[self.settings.rdphase].rddata_en # is used to indicate to the DFI interface that the read data is valid.
for i in range(self.settings.read_latency - 1): #
n_rddata_en = Signal() # The read data valid is asserted for 1 sys_clk cycle when the data is available on the DFI
self.sync += n_rddata_en.eq(rddata_en) # interface, the latency is the sum of the OSERDESE3, CAS, ISERDESE3 and Bitslip latencies.
rddata_en = n_rddata_en rddata_en = Signal(self.settings.read_latency)
for phase in dfi.phases: rddata_en_last = Signal.like(rddata_en)
phase_rddata_valid = Signal() self.comb += rddata_en.eq(Cat(dfi.phases[self.settings.rdphase].rddata_en, rddata_en_last))
self.sync += phase_rddata_valid.eq(rddata_en | self._wlevel_en.storage) self.sync += rddata_en_last.eq(rddata_en)
self.comb += phase.rddata_valid.eq(phase_rddata_valid) self.sync += [phase.rddata_valid.eq(rddata_en[-1] | self._wlevel_en.storage) for phase in dfi.phases]
# Write Control Path ----------------------------------------------------------------------- # Write Control Path -----------------------------------------------------------------------
oe = Signal() oe = Signal()