From: Luke Kenneth Casson Leighton Date: Sun, 5 Dec 2021 12:41:56 +0000 (+0000) Subject: using same tag/row functions as in dcache.py X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d7437f27a1fa1610b06262ec89b3b9ea2932e1f6;p=soc.git using same tag/row functions as in dcache.py --- diff --git a/src/soc/experiment/icache.py b/src/soc/experiment/icache.py index a4a6fac5..5936cbe9 100644 --- a/src/soc/experiment/icache.py +++ b/src/soc/experiment/icache.py @@ -227,7 +227,7 @@ def get_row(addr): # Return the index of a row within a line def get_row_of_line(row): - return row[:ROW_LINE_BITS] + return row[:ROW_BITS][:ROW_LINE_BITS] # Returns whether this is the last row of a line def is_last_row_addr(addr, last): @@ -256,7 +256,7 @@ def get_tag(addr): # Read a tag from a tag memory row def read_tag(way, tagset): - return tagset.word_select(way, TAG_BITS) + return tagset.word_select(way, TAG_WIDTH)[:TAG_BITS] # Write a tag to tag memory row def write_tag(way, tagset, tag):