From 631f7a02932a4d5dc54125df20629aca91de2399 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 5 Dec 2021 23:16:28 +0000 Subject: [PATCH] use unary encoding (one-hot) for replace_way hit_way etc. otherwise it produces binary CAM-compares --- src/soc/experiment/dcache.py | 37 +++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/soc/experiment/dcache.py b/src/soc/experiment/dcache.py index 39c9e309..5f4982c4 100644 --- a/src/soc/experiment/dcache.py +++ b/src/soc/experiment/dcache.py @@ -695,14 +695,19 @@ class DCache(Elaboratable): if TLB_NUM_WAYS == 0: return + + # XXX TODO: use a Binary-to-Unary Encoder here + tlb_hit_onehot = Signal(TLB_SET_SIZE) + with m.If(r1.tlb_hit.valid): + comb += tlb_hit_onehot.eq(1<