wishbone/Cache: avoid REFILL_WRTAG state to improve speed.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 10 Jan 2020 11:52:14 +0000 (12:52 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 10 Jan 2020 13:25:07 +0000 (14:25 +0100)
litex/soc/interconnect/wishbone.py

index 1fbdf975981031ab818e3c999870f82eae971f77..d9cdcd3a6983b6803b676089e08ab62982bdbff1 100644 (file)
@@ -606,7 +606,10 @@ class Cache(Module):
                 If(tag_do.dirty,
                     NextState("EVICT")
                 ).Else(
-                    NextState("REFILL_WRTAG")
+                    # Write the tag first to set the slave address
+                    tag_port.we.eq(1),
+                    word_clr.eq(1),
+                    NextState("REFILL")
                 )
             )
         )
@@ -618,16 +621,13 @@ class Cache(Module):
             If(slave.ack,
                 word_inc.eq(1),
                  If(word_is_last(word),
-                    NextState("REFILL_WRTAG")
+                    # Write the tag first to set the slave address
+                    tag_port.we.eq(1),
+                    word_clr.eq(1),
+                    NextState("REFILL")
                 )
             )
         )
-        fsm.act("REFILL_WRTAG",
-            # Write the tag first to set the slave address
-            tag_port.we.eq(1),
-            word_clr.eq(1),
-            NextState("REFILL")
-        )
         fsm.act("REFILL",
             slave.stb.eq(1),
             slave.cyc.eq(1),