2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <vector>
|
2021-08-07 17:15:48 +01:00
|
|
|
#include <map>
|
2023-05-21 21:08:25 +01:00
|
|
|
#include <algorithm>
|
2022-03-25 00:09:53 +00:00
|
|
|
#include <QMetaType>
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2021-10-09 19:17:58 +01:00
|
|
|
#include "TargetMemory.hpp"
|
2021-08-07 17:15:48 +01:00
|
|
|
#include "TargetRegister.hpp"
|
2021-04-04 21:04:12 +01:00
|
|
|
#include "TargetVariant.hpp"
|
|
|
|
|
|
|
|
|
|
namespace Bloom::Targets
|
|
|
|
|
{
|
|
|
|
|
struct TargetDescriptor
|
|
|
|
|
{
|
|
|
|
|
std::string name;
|
|
|
|
|
std::string id;
|
2022-08-30 02:51:10 +01:00
|
|
|
std::string vendorName;
|
2021-10-09 19:17:58 +01:00
|
|
|
std::map<TargetMemoryType, TargetMemoryDescriptor> memoryDescriptorsByType;
|
2023-05-21 21:08:25 +01:00
|
|
|
std::map<TargetRegisterDescriptorId, TargetRegisterDescriptor> registerDescriptorsById;
|
2021-04-04 21:04:12 +01:00
|
|
|
std::vector<TargetVariant> variants;
|
2022-05-15 17:42:20 +01:00
|
|
|
|
|
|
|
|
TargetMemoryType programMemoryType;
|
2023-05-21 21:08:25 +01:00
|
|
|
|
|
|
|
|
TargetDescriptor(
|
|
|
|
|
std::string id,
|
|
|
|
|
std::string name,
|
|
|
|
|
std::string vendorName,
|
|
|
|
|
std::map<TargetMemoryType, TargetMemoryDescriptor> memoryDescriptorsByType,
|
|
|
|
|
std::map<TargetRegisterDescriptorId, TargetRegisterDescriptor> registerDescriptorsById,
|
|
|
|
|
std::vector<TargetVariant> variants,
|
|
|
|
|
TargetMemoryType programMemoryType
|
|
|
|
|
)
|
|
|
|
|
: name(name)
|
|
|
|
|
, id(id)
|
|
|
|
|
, vendorName(vendorName)
|
|
|
|
|
, memoryDescriptorsByType(memoryDescriptorsByType)
|
|
|
|
|
, registerDescriptorsById(registerDescriptorsById)
|
|
|
|
|
, variants(variants)
|
|
|
|
|
, programMemoryType(programMemoryType)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
TargetRegisterDescriptorIds registerDescriptorIdsForType(TargetRegisterType type) {
|
|
|
|
|
auto output = TargetRegisterDescriptorIds();
|
|
|
|
|
|
|
|
|
|
for (const auto& [descriptorId, descriptor] : this->registerDescriptorsById) {
|
|
|
|
|
if (descriptor.type == type) {
|
|
|
|
|
output.insert(descriptorId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return output;
|
|
|
|
|
}
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-30 16:52:32 +01:00
|
|
|
Q_DECLARE_METATYPE(Bloom::Targets::TargetDescriptor)
|