New TargetMemoryDescriptor struct

This commit is contained in:
Nav
2021-10-09 19:17:58 +01:00
parent a3717bcffa
commit e7a30076d0
2 changed files with 14 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
#include <vector>
#include <map>
#include "TargetMemory.hpp"
#include "TargetRegister.hpp"
#include "TargetVariant.hpp"
@@ -14,7 +15,7 @@ namespace Bloom::Targets
{
std::string name;
std::string id;
std::uint32_t ramSize;
std::map<TargetMemoryType, TargetMemoryDescriptor> memoryDescriptorsByType;
std::map<TargetRegisterType, TargetRegisterDescriptors> registerDescriptorsByType;
std::vector<TargetVariant> variants;
};

View File

@@ -22,6 +22,18 @@ namespace Bloom::Targets
TargetMemoryAddressRange(std::uint32_t startAddress, std::uint32_t endAddress)
: startAddress(startAddress), endAddress(endAddress) {};
};
struct TargetMemoryDescriptor
{
TargetMemoryType type;
TargetMemoryAddressRange addressRange;
TargetMemoryDescriptor(TargetMemoryType type, TargetMemoryAddressRange addressRange)
: type(type), addressRange(addressRange) {};
std::uint32_t size() const {
return this->addressRange.endAddress - this->addressRange.startAddress;
}
};
using TargetMemoryBuffer = std::vector<unsigned char>;