From ed997f1cfe5a02c51c10afb6cd0945cd76d62b14 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 13 Jun 2016 13:11:41 +0200 Subject: [PATCH] core: fix refresh (bug was reducing controller throughput by 2) --- litedram/core/multiplexer.py | 6 +++--- litedram/core/refresher.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/litedram/core/multiplexer.py b/litedram/core/multiplexer.py index fd99a6a..2bdfd50 100644 --- a/litedram/core/multiplexer.py +++ b/litedram/core/multiplexer.py @@ -41,11 +41,11 @@ class _CommandChooser(Module): arbiter.request.eq(valids), cmd.valid.eq(choices[arbiter.grant]) ] - + for name in ["a", "ba", "is_read", "is_write", "is_cmd"]: choices = Array(getattr(req, name) for req in requests) self.comb += getattr(cmd, name).eq(choices[arbiter.grant]) - + for name in ["cas", "ras", "we"]: # we should only assert those signals when valid is 1 choices = Array(getattr(req, name) for req in requests) @@ -229,7 +229,7 @@ class Multiplexer(Module, AutoCSR): fsm.act("REFRESH", steerer.sel[0].eq(STEER_REFRESH), refresher.cmd.ready.eq(1), - If(refresher.cmd.valid & refresher.cmd.last, + If(refresher.cmd.last, NextState("READ") ) ) diff --git a/litedram/core/refresher.py b/litedram/core/refresher.py index 6a5db29..f6d9745 100644 --- a/litedram/core/refresher.py +++ b/litedram/core/refresher.py @@ -59,9 +59,10 @@ class Refresher(Module): ) ) fsm.act("WAIT_SEQ", - cmd.valid.eq(1), If(seq_done, cmd.last.eq(1), NextState("IDLE") + ).Else( + cmd.valid.eq(1) ) )