diff --git a/litex/soc/interconnect/wishbone.py b/litex/soc/interconnect/wishbone.py index 1fbdf9759..d9cdcd3a6 100644 --- a/litex/soc/interconnect/wishbone.py +++ b/litex/soc/interconnect/wishbone.py @@ -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),