From: Luke Kenneth Casson Leighton Date: Wed, 30 Sep 2020 08:45:56 +0000 (+0100) Subject: fix read_tag to use word_select correctly X-Git-Tag: 24jan2021_ls180~282 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43d8b84ac86f063328f730251f9c2cd55cae6f86;p=soc.git fix read_tag to use word_select correctly --- 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))