diff --git a/inc/Registers.h b/inc/Registers.h index f2d1194..eef56a0 100644 --- a/inc/Registers.h +++ b/inc/Registers.h @@ -11,6 +11,7 @@ #define SC_INCLUDE_DYNAMIC_PROCESSES #include +#include #include "systemc" #include "tlm.h" @@ -254,7 +255,10 @@ private: /** * CSR registers (4096 maximum) */ - uint32_t CSR[4096]; + //uint32_t CSR[4096]; + std::unordered_map CSR; + + Performance *perf; void initCSR(void); diff --git a/src/Registers.cpp b/src/Registers.cpp index b49f6f8..cc7dc09 100644 --- a/src/Registers.cpp +++ b/src/Registers.cpp @@ -11,7 +11,7 @@ Registers::Registers() { memset(register_bank, 0, sizeof(uint32_t) * 32); // 32 registers of 32 bits each - memset(CSR, 0, sizeof(uint32_t) * 4096); + //memset(CSR, 0, sizeof(uint32_t) * 4096); perf = Performance::getInstance(); initCSR(); @@ -156,7 +156,7 @@ uint32_t Registers::getCSR(int csr) { - sc_core::sc_time(sc_core::SC_ZERO_TIME)).to_double()) >> 32 & 0x00000000FFFFFFFF); break; - default: + [[likely]] default: ret_value = CSR[csr]; break; }