From: Luke Kenneth Casson Leighton Date: Mon, 6 Dec 2021 14:01:56 +0000 (+0000) Subject: use one-hot binary-to-unary in dcache.py X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f52df46799bf616dcdcbcf10397323f2276ddcc;p=soc.git use one-hot binary-to-unary in dcache.py --- diff --git a/src/soc/experiment/dcache.py b/src/soc/experiment/dcache.py index 5f4982c4..a93aa92e 100644 --- a/src/soc/experiment/dcache.py +++ b/src/soc/experiment/dcache.py @@ -27,6 +27,7 @@ from enum import Enum, unique from nmigen import (Module, Signal, Elaboratable, Cat, Repl, Array, Const, Record) from nmutil.util import Display +from nmigen.lib.coding import Decoder from copy import deepcopy from random import randint, seed @@ -696,10 +697,10 @@ 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<