move connection of bus.stall in icache.py,
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 18 Dec 2021 01:57:04 +0000 (01:57 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 18 Dec 2021 01:57:04 +0000 (01:57 +0000)
only create a fake bus.stall if ibus does not have a stall signal

src/soc/experiment/icache.py

index 2e5b33f3ef18b9457a484006a2e376b0690bca05..5417c8b365f7ea0bf3c3baf35f6c73cba9936cd7 100644 (file)
@@ -834,10 +834,6 @@ class ICache(FetchUnitInterface, Elaboratable):
         plru_victim      = Signal(WAY_BITS)
         replace_way      = Signal(WAY_BITS)
 
-        # fake-up the wishbone stall signal to comply with pipeline mode
-        # same thing is done in dcache.py
-        comb += self.bus.stall.eq(self.bus.cyc & ~self.bus.ack)
-
         # call sub-functions putting everything together,
         # using shared signals established above
         self.rams(m, r, cache_out_row, use_previous, replace_way, req_row)
@@ -887,6 +883,10 @@ class ICache(FetchUnitInterface, Elaboratable):
         comb += self.bus.ack.eq(ibus.ack)
         if hasattr(ibus, "stall"):
             comb += self.bus.stall.eq(ibus.stall)
+        else:
+            # fake-up the wishbone stall signal to comply with pipeline mode
+            # same thing is done in dcache.py
+            comb += self.bus.stall.eq(self.bus.cyc & ~self.bus.ack)
 
         return m