Massive refactor to accommodate RISC-V targets
- Refactored entire codebase (excluding the Insight component) to accommodate multiple target architectures (no longer specific to AVR) - Deleted 'generate SVD' GDB monitor command - I will eventually move this functionality to the Bloom website - Added unit size property to address spaces - Many other changes which I couldn't be bothered to describe here
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "TargetMemory.hpp"
|
||||
#include "TargetMemorySegmentType.hpp"
|
||||
@@ -11,34 +13,48 @@ namespace Targets
|
||||
struct TargetMemorySegmentDescriptor
|
||||
{
|
||||
public:
|
||||
std::string key;
|
||||
/*
|
||||
* The ID of a memory segment is just a hash of the address space key and the memory segment key, concatenated,
|
||||
* which will be unique.
|
||||
*
|
||||
* We use the ID for cheap equality checks.
|
||||
*/
|
||||
const TargetMemorySegmentId id;
|
||||
const std::string key;
|
||||
std::string name;
|
||||
TargetMemorySegmentType type;
|
||||
TargetMemoryAddressRange addressRange;
|
||||
std::uint8_t addressSpaceUnitSize;
|
||||
bool executable;
|
||||
TargetMemoryAccess debugModeAccess;
|
||||
TargetMemoryAccess programmingModeAccess;
|
||||
std::optional<TargetMemorySize> pageSize;
|
||||
|
||||
TargetMemorySegmentDescriptor(
|
||||
const std::string& addressSpaceKey,
|
||||
const std::string& key,
|
||||
const std::string& name,
|
||||
TargetMemorySegmentType type,
|
||||
const TargetMemoryAddressRange& addressRange,
|
||||
std::uint8_t addressSpaceUnitSize,
|
||||
bool executable,
|
||||
const TargetMemoryAccess& debugModeAccess,
|
||||
const TargetMemoryAccess& programmingModeAccess,
|
||||
std::optional<TargetMemorySize> pageSize
|
||||
)
|
||||
: key(key)
|
||||
, name(name)
|
||||
, type(type)
|
||||
, addressRange(addressRange)
|
||||
, debugModeAccess(debugModeAccess)
|
||||
, programmingModeAccess(programmingModeAccess)
|
||||
, pageSize(pageSize)
|
||||
{};
|
||||
);
|
||||
|
||||
TargetMemorySize size() const {
|
||||
return this->addressRange.size();
|
||||
}
|
||||
TargetMemorySegmentDescriptor& operator = (const TargetMemorySegmentDescriptor& other) = delete;
|
||||
|
||||
TargetMemorySegmentDescriptor(TargetMemorySegmentDescriptor&& other) noexcept = default;
|
||||
|
||||
bool operator == (const TargetMemorySegmentDescriptor& other) const;
|
||||
bool operator != (const TargetMemorySegmentDescriptor& other) const;
|
||||
|
||||
TargetMemorySize size() const;
|
||||
|
||||
[[nodiscard]] TargetMemorySegmentDescriptor clone() const;
|
||||
|
||||
private:
|
||||
TargetMemorySegmentDescriptor(const TargetMemorySegmentDescriptor& other) = default;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user