fix icache row store issue
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 5 Dec 2021 13:38:19 +0000 (13:38 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 5 Dec 2021 13:38:19 +0000 (13:38 +0000)
src/soc/experiment/dcache.py
src/soc/experiment/icache.py

index 0b5950ce550c7d8244277fb1d5f1cfc33d113732..a5548cfb6114859a35e13e0aaad81dbbb25c1a04 100644 (file)
@@ -1694,7 +1694,7 @@ cache_tags(r1.store_index)((i + 1) * TAG_WIDTH - 1 downto i * TAG_WIDTH) <=
 
         # deal with litex not doing wishbone pipeline mode
         # XXX in wrong way.  FIFOs are needed in the SRAM test
-        # so that stb/ack match up
+        # so that stb/ack match up. same thing done in icache.py
         comb += self.bus.stall.eq(self.bus.cyc & ~self.bus.ack)
 
         # Wire up wishbone request latch out of stage 1
index 5936cbe9f231499c5f7377f551908d57f7ec56f4..f84775622c4e9a4c8a704978cfe92188a72535e7 100644 (file)
@@ -676,12 +676,8 @@ class ICache(Elaboratable):
 
             # Calculate the next row address
             rarange = Signal(LINE_OFF_BITS - ROW_OFF_BITS)
-            comb += rarange.eq(
-                     r.req_adr[ROW_OFF_BITS:LINE_OFF_BITS] + 1
-                    )
-            sync += r.req_adr[ROW_OFF_BITS:LINE_OFF_BITS].eq(
-                     rarange
-                    )
+            comb += rarange.eq(r.req_adr[ROW_OFF_BITS:LINE_OFF_BITS] + 1)
+            sync += r.req_adr[ROW_OFF_BITS:LINE_OFF_BITS].eq(rarange)
             sync += Display("RARANGE r.req_adr:%x rarange:%x "
                             "stbs_zero:%x stbs_done:%x",
                             r.req_adr, rarange, stbs_zero, stbs_done)
@@ -695,8 +691,7 @@ class ICache(Elaboratable):
             sync += r.rows_valid[r.store_row % ROW_PER_LINE].eq(1)
 
             # Check for completion
-            with m.If(stbs_done &
-                      is_last_row(r.store_row, r.end_row_ix)):
+            with m.If(stbs_done & is_last_row(r.store_row, r.end_row_ix)):
                 # Complete wishbone cycle
                 sync += r.wb.cyc.eq(0)
                 # be nice, clear addr
@@ -712,11 +707,9 @@ class ICache(Elaboratable):
 
                 sync += r.state.eq(State.IDLE)
 
-            # not completed, move on to next request in row
-            with m.Else():
-                # Increment store row counter
-                sync += r.store_row.eq(next_row(r.store_row))
-
+            # move on to next request in row
+            # Increment store row counter
+            sync += r.store_row.eq(next_row(r.store_row))
 
     # Cache miss/reload synchronous machine
     def icache_miss(self, m, cache_valid_bits, r, req_is_miss,