summaryrefslogtreecommitdiff
path: root/src/utils/utils.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-11 20:34:40 -0400
committerGitHub <noreply@github.com>2025-03-11 20:34:40 -0400
commit1b01b557e76f8643964e5c367c072ab7778036f6 (patch)
tree30947c7018653ca18d4a69de20936b3615768f9e /src/utils/utils.cc
parent92e8c2583695a3bf652e0e8dedb79e7a99922f5f (diff)
parentc55104f8e99ea6ccb0c66a5e0d3cfc81dbbc19ab (diff)
Merge pull request #26 from bdunahu/bdunahu
clarify macro names, implement load in CLI, fix many display issues
Diffstat (limited to 'src/utils/utils.cc')
-rw-r--r--src/utils/utils.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/utils/utils.cc b/src/utils/utils.cc
index f95d88f..ebbc1e9 100644
--- a/src/utils/utils.cc
+++ b/src/utils/utils.cc
@@ -7,9 +7,8 @@
void get_bit_fields(int address, int *tag, int *index, int *offset)
{
*tag = GET_MID_BITS(
- address, LINE_SPEC + L1_CACHE_SPEC,
- MEM_SPEC + LINE_SPEC + L1_CACHE_SPEC);
- *index = GET_MID_BITS(address, LINE_SPEC, L1_CACHE_SPEC + 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_SIZE) + MEM_SIZE) % MEM_SIZE;
+ return ((address % MEM_WORDS) + MEM_WORDS) % MEM_WORDS;
}
- return address % MEM_SIZE;
+ return address % MEM_WORDS;
}