From 53ed87699483e06ffc162446e32cd940ce80323b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 6 Dec 2021 14:41:32 +0000 Subject: [PATCH] use binary-to-unary encoders in dcache.py --- src/soc/experiment/dcache.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/soc/experiment/dcache.py b/src/soc/experiment/dcache.py index 9b743cd0..01022c22 100644 --- a/src/soc/experiment/dcache.py +++ b/src/soc/experiment/dcache.py @@ -699,8 +699,8 @@ class DCache(Elaboratable): # Binary-to-Unary one-hot, enabled by tlb_hit valid m.submodules.tlb_hit_e = te = Decoder(TLB_SET_SIZE) - te.n.eq(~r1.tlb_hit.valid) - te.i.eq(r1.tlb_hit_index) + comb += te.n.eq(~r1.tlb_hit.valid) + comb += te.i.eq(r1.tlb_hit_index) for i in range(TLB_SET_SIZE): # TLB PLRU interface @@ -825,8 +825,8 @@ class DCache(Elaboratable): # XXX TODO: use a Binary-to-Unary one-hot here, # enabled by cache_hit m.submodules.hit_e = he = Decoder(NUM_LINES) - he.n.eq(~r1.cache_hit) - he.i.eq(r1.hit_index) + comb += he.n.eq(~r1.cache_hit) + comb += he.i.eq(r1.hit_index) for i in range(NUM_LINES): # PLRU interface @@ -1123,15 +1123,17 @@ class DCache(Elaboratable): bus = self.bus # a Binary-to-Unary one-hots here - #m.submodules.hit_e = he = Decoder(NUM_LINES) - #he.n.eq(~r1.cache_hit) - #he.i.eq(r1.hit_index) - hit_way_onehot = Signal(NUM_WAYS) - replace_way_onehot = Signal(NUM_WAYS) - hit_req_way_onehot = Signal(NUM_WAYS) - comb += hit_way_onehot.eq(1<