Use post-increment function to increment address when reading memory in RiscV::readMemory()
This commit is contained in:
@@ -299,18 +299,22 @@ namespace Targets::RiscV
|
||||
auto output = TargetMemoryBuffer();
|
||||
output.reserve(bytes);
|
||||
|
||||
/*
|
||||
* We only need to set the address once. No need to update it as we use the post-increment function to
|
||||
* increment the address. See MemoryAccessControlField::postIncrement
|
||||
*/
|
||||
this->riscVDebugInterface->writeDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_1, startAddress);
|
||||
|
||||
for (auto address = startAddress; address <= (startAddress + bytes - 1); address += 4) {
|
||||
auto command = AbstractCommandRegister();
|
||||
command.commandType = AbstractCommandRegister::CommandType::MEMORY_ACCESS;
|
||||
command.control = MemoryAccessControlField(
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
MemoryAccessControlField::MemorySize::SIZE_32,
|
||||
false
|
||||
).value();
|
||||
|
||||
this->riscVDebugInterface->writeDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_1, address);
|
||||
|
||||
this->executeAbstractCommand(command);
|
||||
|
||||
const auto data = this->riscVDebugInterface->readDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_0);
|
||||
|
||||
Reference in New Issue
Block a user