diff options
author | bd <bdunahu@operationnull.com> | 2025-03-28 19:55:04 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-28 19:55:04 -0400 |
commit | 7b3abbd51c91b51725a12d17fad6ecbfcdb19975 (patch) | |
tree | 4fdd60cc2de9f0a68814bf47d42d675593a965a0 /src/utils/utils.cc | |
parent | 9cd1f287f0c86b36788cd8ede812b847c584f711 (diff) |
Move get_instr_fields, add all instruction mnemonics
Diffstat (limited to 'src/utils/utils.cc')
-rw-r--r-- | src/utils/utils.cc | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/utils/utils.cc b/src/utils/utils.cc index 3b140e0..e12a0e0 100644 --- a/src/utils/utils.cc +++ b/src/utils/utils.cc @@ -4,8 +4,6 @@ #include <string> #include <vector> -static Logger *global_log = Logger::getInstance(); - 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); @@ -13,53 +11,6 @@ void get_cache_fields(int address, int *tag, int *index, int *offset) *offset = GET_LS_BITS(address, LINE_SPEC); } -void get_instr_fields( - signed int &s1, - signed int &s2, - signed int &s3, - unsigned int &type, - unsigned int &opcode) -{ - type = GET_LS_BITS(s1, TYPE_SIZE); - switch (type) { - case 0: - // R-TYPE - opcode = GET_MID_BITS(s1, TYPE_SIZE, TYPE_SIZE + R_OPCODE_SIZE); - s3 = GET_MID_BITS( - s1, TYPE_SIZE + R_OPCODE_SIZE + (REG_SIZE * 2), - TYPE_SIZE + R_OPCODE_SIZE + (REG_SIZE * 3)); - s2 = GET_MID_BITS( - s1, TYPE_SIZE + R_OPCODE_SIZE + REG_SIZE, - TYPE_SIZE + R_OPCODE_SIZE + (REG_SIZE * 2)); - s1 = GET_MID_BITS( - s1, TYPE_SIZE + R_OPCODE_SIZE, - TYPE_SIZE + R_OPCODE_SIZE + REG_SIZE); - break; - case 1: - // I-TYPE - opcode = GET_MID_BITS(s1, TYPE_SIZE, TYPE_SIZE + OPCODE_SIZE); - s3 = GET_MID_BITS( - s1, TYPE_SIZE + OPCODE_SIZE + (REG_SIZE * 2), WORD_SPEC); - s2 = GET_MID_BITS( - s1, TYPE_SIZE + OPCODE_SIZE + REG_SIZE, - TYPE_SIZE + OPCODE_SIZE + (REG_SIZE * 2)); - s1 = GET_MID_BITS( - s1, TYPE_SIZE + OPCODE_SIZE, TYPE_SIZE + OPCODE_SIZE + REG_SIZE); - break; - case 2: - // J-TYPE - opcode = GET_MID_BITS(s1, TYPE_SIZE, TYPE_SIZE + OPCODE_SIZE); - s2 = GET_MID_BITS(s1, TYPE_SIZE + OPCODE_SIZE + REG_SIZE, WORD_SPEC); - s1 = GET_MID_BITS( - s1, TYPE_SIZE + OPCODE_SIZE, TYPE_SIZE + OPCODE_SIZE + REG_SIZE); - break; - default: - global_log->log( - DEBUG, - string_format("%s returning invalid type: %d", __FUNCTION__, type)); - } -} - const std::string string_format(const char *const zcFormat, ...) { va_list vaArgs; |