Renamed RiscVDebugSpec to RiscVDebug

This commit is contained in:
Nav
2025-02-02 13:32:25 +00:00
parent a5e027b944
commit f3cd55e53f
33 changed files with 65 additions and 65 deletions

View File

@@ -0,0 +1,34 @@
#include "DebugTranslatorConfig.hpp"
#include <cstdint>
#include <string>
#include "src/Logger/Logger.hpp"
namespace DebugToolDrivers::Protocols::RiscVDebug
{
DebugTranslatorConfig::DebugTranslatorConfig(const YAML::Node& configNode) {
if (configNode["target_response_timeout"]) {
this->targetResponseTimeout = std::chrono::microseconds{
configNode["target_response_timeout"].as<std::int64_t>(this->targetResponseTimeout.count())
};
}
if (configNode["preferred_memory_access_strategy"]) {
const auto strategy = configNode["preferred_memory_access_strategy"].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 "
"('preferred_memory_access_strategy'). Parameter will be ignored."
);
}
}
}
}