core/bankmachine: rename cmd_bufferPre to cmd_buffer_lookahead

This commit is contained in:
Florent Kermarrec 2018-08-15 13:30:06 +02:00
parent 23358b5d29
commit 6d234219b4
1 changed files with 9 additions and 8 deletions

View File

@ -38,18 +38,19 @@ class BankMachine(Module):
self.cmd = cmd = stream.Endpoint(cmd_request_rw_layout(a, ba))
# # #
auto_precharge = Signal()
# Command buffer
cmd_buffer_layout = [("we", 1), ("adr", len(req.adr))]
cmd_bufferPre = stream.SyncFIFO(cmd_buffer_layout, settings.cmd_buffer_depth)
cmd_buffer_lookahead = stream.SyncFIFO(cmd_buffer_layout, settings.cmd_buffer_depth)
cmd_buffer = stream.Buffer(cmd_buffer_layout) # 1 depth buffer to detect row change
self.submodules += cmd_buffer, cmd_bufferPre
self.submodules += cmd_buffer_lookahead, cmd_buffer
self.comb += [
req.connect(cmd_bufferPre.sink, omit=["wdata_valid", "wdata_ready",
"rdata_valid", "rdata_ready",
"lock"]),
cmd_bufferPre.source.connect(cmd_buffer.sink),
req.connect(cmd_buffer_lookahead.sink, omit=["wdata_valid", "wdata_ready",
"rdata_valid", "rdata_ready",
"lock"]),
cmd_buffer_lookahead.source.connect(cmd_buffer.sink),
cmd_buffer.source.ready.eq(req.wdata_ready | req.rdata_valid),
req.lock.eq(cmd_buffer.source.valid),
]
@ -91,8 +92,8 @@ class BankMachine(Module):
# Auto Precharge
self.comb += [
If(cmd_bufferPre.source.valid & cmd_buffer.source.valid,
If(slicer.row(cmd_bufferPre.source.adr) != slicer.row(cmd_buffer.source.adr),
If(cmd_buffer_lookahead.source.valid & cmd_buffer.source.valid,
If(slicer.row(cmd_buffer_lookahead.source.adr) != slicer.row(cmd_buffer.source.adr),
auto_precharge.eq(self.precharge_timer.done & (track_close == 0))
)
)