From 43d8b84ac86f063328f730251f9c2cd55cae6f86 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 30 Sep 2020 09:45:56 +0100 Subject: [PATCH] fix read_tag to use word_select correctly --- src/soc/experiment/icache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/soc/experiment/icache.py b/src/soc/experiment/icache.py index 4fb56dcf..bcaf9b2e 100644 --- a/src/soc/experiment/icache.py +++ b/src/soc/experiment/icache.py @@ -398,7 +398,7 @@ def get_tag(addr): # end; # Read a tag from a tag memory row def read_tag(way, tagset): - return tagset.word_select(way, TAG_WIDTH)[:TAG_BITS] + return tagset.word_select(way, TAG_BITS) # -- Write a tag to tag memory row # procedure write_tag(way: in way_t; @@ -408,7 +408,7 @@ def read_tag(way, tagset): # end; # Write a tag to tag memory row def write_tag(way, tagset, tag): - return tagset[way * TAG_BITS:(way + 1) * TAG_BITS].eq(tag) + return read_tag(way, tagset).eq(tag) # -- Simple hash for direct-mapped TLB index # function hash_ea(addr: std_ulogic_vector(63 downto 0)) -- 2.30.2