summaryrefslogtreecommitdiff
path: root/src/utils/utils.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-11 19:02:55 -0400
committerbd <bdunahu@operationnull.com>2025-03-11 19:02:55 -0400
commitf3d6ceaa6f0d716a4b0d30c5c8b27c74c55b96ac (patch)
tree8721f192b627001a3d47af2157ba14b97c52d645 /src/utils/utils.cc
parent1e095065907c2ab7b3a9705fab7c44e60361e035 (diff)
fix lots of bugs
Diffstat (limited to 'src/utils/utils.cc')
-rw-r--r--src/utils/utils.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/utils/utils.cc b/src/utils/utils.cc
index 87ce488..ebbc1e9 100644
--- a/src/utils/utils.cc
+++ b/src/utils/utils.cc
@@ -7,8 +7,7 @@
void get_bit_fields(int address, int *tag, int *index, int *offset)
{
*tag = GET_MID_BITS(
- address, LINE_SPEC + L1_CACHE_LINE_SPEC,
- MEM_LINE_SPEC + LINE_SPEC + L1_CACHE_LINE_SPEC);
+ address, L1_CACHE_LINE_SPEC + LINE_SPEC, MEM_WORD_SPEC);
*index = GET_MID_BITS(address, LINE_SPEC, L1_CACHE_LINE_SPEC + LINE_SPEC);
*offset = GET_LS_BITS(address, LINE_SPEC);
}
@@ -31,7 +30,7 @@ const std::string string_format(const char *const zcFormat, ...)
int wrap_address(int address) {
if (address < 0){
- return ((address % MEM_LINES) + MEM_LINES) % MEM_LINES;
+ return ((address % MEM_WORDS) + MEM_WORDS) % MEM_WORDS;
}
- return address % MEM_LINES;
+ return address % MEM_WORDS;
}