From 35fef9b41b82a802ec1eff0b1471018e51915793 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 25 Nov 2023 19:39:34 +0000 Subject: [PATCH] Moved abstract command construction outside of loop. Didn't need to be there. Improved efficiency --- src/Targets/RiscV/RiscV.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Targets/RiscV/RiscV.cpp b/src/Targets/RiscV/RiscV.cpp index ca039fc6..a4b69f1a 100644 --- a/src/Targets/RiscV/RiscV.cpp +++ b/src/Targets/RiscV/RiscV.cpp @@ -305,16 +305,16 @@ namespace Targets::RiscV */ 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, - true, - MemoryAccessControlField::MemorySize::SIZE_32, - false - ).value(); + auto command = AbstractCommandRegister(); + command.commandType = AbstractCommandRegister::CommandType::MEMORY_ACCESS; + command.control = MemoryAccessControlField( + false, + true, + MemoryAccessControlField::MemorySize::SIZE_32, + false + ).value(); + for (auto address = startAddress; address <= (startAddress + bytes - 1); address += 4) { this->executeAbstractCommand(command); const auto data = this->riscVDebugInterface->readDebugModuleRegister(RegisterAddress::ABSTRACT_DATA_0);