From: Luke Kenneth Casson Leighton Date: Mon, 31 Jan 2022 15:57:56 +0000 (+0000) Subject: convert TLBValidArray in ICache to SRLatch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b898fb2ed39768f8a416c5c66a01db5185a0bc7c;p=soc.git convert TLBValidArray in ICache to SRLatch --- diff --git a/src/soc/experiment/icache.py b/src/soc/experiment/icache.py index 12651583..20853127 100644 --- a/src/soc/experiment/icache.py +++ b/src/soc/experiment/icache.py @@ -194,10 +194,6 @@ def RowPerLineValidArray(): # attribute ram_style : string; # attribute ram_style of cache_tags : signal is "distributed"; -def TLBValidArray(): - return Array(Signal(name="tlb_valid%d" % x) - for x in range(TLB_SIZE)) - def TLBRecord(name): tlb_layout = [ ('tag', TLB_EA_TAG_BITS), ('pte', TLB_PTE_BITS) @@ -421,7 +417,7 @@ class ICache(FetchUnitInterface, Elaboratable): pte[TLB_LG_PGSZ:REAL_ADDR_BITS])) with m.If(ttag == i_in.nia[TLB_LG_PGSZ + TLB_BITS:64]): - comb += ra_valid.eq(itlb_valid[tlb_req_index]) + comb += ra_valid.eq(itlb_valid.q.bit_select(tlb_req_index, 1)) comb += eaa_priv.eq(pte[3]) @@ -441,19 +437,20 @@ class ICache(FetchUnitInterface, Elaboratable): m_in = self.m_in - wr_index = Signal(TLB_SIZE) + wr_index = Signal(TLB_BITS) + wr_unary = Signal(TLB_SIZE) comb += wr_index.eq(hash_ea(m_in.addr)) + comb += wr_unary.eq(1<