Refactor to use SparseArrayMM from VSRTL
MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -76,7 +76,7 @@ void ProcessorHandler::writeMem(uint32_t address, uint32_t value, int size) {
m_currentProcessor->getMemory().writeMem(address, value, size);
}
-const vsrtl::core::SparseArray& ProcessorHandler::getMemory() const {
+const vsrtl::core::SparseArrayMM& ProcessorHandler::getMemory() const {
return m_currentProcessor->getMemory();
}

MODIFY
src/processorhandler.h
src/processorhandler.h
@@ -88,7 +88,7 @@ public:
* @brief getMemory & getRegisters
* returns const-wrapped references to the current process memory elements
*/
- const vsrtl::core::SparseArray& getMemory() const;
+ const vsrtl::core::SparseArrayMM& getMemory() const;
const vsrtl::core::SparseArray& getRegisters() const;
const vsrtl::core::RVMemory<RV_REG_WIDTH, RV_REG_WIDTH>* getDataMemory() const;
const vsrtl::core::ROM<RV_REG_WIDTH, RV_INSTR_WIDTH>* getInstrMemory() const;

MODIFY
src/processors/RISC-V/rv5s/rv5s.h
src/processors/RISC-V/rv5s/rv5s.h
@@ -306,7 +306,7 @@ public:
SUBCOMPONENT(mem_stalled_or, TYPE(Or<1, 2>));
// Address spaces
- ADDRESSSPACE(m_memory);
+ ADDRESSSPACEMM(m_memory);
ADDRESSSPACE(m_regMem);
SUBCOMPONENT(ecallChecker, EcallChecker);
@@ -414,7 +414,7 @@ public:
propagateDesign();
}
void setPCInitialValue(uint32_t address) override { pc_reg->setInitValue(address); }
- SparseArray& getMemory() override { return *m_memory; }
+ SparseArrayMM& getMemory() override { return *m_memory; }
unsigned int getRegister(RegisterFileType rfid, unsigned i) const override { return registerFile->getRegister(i); }
SparseArray& getArchRegisters() override { return *m_regMem; }
void finalize(const FinalizeReason& fr) override {

MODIFY
src/processors/RISC-V/rv5s_no_fw_hz/rv5s_no_fw_hz.h
src/processors/RISC-V/rv5s_no_fw_hz/rv5s_no_fw_hz.h
@@ -239,7 +239,7 @@ public:
SUBCOMPONENT(efsc_or, TYPE(Or<1, 2>));
// Address spaces
- ADDRESSSPACE(m_memory);
+ ADDRESSSPACEMM(m_memory);
ADDRESSSPACE(m_regMem);
SUBCOMPONENT(ecallChecker, EcallChecker);
@@ -341,7 +341,7 @@ public:
propagateDesign();
}
void setPCInitialValue(uint32_t address) override { pc_reg->setInitValue(address); }
- SparseArray& getMemory() override { return *m_memory; }
+ SparseArrayMM& getMemory() override { return *m_memory; }
unsigned int getRegister(RegisterFileType rfid, unsigned i) const override { return registerFile->getRegister(i); }
SparseArray& getArchRegisters() override { return *m_regMem; }
void finalize(const FinalizeReason& fr) override {

MODIFY
src/processors/RISC-V/rv5s_no_hz/rv5s_no_hz.h
src/processors/RISC-V/rv5s_no_hz/rv5s_no_hz.h
@@ -272,7 +272,7 @@ public:
SUBCOMPONENT(efsc_or, TYPE(Or<1, 2>));
// Address spaces
- ADDRESSSPACE(m_memory);
+ ADDRESSSPACEMM(m_memory);
ADDRESSSPACE(m_regMem);
SUBCOMPONENT(ecallChecker, EcallChecker);
@@ -374,7 +374,7 @@ public:
propagateDesign();
}
void setPCInitialValue(uint32_t address) override { pc_reg->setInitValue(address); }
- SparseArray& getMemory() override { return *m_memory; }
+ SparseArrayMM& getMemory() override { return *m_memory; }
unsigned int getRegister(RegisterFileType rfid, unsigned i) const override { return registerFile->getRegister(i); }
SparseArray& getArchRegisters() override { return *m_regMem; }
void finalize(const FinalizeReason& fr) override {

MODIFY
src/processors/RISC-V/rv_registerfile.h
src/processors/RISC-V/rv_registerfile.h
@@ -81,7 +81,7 @@ public:
OUTPUTPORT(r1_out, RV_REG_WIDTH);
OUTPUTPORT(r2_out, RV_REG_WIDTH);
- VSRTL_VT_U getRegister(unsigned i) { return m_memory->readMem(i << 2); }
+ VSRTL_VT_U getRegister(unsigned i) const { return m_memory->readMemConst(i << 2); }
std::vector<VSRTL_VT_U> getRegisters() {
std::vector<VSRTL_VT_U> regs;

MODIFY
src/processors/RISC-V/rvss/rvss.h
src/processors/RISC-V/rvss/rvss.h
@@ -142,7 +142,7 @@ public:
SUBCOMPONENT(controlflow_or, TYPE(Or<1, 2>));
// Address spaces
- ADDRESSSPACE(m_memory);
+ ADDRESSSPACEMM(m_memory);
ADDRESSSPACE(m_regMem);
SUBCOMPONENT(ecallChecker, EcallChecker);
@@ -160,7 +160,7 @@ public:
propagateDesign();
}
void setPCInitialValue(uint32_t address) override { pc_reg->setInitValue(address); }
- SparseArray& getMemory() override { return *m_memory; }
+ SparseArrayMM& getMemory() override { return *m_memory; }
unsigned int getRegister(RegisterFileType rfid, unsigned i) const override { return registerFile->getRegister(i); }
SparseArray& getArchRegisters() override { return *m_regMem; }
void finalize(const FinalizeReason& fr) override {

MODIFY
src/processors/ripesprocessor.h
src/processors/ripesprocessor.h
@@ -103,7 +103,7 @@ public:
* @brief getMemory
* @return reference to the address space utilized by the implementing processor
*/
- virtual SparseArray& getMemory() = 0;
+ virtual SparseArrayMM& getMemory() = 0;
/**
* @brief getData/InstrMemory

Refactor to use SparseArrayMM from VSRTL