Go to the documentation of this file.
60 "ic_dec_parameter_name";
62 "ic_dec_parameter_value";
85 icDecoderPluginName_(
""), icDecoderPluginFile_(
""), icDecoderHDB_(
""),
86 decompressorFile_(
""), sourceIDF_(
"") {
99 : icDecoderPluginName_(
""),
100 icDecoderPluginFile_(
""),
102 decompressorFile_(
""),
232 const std::string& unitName)
const {
246 const std::string& unitName)
const {
260 const std::string& unitName)
const {
273 const std::string& busName)
const {
287 const std::string& socketName)
const {
359 const string procName =
"MachineImplementation::fuImplementation";
361 __FILE__, __LINE__, procName,
362 "No implementation data found for function unit " + fu +
".");
381 const string procName =
"MachineImplementation::rfImplementation";
383 __FILE__, __LINE__, procName,
384 "No implementation data found for register file " + rf +
".");
405 "No implementation data found for immediate unit " + iu +
".");
426 "No implementation data found for bus " + bus +
".");
447 "No implementation data found for socket " + socket +
".");
536 const string procName =
"MachineImplementation::addFUImplementation";
557 const string procName =
"MachineImplementation::addRFImplementation";
578 const string procName =
"MachineImplementation::addRFImplementation";
635 bool removed =
false;
660 bool removed =
false;
685 bool removed =
false;
710 bool removed =
false;
736 bool removed =
false;
738 ImplementationTable::iterator iter =
763 const string procName =
"MachineImplementation::loadState";
783 for (
int i = 0; i < icdecState->
childCount(); i++) {
787 __FILE__, __LINE__, procName);
806 for (
int i = 0; i < fuGenerate->
childCount(); i++) {
826 for (
int i = 0; i < fuImplementations->
childCount(); i++) {
831 for (
int i = 0; i < rfImplementations->
childCount(); i++) {
836 for (
int i = 0; i < iuImplementations->
childCount(); i++) {
840 for (
int i = 0; i < busImplementations->
childCount(); i++) {
845 for (
int i = 0; i < socketImplementations->
childCount(); i++) {
852 __FILE__, __LINE__, procName, exception.
errorMessage());
883 std::vector<Parameter>::const_iterator iter =
894 icdecState->
addChild(parameterState);
908 fuGenerated->
addChild(fug.saveState());
941 state->
addChild(busImplementations);
950 state->
addChild(socketImplementations);
968 const std::vector<std::string>& sPaths) {
979 filePath, relPath)) {
1039 for (
auto&& op : fug.operations()) {
1040 std::string& hdb = op.hdb;
1067 size_t& missingFiles,
1068 size_t& alternativeFiles) {
1074 vector<string> localPaths;
1078 vector<string> defSearchPaths;
1092 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1105 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1119 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1135 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1148 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1161 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1174 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1187 }
else if (
checkImplFile(localPaths, defSearchPaths, filePath)) {
1195 alternativeFiles = 0;
1225 const std::vector<std::string>& primarySearchPaths,
1226 const std::vector<std::string>& secondarySearchPaths,
1227 std::string& file) {
1234 if (
TCEString(file).startsWith(
"tce:")) {
1267 file = alternativePath;
1289 const std::vector<std::string>& searchPaths,
1293 string filePath = implem.
hdbFile();
1298 filePath, relPath)) {
1299 implem.
setHDBFile(std::string(
"tce:") + relPath);
1317 const std::string& unitName)
const {
1319 for (ImplementationTable::const_iterator iter = table.begin();
1320 iter != table.end(); iter++) {
1342 if (index < 0 ||
static_cast<size_t>(index) >= table.size()) {
1343 const string procName =
"MachineImplementation::ensureIndexValidity";
1344 throw OutOfRange(__FILE__, __LINE__, procName);
1384 const string procName =
1385 "MachineImplementation::icDecoderParameterName";
1386 throw OutOfRange(__FILE__, __LINE__, procName);
1401 const string procName =
"MachineImplementation::icDecoderParamterName";
1402 throw OutOfRange(__FILE__, __LINE__, procName);
1417 std::vector<Parameter>::const_iterator iter =
1421 if ((*iter).name == name) {
1422 return (*iter).value;
1438 const std::string& name,
const std::string& value) {
1440 std::vector<Parameter>::iterator iter =
1445 if ((*iter).name == name) {
1446 (*iter).value = value;
1543 const std::string& path,
1544 std::string& resolvedPath) {
1549 std::vector<std::string> defaultPaths;
1551 defaultPaths.insert(defaultPaths.end(), tmp.begin(), tmp.end());
1553 defaultPaths.insert(defaultPaths.end(), tmp.begin(), tmp.end());
1555 defaultPaths.insert(defaultPaths.end(), tmp.begin(), tmp.end());
1559 defaultPaths, toSearched);
1571 const std::vector<FUGenerated>&
1579 std::vector<FUGenerated>&
1592 if (fug.name() == name) {
1609 [name](
FUGenerated& fu) { return fu.name() == name; }),
bool checkImplFile(const std::vector< std::string > &primarySearchPaths, const std::vector< std::string > &secondarySearchPaths, std::string &file)
void removeFUImplementation(const std::string &unitName)
std::string icDecoderHDB() const
bool hasAttribute(const std::string &name) const
static const std::string OSNAME_RF_IMPLEMENTATIONS
ObjectState name for RF implementation container.
std::vector< std::string > alternativeFiles_
Possible alternative file paths for missing implementation files.
bool hasRFImplementation(const std::string &unitName) const
void loadState(const ObjectState *state) override
std::vector< std::string > missingFiles_
Implementation files defined in IDF which cannot be located.
bool hasICDecoderPluginFile() const
void removeRFImplementation(const std::string &unitName)
virtual void loadState(const ObjectState *state)
std::string stringAttribute(const std::string &name) const
std::string decompressorFile_
Name of the decompressor block file.
void setSourceFile(const std::string &fileName)
static const std::string OSNAME_IU_IMPLEMENTATIONS
ObjectState name for IU implementation container.
virtual void setHDBFile(std::string file)
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
MachineImplementation * readMachineImplementation()
RFImplementationLocation & iuImplementation(const std::string &iu) const
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
static const std::string OSKEY_IC_DECODER_PARAMETER_VALUE
ObjectState attribute name for ic&decoder parameter value.
SocketImplementationLocation & socketImplementation(const std::string &socket) const
ImplementationTable rfImplementations_
RF implementations.
static std::vector< std::string > decompressorPaths(bool libraryPathsOnly=false)
void removeFuGeneration(const std::string &name)
static const std::string OSKEY_DECOMPRESSOR_FILE
ObjectState attribute key for the name of the decompressor file.
bool hasDecompressorFile() const
static std::string fileOfPath(const std::string pathName)
bool hasFUImplementation(const std::string &unitName) const
ImplementationTable iuImplementations_
IU implementations.
ObjectState * childByName(const std::string &name) const
bool hasIUImplementation(const std::string &unitName) const
std::vector< Parameter > icDecoderParameters_
IC/decoder plugin parameters.
static const std::string OSKEY_IC_DECODER_PARAMETER_NAME
ObjectState attribute name for ic&decoder parameter name.
bool hasFUGeneration(const std::string &name) const
RFImplementationLocation & rfImplementation(const std::string &rf) const
std::string icDecoderParameterValue(const std::string &name) const
void removeSocketImplementation(const std::string &unitName)
virtual ObjectState * saveState() const
static bool makeRelativePath(const std::vector< std::string > &searchPaths, const std::string &basePath, std::string &toRelPath)
std::string sourceIDF_
Absolute path to the source IDF file.
void setICDecoderHDB(const std::string &file)
ImplementationTable busImplementations_
BUS implementations.
unsigned icDecoderParameterCount() const
std::string icDecoderParameterName(unsigned param) const
void makeImplFilesRelative(const std::vector< std::string > &sPaths)
void makeHDBPathRelative(const std::vector< std::string > &searchPaths, UnitImplementationLocation &implem) const
bool hasBusImplementation(const std::string &busName) const
static const std::string OSNAME_SOCKET_IMPLEMENTATIONS
ObjectState name for socket implementation container.
void removeIUImplementation(const std::string &unitName)
ImplementationTable fuImplementations_
FU implementations.
static std::vector< std::string > hdbPaths(bool libraryPathsOnly=false)
void clearICDecoderParameters()
void addBusImplementation(BusImplementationLocation *implementation)
void setICDecoderPluginName(const std::string &name)
std::string icDecoderPluginFile_
Name of the IC/decoder plugin file.
void addFuGeneration(const FUGenerated &fug)
void setDecompressorFile(const std::string &file)
static const std::string OSKEY_IC_DECODER_NAME
ObjectState attribute name for ic&decoder name.
static std::string directoryOfPath(const std::string fileName)
std::vector< FUGenerated > fuGenerated_
Generated FUs.
ObjectState * child(int index) const
void addChild(ObjectState *child)
std::string decompressorFile() const
int rfImplementationCount() const
void addRFImplementation(RFImplementationLocation *implementation)
int busImplementationCount() const
bool hasChild(const std::string &name) const
std::vector< UnitImplementationLocation * > ImplementationTable
Vector type for UnitImplementationLocation.
std::string sourceIDF() const
static std::string expandTilde(const std::string &stringWithTilde)
BusImplementationLocation & busImplementation(const std::string &bus) const
void removeBusImplementation(const std::string &unitName)
std::string errorMessage() const
static const std::string OSNAME_IC_DECODER_PLUGIN
ObjectState name for the name of the IC/decoder plugin file.
int iuImplementationCount() const
virtual ~MachineImplementation()
ObjectState * saveState() const
static const std::string OSNAME_IC_DECODER_PARAMETER
ObjectState attribute name for ic&decoder parameter.
TCEString & replaceString(const std::string &old, const std::string &newString)
static const std::string OSNAME_FU_GENERATED
ObjectState name for FU generations container.
static const std::string OSNAME_FU_IMPLEMENTATIONS
ObjectState name for FU implementation container.
ImplementationTable socketImplementations_
SOCKET implementations.
void setICDecoderParameter(const std::string &name, const std::string &value)
static const std::string OSKEY_IC_DECODER_HDB
ObjectState attribute name for ic&decoder HDB.
std::string icDecoderPluginFile() const
int fuImplementationCount() const
void addFUImplementation(FUImplementationLocation *implementation)
int socketImplementationCount() const
static std::string currentWorkingDir()
IC/Decoder parameter struct.
virtual std::string hdbFile() const
bool hasICDecoderPluginName() const
void setICDecoderPluginFile(const std::string &file)
FUImplementationLocation & fuImplementation(const std::string &fu) const
static const std::string OSNAME_MACHINE_IMPLEMENTATION
ObjectState name for machine implementation.
bool checkImplFiles(size_t &missingFiles, size_t &alternativeFiles)
void ensureIndexValidity(int index, const ImplementationTable &table) const
const std::vector< FUGenerated > & FUGenerations() const
static std::string findFileInSearchPaths(const std::vector< std::string > &searchPaths, const std::string &file)
std::string icDecoderPluginName_
Name of the IC/decoder plugin.
std::string icDecoderHDB_
Name of the HDB of the IC/decoder plugin.
std::string icDecoderPluginName() const
void addSocketImplementation(SocketImplementationLocation *implementation)
static const std::string OSNAME_BUS_IMPLEMENTATIONS
ObjectState name for bus implementation container.
bool hasICDecoderHDB() const
static MachineImplementation * loadFromIDF(const std::string &idfFileName)
UnitImplementationLocation * findImplementation(const ImplementationTable &table, const std::string &unitName) const
std::string hdbFileOriginal() const
static const std::string OSKEY_SOURCE_IDF
ObjectState attribute name for the source IDF.
static const std::string OSKEY_IC_DECODER_FILE
ObjectState attribute name for ic&decoder file.
void addIUImplementation(RFImplementationLocation *implementation)
void setAttribute(const std::string &name, const std::string &value)
bool hasSocketImplementation(const std::string &socketName) const