diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/DebugModule.hpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/DebugModule.hpp index c0b8d4c5..04e77c2e 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/DebugModule.hpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/DebugModule.hpp @@ -21,4 +21,15 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule FAILED = 0x02, BUSY = 0x03, }; + + enum AbstractCommandError: std::uint8_t + { + NONE = 0x00, + BUSY = 0x01, + NOT_SUPPORTED = 0x02, + EXCEPTION = 0x03, + HALT_RESUME = 0x04, + BUS = 0x05, + OTHER = 0x07, + }; } diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractCommandRegister.hpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractCommandRegister.hpp index 57b837c4..cbf9eff0 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractCommandRegister.hpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractCommandRegister.hpp @@ -16,10 +16,8 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule::Registers MEMORY_ACCESS = 0x02, }; - std::uint32_t control = 0; - CommandType commandType = CommandType::REGISTER_ACCESS; - - AbstractCommandRegister() = default; + std::uint32_t control; + CommandType commandType; constexpr AbstractCommandRegister(std::uint32_t control, CommandType commandType) : control(control) diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractControlStatusRegister.hpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractControlStatusRegister.hpp index 2a834389..a6f1e638 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractControlStatusRegister.hpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/AbstractControlStatusRegister.hpp @@ -8,28 +8,15 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule::Registers { struct AbstractControlStatusRegister { - enum CommandError: std::uint8_t - { - NONE = 0x00, - BUSY = 0x01, - NOT_SUPPORTED = 0x02, - EXCEPTION = 0x03, - HALT_RESUME = 0x04, - BUS = 0x05, - OTHER = 0x07, - }; - - std::uint8_t dataCount:4 = 0; - CommandError commandError:3 = CommandError::NONE; - bool relaxedPrivilege:1 = false; - bool busy:1 = false; - std::uint8_t programBufferSize:5 = 0; - - AbstractControlStatusRegister() = default; + std::uint8_t dataCount:4; + AbstractCommandError commandError:3; + bool relaxedPrivilege:1; + bool busy:1; + std::uint8_t programBufferSize:5; constexpr explicit AbstractControlStatusRegister(RegisterValue registerValue) : dataCount(static_cast(registerValue & 0x0F)) - , commandError(static_cast((registerValue >> 8) & 0x07)) + , commandError(static_cast((registerValue >> 8) & 0x07)) , relaxedPrivilege(static_cast(registerValue & (0x01 << 11))) , busy(static_cast(registerValue & (0x01 << 12))) , programBufferSize(static_cast((registerValue >> 24) & 0x1F)) @@ -47,7 +34,7 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule::Registers constexpr void clearCommandError() { // Setting all of the bits will clear the field - this->commandError = CommandError::OTHER; + this->commandError = AbstractCommandError::OTHER; } }; } diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/MemoryAccessControlField.hpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/MemoryAccessControlField.hpp index 9b549e3f..dd1b80af 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/MemoryAccessControlField.hpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/MemoryAccessControlField.hpp @@ -17,12 +17,10 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule::Registers SIZE_128 = 0x04, }; - bool write:1 = false; - bool postIncrement:1 = false; - MemorySize size:3 = MemorySize::SIZE_32; - bool virtualAddress:1 = false; - - constexpr MemoryAccessControlField() = default; + bool write:1; + bool postIncrement:1; + MemorySize size:3; + bool virtualAddress:1; constexpr MemoryAccessControlField( bool write, diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/RegisterAccessControlField.hpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/RegisterAccessControlField.hpp index 88f497a3..7e824ce4 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/RegisterAccessControlField.hpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/RegisterAccessControlField.hpp @@ -16,11 +16,11 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule::Registers }; RegisterNumber registerNumber; - bool write:1 = false; - bool transfer:1 = false; - bool postExecute:1 = false; - bool postIncrement:1 = false; - RegisterSize size:3 = RegisterSize::SIZE_32; + bool write:1; + bool transfer:1; + bool postExecute:1; + bool postIncrement:1; + RegisterSize size:3; RegisterAccessControlField( RegisterNumber registerNumber, diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/StatusRegister.hpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/StatusRegister.hpp index 5fff2851..62b399a5 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/StatusRegister.hpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugModule/Registers/StatusRegister.hpp @@ -8,26 +8,26 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec::DebugModule::Registers { struct StatusRegister { - std::uint8_t version:4 = 0; - bool validConfigStructurePointer:1 = false; - bool supportsResetHalt:1 = false; - bool authBusy:1 = false; - bool authenticated:1 = false; - bool anyHalted:1 = false; - bool allHalted:1 = false; - bool anyRunning:1 = false; - bool allRunning:1 = false; - bool anyUnavailable:1 = false; - bool allUnavailable:1 = false; - bool anyNonExistent:1 = false; - bool allNonExistent:1 = false; - bool anyResumeAcknowledge:1 = false; - bool allResumeAcknowledge:1 = false; - bool anyHaveReset:1 = false; - bool allHaveReset:1 = false; - bool implicitBreak:1 = false; - bool stickyUnavailableBits:1 = false; - bool ndmResetPending:1 = false; + std::uint8_t version:4; + bool validConfigStructurePointer:1; + bool supportsResetHalt:1; + bool authBusy:1; + bool authenticated:1; + bool anyHalted:1; + bool allHalted:1; + bool anyRunning:1; + bool allRunning:1; + bool anyUnavailable:1; + bool allUnavailable:1; + bool anyNonExistent:1; + bool allNonExistent:1; + bool anyResumeAcknowledge:1; + bool allResumeAcknowledge:1; + bool anyHaveReset:1; + bool allHaveReset:1; + bool implicitBreak:1; + bool stickyUnavailableBits:1; + bool ndmResetPending:1; constexpr explicit StatusRegister(RegisterValue registerValue) : version(static_cast(registerValue & 0x0F))