From: Jean THOMAS Date: Mon, 27 Jul 2020 13:10:58 +0000 (+0200) Subject: Add Precharge-For-Refresh state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7beb11e5c3183de30b9f781aeda701410d15575c;p=gram.git Add Precharge-For-Refresh state --- diff --git a/gram/core/bankmachine.py b/gram/core/bankmachine.py index ad289d6..d956aac 100644 --- a/gram/core/bankmachine.py +++ b/gram/core/bankmachine.py @@ -176,7 +176,10 @@ class BankMachine(Elaboratable): with m.FSM(): with m.State("Regular"): with m.If(self.refresh_req): - m.next = "Refresh" + with m.If(row_opened): + m.next = "Precharge-For-Refresh" + with m.Else(): + m.next = "Refresh" with m.Elif(cmd_buffer.source.valid): with m.If(row_opened): with m.If(row_hit): @@ -216,6 +219,20 @@ class BankMachine(Elaboratable): with m.If(self.cmd.ready): m.next = "tRP" + with m.State("Precharge-For-Refresh"): + m.d.comb += row_close.eq(1) + + with m.If(twtpcon.ready & trascon.ready): + m.d.comb += [ + self.cmd.valid.eq(1), + self.cmd.ras.eq(1), + self.cmd.we.eq(1), + self.cmd.is_cmd.eq(1), + ] + + with m.If(self.cmd.ready): + m.next = "Refresh" + with m.State("Autoprecharge"): m.d.comb += row_close.eq(1)