Implemented memory access via program buffer, in RISC-V debug translator

- Support for multiple memory access strategies (abstract commands and program buffer)
- Probing of memory access strategies
- Included `preferredMemoryAccessStrategy` debug translator config param
- Other bits of tidying in the RISC-V debug translator
This commit is contained in:
Nav
2024-11-23 20:14:47 +00:00
parent e207440cd9
commit d8131080ec
18 changed files with 927 additions and 100 deletions

View File

@@ -1,6 +1,9 @@
#include "DebugTranslatorConfig.hpp"
#include <cstdint>
#include <string>
#include "src/Logger/Logger.hpp"
namespace DebugToolDrivers::Protocols::RiscVDebugSpec
{
@@ -10,5 +13,22 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
configNode["targetResponseTimeout"].as<std::int64_t>(this->targetResponseTimeout.count())
};
}
if (configNode["preferredMemoryAccessStrategy"]) {
const auto strategy = configNode["preferredMemoryAccessStrategy"].as<std::string>();
if (strategy == "abstract-command") {
this->preferredMemoryAccessStrategy = DebugModule::MemoryAccessStrategy::ABSTRACT_COMMAND;
} else if (strategy == "program-buffer") {
this->preferredMemoryAccessStrategy = DebugModule::MemoryAccessStrategy::PROGRAM_BUFFER;
} else {
Logger::error(
"Invalid value (\"" + strategy + "\") provided for RISC-V debug translator config parameter "
"('preferredMemoryAccessStrategy'). Parameter will be ignored."
);
}
}
}
}