diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-03-29 22:14:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-29 22:14:42 -0400 |
commit | b3566a17da8081147dba3711d415385450ed6019 (patch) | |
tree | cf5d6872eec0cf50d1831137a337bbbdfbee0ff1 /src/utils | |
parent | 495a8af3a90257e491c063730bccf86e34e153fa (diff) | |
parent | d8e33f871bfb8dbfbad3fa0d7e1e13af5bcde830 (diff) |
Merge pull request #37 from bdunahu/bdunahu
Instr, InstrDTO gets/sets, other structures required for decode
-- tests as we move forward
-- base classes
-- decode stage implemented
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/accessor.cc | 4 | ||||
-rw-r--r-- | src/utils/response.cc | 2 | ||||
-rw-r--r-- | src/utils/utils.cc | 10 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/utils/accessor.cc b/src/utils/accessor.cc index 86484c5..99347ed 100644 --- a/src/utils/accessor.cc +++ b/src/utils/accessor.cc @@ -3,6 +3,8 @@ std::ostream &operator<<(std::ostream &os, Accessor a) { - const std::string nameA[] = {"IDLE", "MEM", "FETCH", "L1CACHE", "SIDE"}; + const std::string nameA[] = { + "IDLE", "WRITE", "MEM", "EXEC", "DCDE", "FETCH", "L1CACHE", "SIDE", + }; return os << nameA[a]; } diff --git a/src/utils/response.cc b/src/utils/response.cc index def6578..3d6e439 100644 --- a/src/utils/response.cc +++ b/src/utils/response.cc @@ -3,6 +3,6 @@ std::ostream &operator<<(std::ostream &os, Response r) { - const std::string nameR[] = {"OK", "WAIT", "BLOCKED"}; + const std::string nameR[] = {"OK", "WAIT", "BLOCKED", "STALLED"}; return os << nameR[r]; } diff --git a/src/utils/utils.cc b/src/utils/utils.cc index 3a11c2c..e12a0e0 100644 --- a/src/utils/utils.cc +++ b/src/utils/utils.cc @@ -4,10 +4,9 @@ #include <string> #include <vector> -void get_bit_fields(int address, int *tag, int *index, int *offset) +void get_cache_fields(int address, int *tag, int *index, int *offset) { - *tag = GET_MID_BITS( - address, L1_CACHE_LINE_SPEC + LINE_SPEC, MEM_WORD_SPEC); + *tag = GET_MID_BITS(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); } @@ -28,8 +27,9 @@ const std::string string_format(const char *const zcFormat, ...) return std::string(zc.data(), iLen); } -int wrap_address(int address) { - if (address < 0){ +int wrap_address(int address) +{ + if (address < 0) { return ((address % MEM_WORDS) + MEM_WORDS) % MEM_WORDS; } return address % MEM_WORDS; |