diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 1268f131..d543eb0c 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -127,8 +127,8 @@ TargetDescriptor Avr8Bit::Avr8::getDescriptor() { auto descriptor = TargetDescriptor(); descriptor.id = this->getHumanReadableId(); descriptor.name = this->getName(); - descriptor.ramSize = this->targetParameters.value().ramSize.value_or(0); descriptor.registerDescriptorsByType = this->targetRegisterDescriptorsByType; + descriptor.memoryDescriptorsByType = this->targetMemoryDescriptorsByType; std::transform( this->targetVariantsById.begin(), @@ -481,6 +481,7 @@ void Avr8::initFromTargetDescriptionFile() { } this->loadTargetRegisterDescriptors(); + this->loadTargetMemoryDescriptors(); } 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() { if (!this->id.has_value()) { this->id = this->avr8Interface->getDeviceId(); diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp index 3a20cf98..0183cc26 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp @@ -124,6 +124,7 @@ namespace Bloom::Targets::Microchip::Avr::Avr8Bit std::map padDescriptorsByName; std::map targetVariantsById; std::map targetRegisterDescriptorsByType; + std::map targetMemoryDescriptorsByType; /** * 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 loadTargetMemoryDescriptors(); + /** * Extracts the ID from the target's memory. *