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:
@@ -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."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user