From b898fb2ed39768f8a416c5c66a01db5185a0bc7c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 31 Jan 2022 15:57:56 +0000 Subject: [PATCH] convert TLBValidArray in ICache to SRLatch --- src/soc/experiment/icache.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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<