Retrieving AVR8 target registers and including them in the TargetDescriptor

This commit is contained in:
Nav
2021-08-07 17:15:48 +01:00
parent fd719f1cda
commit d709c8aac9
8 changed files with 205 additions and 12 deletions

View File

@@ -55,6 +55,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
std::map<std::string, PadDescriptor> padDescriptorsByName;
std::map<int, TargetVariant> targetVariantsById;
std::map<TargetRegisterType, TargetRegisterDescriptors> targetRegisterDescriptorsByType;
/**
* Populates this->supportedDebugPhysicalInterfaces with physical interfaces defined in the TDF.
*/
@@ -70,6 +72,11 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
*/
void loadTargetVariants();
/**
* Loads all register descriptors from the TDF, and populates this->targetRegisterDescriptorsByType.
*/
void loadTargetRegisterDescriptors();
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getFlashMemorySegment() const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getRamMemorySegment() const;
[[nodiscard]] std::optional<Targets::TargetDescription::MemorySegment> getIoMemorySegment() const;
@@ -117,6 +124,14 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
*/
virtual void loadUpdiTargetParameters(TargetParameters& targetParameters) const;
/**
* Extracts the register address offset, for registers from a particular module.
*
* @param moduleName
* @return
*/
[[nodiscard]] virtual std::uint32_t getRegisterAddressOffsetByModuleName(const std::string& moduleName) const;
public:
/**
* Will resolve the target description file using the target description JSON mapping and a given target signature.
@@ -177,6 +192,15 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit::TargetDescription
[[nodiscard]] const auto& getVariantsMappedById() const {
return this->targetVariantsById;
};
}
/**
* Returns a mapping of all target register descriptors extracted from the TDF, by type.
*
* @return
*/
[[nodiscard]] const auto& getRegisterDescriptorsMappedByType() const {
return this->targetRegisterDescriptorsByType;
}
};
}