Loading TargetMemoryDescriptor for AVR8 targets
This commit is contained in:
@@ -127,8 +127,8 @@ TargetDescriptor Avr8Bit::Avr8::getDescriptor() {
|
|||||||
auto descriptor = TargetDescriptor();
|
auto descriptor = TargetDescriptor();
|
||||||
descriptor.id = this->getHumanReadableId();
|
descriptor.id = this->getHumanReadableId();
|
||||||
descriptor.name = this->getName();
|
descriptor.name = this->getName();
|
||||||
descriptor.ramSize = this->targetParameters.value().ramSize.value_or(0);
|
|
||||||
descriptor.registerDescriptorsByType = this->targetRegisterDescriptorsByType;
|
descriptor.registerDescriptorsByType = this->targetRegisterDescriptorsByType;
|
||||||
|
descriptor.memoryDescriptorsByType = this->targetMemoryDescriptorsByType;
|
||||||
|
|
||||||
std::transform(
|
std::transform(
|
||||||
this->targetVariantsById.begin(),
|
this->targetVariantsById.begin(),
|
||||||
@@ -481,6 +481,7 @@ void Avr8::initFromTargetDescriptionFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->loadTargetRegisterDescriptors();
|
this->loadTargetRegisterDescriptors();
|
||||||
|
this->loadTargetMemoryDescriptors();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avr8::loadTargetRegisterDescriptors() {
|
void Avr8::loadTargetRegisterDescriptors() {
|
||||||
@@ -552,6 +553,19 @@ void Avr8::loadTargetRegisterDescriptors() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Avr8::loadTargetMemoryDescriptors() {
|
||||||
|
this->targetMemoryDescriptorsByType.insert(std::pair(
|
||||||
|
TargetMemoryType::RAM,
|
||||||
|
TargetMemoryDescriptor(
|
||||||
|
TargetMemoryType::RAM,
|
||||||
|
TargetMemoryAddressRange(
|
||||||
|
this->targetParameters->ramStartAddress.value(),
|
||||||
|
this->targetParameters->ramSize.value()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
TargetSignature Avr8::getId() {
|
TargetSignature Avr8::getId() {
|
||||||
if (!this->id.has_value()) {
|
if (!this->id.has_value()) {
|
||||||
this->id = this->avr8Interface->getDeviceId();
|
this->id = this->avr8Interface->getDeviceId();
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
std::map<std::string, PadDescriptor> padDescriptorsByName;
|
std::map<std::string, PadDescriptor> padDescriptorsByName;
|
||||||
std::map<int, TargetVariant> targetVariantsById;
|
std::map<int, TargetVariant> targetVariantsById;
|
||||||
std::map<TargetRegisterType, TargetRegisterDescriptors> targetRegisterDescriptorsByType;
|
std::map<TargetRegisterType, TargetRegisterDescriptors> targetRegisterDescriptorsByType;
|
||||||
|
std::map<TargetMemoryType, TargetMemoryDescriptor> targetMemoryDescriptorsByType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves the appropriate TDF for the AVR8 target and populates this->targetDescriptionFile.
|
* Resolves the appropriate TDF for the AVR8 target and populates this->targetDescriptionFile.
|
||||||
@@ -141,6 +142,8 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit
|
|||||||
*/
|
*/
|
||||||
void loadTargetRegisterDescriptors();
|
void loadTargetRegisterDescriptors();
|
||||||
|
|
||||||
|
void loadTargetMemoryDescriptors();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts the ID from the target's memory.
|
* Extracts the ID from the target's memory.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user