From 08e86534ecbb39254d4cf2f4537d4dd025ccd3e1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 18 Apr 2019 10:33:06 +0100 Subject: [PATCH] add in name into plru to help debugging --- TLB/src/ariane/TreePLRU.cpp | 4 ++-- TLB/src/ariane/tlb.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TLB/src/ariane/TreePLRU.cpp b/TLB/src/ariane/TreePLRU.cpp index 6d12f5ba..2f6aeea5 100644 --- a/TLB/src/ariane/TreePLRU.cpp +++ b/TLB/src/ariane/TreePLRU.cpp @@ -3,7 +3,7 @@ #include -#define NWAY 8 +#define NWAY 4 #define NLINE 256 #define HIT 0 #define MISS 1 @@ -208,4 +208,4 @@ int main() multiply(m1, m2, res); cout << cache << endl; return 0; -} \ No newline at end of file +} diff --git a/TLB/src/ariane/tlb.py b/TLB/src/ariane/tlb.py index 6d419c94..7d664cad 100644 --- a/TLB/src/ariane/tlb.py +++ b/TLB/src/ariane/tlb.py @@ -231,8 +231,10 @@ class PLRU: # lvl0 <=> MSB, lvl1 <=> MSB-1, ... shift = LOG_TLB - lvl; new_idx = (i >> (shift-1)) & 1; - plru = Signal(reset_less=True) - m.d.comb += plru.eq(plru_tree[idx_base + (i>>shift)]) + plru_idx = idx_base + (i>>shift) + plru = Signal(reset_less=True, + name="plru-%d-%d-%d" % (i, lvl, plru_idx)) + m.d.comb += plru.eq(plru_tree[plru_idx]) # en &= plru_tree_q[idx_base + (i>>shift)] == new_idx; if new_idx: en.append(~plru) # yes inverted (using bool()) -- 2.30.2