From 249e5bc94ef86307ecf68f8a07c65b2672ebb21c Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 12 Apr 2025 00:10:52 -0400 Subject: Delete some more storage-only files --- src/sim/ex.cc | 2 +- src/utils/utils.cc | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 src/utils/utils.cc (limited to 'src') diff --git a/src/sim/ex.cc b/src/sim/ex.cc index b6f8a1d..50f00a8 100644 --- a/src/sim/ex.cc +++ b/src/sim/ex.cc @@ -1,6 +1,6 @@ #include "ex.h" #include "accessor.h" -#include "definitions.h" +#include "pipe_spec.h" #include "instrDTO.h" #include "response.h" #include "stage.h" diff --git a/src/utils/utils.cc b/src/utils/utils.cc deleted file mode 100644 index e12a0e0..0000000 --- a/src/utils/utils.cc +++ /dev/null @@ -1,42 +0,0 @@ -#include "utils.h" -#include "definitions.h" -#include -#include -#include - -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); - *index = GET_MID_BITS(address, LINE_SPEC, L1_CACHE_LINE_SPEC + LINE_SPEC); - *offset = GET_LS_BITS(address, LINE_SPEC); -} - -const std::string string_format(const char *const zcFormat, ...) -{ - va_list vaArgs; - va_start(vaArgs, zcFormat); - - va_list vaArgsCopy; - va_copy(vaArgsCopy, vaArgs); - const int iLen = std::vsnprintf(NULL, 0, zcFormat, vaArgsCopy); - va_end(vaArgsCopy); - - std::vector zc(iLen + 1); - std::vsnprintf(zc.data(), zc.size(), zcFormat, vaArgs); - va_end(vaArgs); - return std::string(zc.data(), iLen); -} - -int wrap_address(int address) -{ - if (address < 0) { - return ((address % MEM_WORDS) + MEM_WORDS) % MEM_WORDS; - } - return address % MEM_WORDS; -} - -void get_memory_index(int address, int &line, int &word) -{ - line = wrap_address(address) / LINE_SIZE; - word = address % LINE_SIZE; -} -- cgit v1.2.3