From: Luke Kenneth Casson Leighton Date: Sun, 5 Dec 2021 23:16:28 +0000 (+0000) Subject: use unary encoding (one-hot) for replace_way hit_way etc. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=631f7a02932a4d5dc54125df20629aca91de2399;p=soc.git use unary encoding (one-hot) for replace_way hit_way etc. otherwise it produces binary CAM-compares --- 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<