From 6d234219b4677e6fc1f6e412c323758354371822 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 15 Aug 2018 13:30:06 +0200 Subject: [PATCH] core/bankmachine: rename cmd_bufferPre to cmd_buffer_lookahead --- litedram/core/bankmachine.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/litedram/core/bankmachine.py b/litedram/core/bankmachine.py index df6f99d..4be19fc 100644 --- a/litedram/core/bankmachine.py +++ b/litedram/core/bankmachine.py @@ -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)) ) )