global (one) do_read signal in cache_rams dcache.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 6 Dec 2021 14:11:45 +0000 (14:11 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 6 Dec 2021 14:11:45 +0000 (14:11 +0000)
src/soc/experiment/dcache.py

index a93aa92e93552a00446b2212785700f84cb322c2..9b743cd074112c9dacc325c3eb9830ea5e440800 100644 (file)
@@ -1133,8 +1133,10 @@ class DCache(Elaboratable):
         comb += hit_req_way_onehot.eq(1<<r1.req.hit_way)
         comb += replace_way_onehot.eq(1<<replace_way)
 
+        do_read  = Signal()
+        comb += do_read.eq(1)
+
         for i in range(NUM_WAYS):
-            do_read  = Signal(name="do_rd%d" % i)
             rd_addr  = Signal(ROW_BITS, name="rd_addr_%d" % i)
             do_write = Signal(name="do_wr%d" % i)
             wr_addr  = Signal(ROW_BITS, name="wr_addr_%d" % i)
@@ -1154,7 +1156,6 @@ class DCache(Elaboratable):
             comb += way.wr_data.eq(wr_data)
 
             # Cache hit reads
-            comb += do_read.eq(1)
             comb += rd_addr.eq(early_req_row)
             with m.If(hit_way_onehot[i]):
                 comb += cache_out_row.eq(_d_out)