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();
|
auto output = TargetMemoryBuffer();
|
||||||
output.reserve(bytes);
|
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) {
|
for (auto address = startAddress; address <= (startAddress + bytes - 1); address += 4) {
|
||||||
auto command = AbstractCommandRegister();
|
auto command = AbstractCommandRegister();
|
||||||
command.commandType = AbstractCommandRegister::CommandType::MEMORY_ACCESS;
|
command.commandType = AbstractCommandRegister::CommandType::MEMORY_ACCESS;
|
||||||
command.control = MemoryAccessControlField(
|
command.control = MemoryAccessControlField(
|
||||||
false,
|
false,
|
||||||
false,
|
true,
|
||||||
MemoryAccessControlField::MemorySize::SIZE_32,
|
MemoryAccessControlField::MemorySize::SIZE_32,
|
||||||
false
|
false
|
||||||
).value();
|
).value();
|
||||||
|
|
||||||
this->riscVDebugInterface->writeDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_1, address);
|
|
||||||
|
|
||||||
this->executeAbstractCommand(command);
|
this->executeAbstractCommand(command);
|
||||||
|
|
||||||
const auto data = this->riscVDebugInterface->readDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_0);
|
const auto data = this->riscVDebugInterface->readDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_0);
|
||||||
|
|||||||
Reference in New Issue
Block a user