From 14a215449ebb42fd8228c1aec3392695ef8abc48 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Mon, 27 Jul 2020 19:29:00 +0200 Subject: [PATCH] Simplify refresher code --- gram/core/refresher.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/gram/core/refresher.py b/gram/core/refresher.py index 7c68fec..80cb659 100644 --- a/gram/core/refresher.py +++ b/gram/core/refresher.py @@ -368,34 +368,25 @@ class Refresher(Elaboratable): if settings.timing.tZQCS is None: with m.State("Do-Refresh"): - m.d.comb += self.cmd.valid.eq(1) + m.d.comb += self.cmd.valid.eq(~sequencer.done) with m.If(sequencer.done): - m.d.comb += [ - self.cmd.valid.eq(0), - self.cmd.last.eq(1), - ] + m.d.comb += self.cmd.last.eq(1) m.next = "Idle" else: with m.State("Do-Refresh"): - m.d.comb += self.cmd.valid.eq(1) + m.d.comb += self.cmd.valid.eq(~wants_zqcs) with m.If(sequencer.done): with m.If(wants_zqcs): m.d.comb += zqcs_executer.start.eq(1) m.next = "Do-Zqcs" with m.Else(): - m.d.comb += [ - self.cmd.valid.eq(0), - self.cmd.last.eq(1), - ] + m.d.comb += self.cmd.last.eq(1) m.next = "Idle" with m.State("Do-Zqcs"): - m.d.comb += self.cmd.valid.eq(1) + m.d.comb += self.cmd.valid.eq(~zqcs_executer.done) with m.If(zqcs_executer.done): - m.d.comb += [ - self.cmd.valid.eq(0), - self.cmd.last.eq(1), - ] + m.d.comb += self.cmd.last.eq(1) m.next = "Idle" # Connect sequencer/executer outputs to cmd -- 2.30.2