Add interface in ProcessorHandler to write to simulator memory
Will be required for the implementation of some system calls, such as
reading from a file.
MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -61,6 +61,10 @@ void ProcessorHandler::loadProgram(std::shared_ptr<Program> p) {
emit reqProcessorReset();
}
+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 {
return m_currentProcessor->getMemory();
}

MODIFY
src/processorhandler.h
src/processorhandler.h
@@ -93,6 +93,13 @@ public:
*/
void setRegisterValue(const unsigned idx, uint32_t value);
+ /**
+ * @brief writeMem
+ * writes @p value from the given @p address start, and up to @p size bytes of @p value into the
+ * memory of the simulator
+ */
+ void writeMem(uint32_t address, uint32_t value, int size = sizeof(uint32_t));
+
/**
* @brief getRegisterValue
* @returns value of register @param idx

Add interface in ProcessorHandler to write to simulator memory

Will be required for the implementation of some system calls, such as
reading from a file.