OpenASIP  2.0
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
IDF::MachineImplementation Class Reference

#include <MachineImplementation.hh>

Inheritance diagram for IDF::MachineImplementation:
Inheritance graph
Collaboration diagram for IDF::MachineImplementation:
Collaboration graph

Classes

struct  Parameter
 IC/Decoder parameter struct. More...
 

Public Member Functions

 MachineImplementation ()
 
 MachineImplementation (const ObjectState *state)
 
virtual ~MachineImplementation ()
 
std::string sourceIDF () const
 
std::string icDecoderPluginName () const
 
bool hasICDecoderPluginName () const
 
std::string icDecoderPluginFile () const
 
bool hasICDecoderPluginFile () const
 
std::string icDecoderHDB () const
 
bool hasICDecoderHDB () const
 
std::string decompressorFile () const
 
bool hasDecompressorFile () const
 
void setICDecoderPluginName (const std::string &name)
 
void setICDecoderPluginFile (const std::string &file)
 
void setICDecoderHDB (const std::string &file)
 
void setDecompressorFile (const std::string &file)
 
unsigned icDecoderParameterCount () const
 
std::string icDecoderParameterName (unsigned param) const
 
std::string icDecoderParameterValue (const std::string &name) const
 
std::string icDecoderParameterValue (unsigned param) const
 
void clearICDecoderParameters ()
 
void setICDecoderParameter (const std::string &name, const std::string &value)
 
bool hasFUImplementation (const std::string &unitName) const
 
bool hasRFImplementation (const std::string &unitName) const
 
bool hasIUImplementation (const std::string &unitName) const
 
bool hasBusImplementation (const std::string &busName) const
 
bool hasSocketImplementation (const std::string &socketName) const
 
int fuImplementationCount () const
 
int rfImplementationCount () const
 
int iuImplementationCount () const
 
int busImplementationCount () const
 
int socketImplementationCount () const
 
FUImplementationLocationfuImplementation (const std::string &fu) const
 
RFImplementationLocationrfImplementation (const std::string &rf) const
 
RFImplementationLocationiuImplementation (const std::string &iu) const
 
BusImplementationLocationbusImplementation (const std::string &bus) const
 
SocketImplementationLocationsocketImplementation (const std::string &socket) const
 
FUImplementationLocationfuImplementation (int index) const
 
RFImplementationLocationrfImplementation (int index) const
 
RFImplementationLocationiuImplementation (int index) const
 
BusImplementationLocationbusImplementation (int index) const
 
SocketImplementationLocationsocketImplementation (int index) const
 
void addFUImplementation (FUImplementationLocation *implementation)
 
void addRFImplementation (RFImplementationLocation *implementation)
 
void addIUImplementation (RFImplementationLocation *implementation)
 
void addBusImplementation (BusImplementationLocation *implementation)
 
void addSocketImplementation (SocketImplementationLocation *implementation)
 
void removeFUImplementation (const std::string &unitName)
 
void removeRFImplementation (const std::string &unitName)
 
void removeIUImplementation (const std::string &unitName)
 
void removeBusImplementation (const std::string &unitName)
 
void removeSocketImplementation (const std::string &unitName)
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
void makeImplFilesRelative (const std::vector< std::string > &sPaths)
 
bool checkImplFiles (size_t &missingFiles, size_t &alternativeFiles)
 
bool isLibraryImplFile (const std::string &path, std::string &resolvedPath)
 
const std::vector< FUGenerated > & FUGenerations () const
 
std::vector< FUGenerated > & FUGenerations ()
 
bool hasFUGeneration (const std::string &name) const
 
void removeFuGeneration (const std::string &name)
 
void addFuGeneration (const FUGenerated &fug)
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static MachineImplementationloadFromIDF (const std::string &idfFileName)
 

Static Public Attributes

static const std::string OSNAME_MACHINE_IMPLEMENTATION
 ObjectState name for machine implementation. More...
 
static const std::string OSKEY_SOURCE_IDF = "source_idf"
 ObjectState attribute name for the source IDF. More...
 
static const std::string OSNAME_IC_DECODER_PLUGIN
 ObjectState name for the name of the IC/decoder plugin file. More...
 
static const std::string OSKEY_IC_DECODER_NAME
 ObjectState attribute name for ic&decoder name. More...
 
static const std::string OSKEY_IC_DECODER_FILE
 ObjectState attribute name for ic&decoder file. More...
 
static const std::string OSNAME_IC_DECODER_PARAMETER
 ObjectState attribute name for ic&decoder parameter. More...
 
static const std::string OSKEY_IC_DECODER_PARAMETER_NAME
 ObjectState attribute name for ic&decoder parameter name. More...
 
static const std::string OSKEY_IC_DECODER_PARAMETER_VALUE
 ObjectState attribute name for ic&decoder parameter value. More...
 
static const std::string OSKEY_IC_DECODER_HDB
 ObjectState attribute name for ic&decoder HDB. More...
 
static const std::string OSKEY_DECOMPRESSOR_FILE
 ObjectState attribute key for the name of the decompressor file. More...
 
static const std::string OSNAME_FU_GENERATED = "fu_generated"
 ObjectState name for FU generations container. More...
 
static const std::string OSNAME_FU_IMPLEMENTATIONS
 ObjectState name for FU implementation container. More...
 
static const std::string OSNAME_RF_IMPLEMENTATIONS
 ObjectState name for RF implementation container. More...
 
static const std::string OSNAME_IU_IMPLEMENTATIONS
 ObjectState name for IU implementation container. More...
 
static const std::string OSNAME_BUS_IMPLEMENTATIONS
 ObjectState name for bus implementation container. More...
 
static const std::string OSNAME_SOCKET_IMPLEMENTATIONS
 ObjectState name for socket implementation container. More...
 

Private Types

typedef std::vector< UnitImplementationLocation * > ImplementationTable
 Vector type for UnitImplementationLocation. More...
 

Private Member Functions

bool checkImplFile (const std::vector< std::string > &primarySearchPaths, const std::vector< std::string > &secondarySearchPaths, std::string &file)
 
bool isLibraryImplFile ()
 
void makeHDBPathRelative (const std::vector< std::string > &searchPaths, UnitImplementationLocation &implem) const
 
UnitImplementationLocationfindImplementation (const ImplementationTable &table, const std::string &unitName) const
 
void ensureIndexValidity (int index, const ImplementationTable &table) const
 
void clearState ()
 

Private Attributes

std::vector< FUGeneratedfuGenerated_
 Generated FUs. More...
 
ImplementationTable fuImplementations_
 FU implementations. More...
 
ImplementationTable rfImplementations_
 RF implementations. More...
 
ImplementationTable iuImplementations_
 IU implementations. More...
 
ImplementationTable busImplementations_
 BUS implementations. More...
 
ImplementationTable socketImplementations_
 SOCKET implementations. More...
 
std::string icDecoderPluginName_
 Name of the IC/decoder plugin. More...
 
std::string icDecoderPluginFile_
 Name of the IC/decoder plugin file. More...
 
std::string icDecoderHDB_
 Name of the HDB of the IC/decoder plugin. More...
 
std::string decompressorFile_
 Name of the decompressor block file. More...
 
std::string sourceIDF_
 Absolute path to the source IDF file. More...
 
std::vector< ParametericDecoderParameters_
 IC/decoder plugin parameters. More...
 
std::vector< std::string > missingFiles_
 Implementation files defined in IDF which cannot be located. More...
 
std::vector< std::string > alternativeFiles_
 Possible alternative file paths for missing implementation files. More...
 

Detailed Description

Represents the implementation of a machine defined in an IDF.

Definition at line 54 of file MachineImplementation.hh.

Member Typedef Documentation

◆ ImplementationTable

Vector type for UnitImplementationLocation.

Definition at line 179 of file MachineImplementation.hh.

Constructor & Destructor Documentation

◆ MachineImplementation() [1/2]

IDF::MachineImplementation::MachineImplementation ( )

The constructor.

Definition at line 84 of file MachineImplementation.cc.

84  :
86  decompressorFile_(""), sourceIDF_("") {
87 }

◆ MachineImplementation() [2/2]

IDF::MachineImplementation::MachineImplementation ( const ObjectState state)

The constructor.

Loads the state of the object from the given ObjectState tree.

Parameters
stateThe ObjectState tree.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState tree is invalid.

Definition at line 98 of file MachineImplementation.cc.

101  icDecoderHDB_(""),
102  decompressorFile_(""),
103  sourceIDF_("") {
104  loadState(state);
105 }

References loadState().

Here is the call graph for this function:

◆ ~MachineImplementation()

IDF::MachineImplementation::~MachineImplementation ( )
virtual

The destructor.

Definition at line 110 of file MachineImplementation.cc.

110  {
111  clearState();
112 }

References clearState().

Here is the call graph for this function:

Member Function Documentation

◆ addBusImplementation()

void IDF::MachineImplementation::addBusImplementation ( BusImplementationLocation implementation)

Adds the given bus implementation.

Parameters
implementationThe implementation to add.
Exceptions
ObjectAlreadyExistsIf there is an implementation for the same bus already.
InvalidDataIf the given implementation is registered to another MachineImplementation instance.

Definition at line 596 of file MachineImplementation.cc.

597  {
598  if (hasBusImplementation(implementation->unitName())) {
599  throw ObjectAlreadyExists(__FILE__, __LINE__, __func__);
600  } else {
602  implementation->setParent(*this);
603  }
604 }

References __func__, busImplementations_, hasBusImplementation(), and implementation.

Referenced by loadState().

Here is the call graph for this function:

◆ addFuGeneration()

void IDF::MachineImplementation::addFuGeneration ( const FUGenerated fug)

Add fu to generation list.

Parameters
fugFU Generation to add.

Definition at line 1619 of file MachineImplementation.cc.

1619  {
1620  fuGenerated_.emplace_back(fug);
1621 }

References fuGenerated_.

Referenced by ProGe::ProGeUI::generateIDF().

◆ addFUImplementation()

void IDF::MachineImplementation::addFUImplementation ( FUImplementationLocation implementation)

Adds the given FU implementation.

Parameters
implementationThe implementation to add.
Exceptions
ObjectAlreadyExistsIf there is an implementation for the same FU already.
InvalidDataIf the given implementation is registered to another MachineImplementation instance.

Definition at line 533 of file MachineImplementation.cc.

534  {
535  if (hasFUImplementation(implementation->unitName())) {
536  const string procName = "MachineImplementation::addFUImplementation";
537  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
538  } else {
540  implementation->setParent(*this);
541  }
542 }

References fuImplementations_, hasFUImplementation(), and implementation.

Referenced by ComponentImplementationSelector::fuImplementations(), ProGe::ProGeUI::generateIDF(), loadState(), and ComponentImplementationSelector::selectFUs().

Here is the call graph for this function:

◆ addIUImplementation()

void IDF::MachineImplementation::addIUImplementation ( RFImplementationLocation implementation)

Adds the given IU implementation.

Parameters
implementationThe implementation to add.
Exceptions
ObjectAlreadyExistsIf there is an implementation for the same IU already.
InvalidDataIf the given implementation is registered to another MachineImplementation instance.

Definition at line 575 of file MachineImplementation.cc.

576  {
577  if (hasIUImplementation(implementation->unitName())) {
578  const string procName = "MachineImplementation::addRFImplementation";
579  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
580  } else {
582  implementation->setParent(*this);
583  }
584 }

References hasIUImplementation(), implementation, and iuImplementations_.

Referenced by ProGe::ProGeUI::generateIDF(), ComponentImplementationSelector::iuImplementations(), loadState(), and ComponentImplementationSelector::selectIUs().

Here is the call graph for this function:

◆ addRFImplementation()

void IDF::MachineImplementation::addRFImplementation ( RFImplementationLocation implementation)

Adds the given RF implementation.

Parameters
implementationThe implementation to add.
Exceptions
ObjectAlreadyExistsIf there is an implementation for the same RF already.
InvalidDataIf the given implementation is registered to another MachineImplementation instance.

Definition at line 554 of file MachineImplementation.cc.

555  {
556  if (hasRFImplementation(implementation->unitName())) {
557  const string procName = "MachineImplementation::addRFImplementation";
558  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
559  } else {
561  implementation->setParent(*this);
562  }
563 }

References hasRFImplementation(), implementation, and rfImplementations_.

Referenced by ProGe::ProGeUI::generateIDF(), loadState(), ComponentImplementationSelector::rfImplementations(), and ComponentImplementationSelector::selectRFs().

Here is the call graph for this function:

◆ addSocketImplementation()

void IDF::MachineImplementation::addSocketImplementation ( SocketImplementationLocation implementation)

Adds the given socket implementation.

Parameters
implementationThe implementation to add.
Exceptions
ObjectAlreadyExistsIf there is an implementation for the same socket already.
InvalidDataIf the given implementation is registered to another MachineImplementation instance.

Definition at line 616 of file MachineImplementation.cc.

617  {
618  if (hasSocketImplementation(implementation->unitName())) {
619  throw ObjectAlreadyExists(__FILE__, __LINE__, __func__);
620  } else {
622  implementation->setParent(*this);
623  }
624 }

References __func__, hasSocketImplementation(), implementation, and socketImplementations_.

Referenced by loadState().

Here is the call graph for this function:

◆ busImplementation() [1/2]

UnitImplementationLocation & IDF::MachineImplementation::busImplementation ( const std::string &  bus) const

Returns the implementation data of the given bus.

Parameters
busName of the bus.
Returns
The implementation data.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given bus.

Definition at line 420 of file MachineImplementation.cc.

420  {
421  UnitImplementationLocation* impl = findImplementation(
422  busImplementations_, bus);
423  if (impl == NULL) {
424  throw InstanceNotFound(
425  __FILE__, __LINE__, __func__,
426  "No implementation data found for bus " + bus + ".");
427  } else {
428  return *impl;
429  }
430 }

References __func__, busImplementations_, and findImplementation().

Referenced by checkImplFiles(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().

Here is the call graph for this function:

◆ busImplementation() [2/2]

UnitImplementationLocation & IDF::MachineImplementation::busImplementation ( int  index) const

Returns the bus implementation at the given position.

Parameters
indexThe position index.
Returns
The implementation data.
Exceptions
OutOfRangeIf the index is smaller than 0 or not smaller than the number of bus implementations.

Definition at line 504 of file MachineImplementation.cc.

504  {
506  return *busImplementations_[index];
507 }

References busImplementations_, and ensureIndexValidity().

Here is the call graph for this function:

◆ busImplementationCount()

int IDF::MachineImplementation::busImplementationCount ( ) const

Returns the number of bus implementations.

Returns
The number of bus implementations.

Definition at line 331 of file MachineImplementation.cc.

331  {
332  return busImplementations_.size();
333 }

References busImplementations_.

Referenced by checkImplFiles(), makeImplFilesRelative(), and saveState().

◆ checkImplFile()

bool IDF::MachineImplementation::checkImplFile ( const std::vector< std::string > &  primarySearchPaths,
const std::vector< std::string > &  secondarySearchPaths,
std::string &  file 
)
private

Tries to find a file under provided search paths.

If the file cannot be found under primary search paths, it is searched under secondary paths. If an alternative file path is found under secondary paths, it is returned using the string reference parameter.

Parameters
primarySearchPathsPaths where the file is searched first.
secondarySearchPathsPaths where the file is searched after.
filePath to file, might be relative of absolute. The alternative file path is returned in this.
Returns
True if alternative path was placed in the reference parameter.

Definition at line 1224 of file MachineImplementation.cc.

1227  {
1228 
1229  if (file == "") {
1230  return false;
1231  }
1232 
1233  // Remove tce file specifier.
1234  if (TCEString(file).startsWith("tce:")) {
1235  file = TCEString(file).replaceString("tce:", "");
1236  }
1237 
1238  // return if the file path has already been processed as a missing file
1239  for (unsigned int i = 0; i < missingFiles_.size(); ++i) {
1240  if (file.compare(missingFiles_.at(i)) == 0) {
1241  if (alternativeFiles_.at(i) != "") {
1242  file = alternativeFiles_.at(i);
1243  return true;
1244  } else {
1245  return false;
1246  }
1247  }
1248  }
1249 
1250  // first search: primary search paths
1251  try {
1252  FileSystem::findFileInSearchPaths(primarySearchPaths, file);
1253  return false;
1254  } catch (Exception& e) {
1255  // file was not found
1256  }
1257 
1258  // second search: secondary search paths (with the plain file name)
1259  try {
1260  string alternativePath = FileSystem::findFileInSearchPaths(
1261  secondarySearchPaths, FileSystem::fileOfPath(file));
1262 
1263  // file was not found, but alternative file path was found
1264  missingFiles_.push_back(file);
1265  alternativeFiles_.push_back(alternativePath);
1266 
1267  file = alternativePath;
1268  return true;
1269  } catch (Exception& e) {
1270  // file was not found, and no alternative path was found either
1271  missingFiles_.push_back(file);
1272  alternativeFiles_.push_back("");
1273  return false;
1274  }
1275 }

References alternativeFiles_, FileSystem::fileOfPath(), FileSystem::findFileInSearchPaths(), missingFiles_, and TCEString::replaceString().

Referenced by checkImplFiles().

Here is the call graph for this function:

◆ checkImplFiles()

bool IDF::MachineImplementation::checkImplFiles ( size_t &  missingFiles,
size_t &  alternativeFiles 
)

Checks that every file defined in IDF exists.

If a file can't be found under current working directory or absolute path, it is searched under default search paths. If the file is found under a default search path, the original file path will be replaced with the found path.

Parameters
missingFilesAmount of missing files is returned using this.
alternativeFilesAmount of alt. files found for missing files.
Returns
True if every file was found locally or from absolute paths.

Definition at line 1066 of file MachineImplementation.cc.

1068  {
1069 
1070  missingFiles_.clear();
1071  alternativeFiles_.clear();
1072 
1073  // local search paths (current working directory)
1074  vector<string> localPaths;
1075  localPaths.push_back(FileSystem::currentWorkingDir());
1076 
1077  // default search paths for different implementation files
1078  vector<string> defSearchPaths;
1079 
1080  // file that will be searched under search paths
1081  TCEString filePath;
1082 
1083  // ic&decoder files
1084  if (hasICDecoderPluginName()) {
1085  if (hasICDecoderPluginFile()) {
1086  defSearchPaths = Environment::icDecoderPluginPaths();
1087  filePath = icDecoderPluginFile_;
1088 
1089  if (isLibraryImplFile(filePath, filePath)) {
1090  icDecoderPluginFile_ = filePath;
1091  // try to find file under local or default search paths
1092  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1093  // found under default search paths, fix the path
1094  icDecoderPluginFile_ = filePath;
1095  }
1096  }
1097 
1098  if (hasICDecoderHDB()) {
1099  defSearchPaths = Environment::hdbPaths();
1100  filePath = icDecoderHDB_;
1101 
1102  if (isLibraryImplFile(filePath, filePath)) {
1103  icDecoderHDB_ = filePath;
1104  // try to find file under local or default search paths
1105  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1106  icDecoderHDB_ = filePath;
1107  }
1108  }
1109  }
1110 
1111  // decompressor file
1112  if (hasDecompressorFile()) {
1113  defSearchPaths = Environment::decompressorPaths();
1114  filePath = decompressorFile_;
1115 
1116  if (isLibraryImplFile(filePath, filePath)) {
1117  decompressorFile_ = filePath;
1118  // try to find file under local or default search paths
1119  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1120  decompressorFile_ = filePath;
1121  }
1122  }
1123 
1124  // HDB files
1125  defSearchPaths = Environment::hdbPaths();
1126 
1127  // FU files
1128  for (int i = 0; i < fuImplementationCount(); i++) {
1129  UnitImplementationLocation& impl = fuImplementation(i);
1130  filePath = impl.hdbFileOriginal();
1131 
1132  if (isLibraryImplFile(filePath, filePath)) {
1133  impl.setHDBFile(filePath);
1134  // try to find file under local or default search paths
1135  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1136  impl.setHDBFile(filePath);
1137  }
1138  }
1139 
1140  // RF files
1141  for (int i = 0; i < rfImplementationCount(); i++) {
1142  UnitImplementationLocation& impl = rfImplementation(i);
1143  filePath = impl.hdbFileOriginal();
1144 
1145  if (isLibraryImplFile(filePath, filePath)) {
1146  impl.setHDBFile(filePath);
1147  // try to find file under local or default search paths
1148  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1149  impl.setHDBFile(filePath);
1150  }
1151  }
1152 
1153  // IU files
1154  for (int i = 0; i < iuImplementationCount(); i++) {
1155  UnitImplementationLocation& impl = iuImplementation(i);
1156  filePath = impl.hdbFileOriginal();
1157 
1158  if (isLibraryImplFile(filePath, filePath)) {
1159  impl.setHDBFile(filePath);
1160  // try to find file under local or default search paths
1161  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1162  impl.setHDBFile(filePath);
1163  }
1164  }
1165 
1166  // bus files
1167  for (int i = 0; i < busImplementationCount(); i++) {
1168  UnitImplementationLocation& impl = busImplementation(i);
1169  filePath = impl.hdbFileOriginal();
1170 
1171  if (isLibraryImplFile(filePath, filePath)) {
1172  impl.setHDBFile(filePath);
1173  // try to find file under local or default search paths
1174  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1175  impl.setHDBFile(filePath);
1176  }
1177  }
1178 
1179  // socket files
1180  for (int i = 0; i < socketImplementationCount(); i++) {
1181  UnitImplementationLocation& impl = socketImplementation(i);
1182  filePath = impl.hdbFileOriginal();
1183 
1184  if (isLibraryImplFile(filePath, filePath)) {
1185  impl.setHDBFile(filePath);
1186  // try to find file under local or default search paths
1187  } else if (checkImplFile(localPaths, defSearchPaths, filePath)) {
1188  impl.setHDBFile(filePath);
1189  }
1190  }
1191 
1192  // check amount of missing files and alternative files that were found
1193 
1194  missingFiles = missingFiles_.size();
1195  alternativeFiles = 0;
1196  for (size_t i = 0; i < alternativeFiles_.size(); ++i) {
1197  if (alternativeFiles_.at(i) != "") {
1198  ++alternativeFiles;
1199  }
1200  }
1201 
1202  // were all the files found under local paths or from absolute paths?
1203  if (missingFiles_.size() == 0) {
1204  return true;
1205  }
1206 
1207  return false;
1208 }

References alternativeFiles_, busImplementation(), busImplementationCount(), checkImplFile(), FileSystem::currentWorkingDir(), decompressorFile_, Environment::decompressorPaths(), fuImplementation(), fuImplementationCount(), hasDecompressorFile(), hasICDecoderHDB(), hasICDecoderPluginFile(), hasICDecoderPluginName(), IDF::UnitImplementationLocation::hdbFileOriginal(), Environment::hdbPaths(), icDecoderHDB_, icDecoderPluginFile_, Environment::icDecoderPluginPaths(), isLibraryImplFile(), iuImplementation(), iuImplementationCount(), missingFiles_, rfImplementation(), rfImplementationCount(), IDF::UnitImplementationLocation::setHDBFile(), socketImplementation(), and socketImplementationCount().

Here is the call graph for this function:

◆ clearICDecoderParameters()

void IDF::MachineImplementation::clearICDecoderParameters ( )

Clears the ic/decoder parameters.

Definition at line 1512 of file MachineImplementation.cc.

1512  {
1513  icDecoderParameters_.clear();
1514 }

References icDecoderParameters_.

◆ clearState()

void IDF::MachineImplementation::clearState ( )
private

◆ decompressorFile()

std::string IDF::MachineImplementation::decompressorFile ( ) const

Returns the absolute path to the the decompressor definition file.

Returns
The absolute path to the decompressor definition file.
Exceptions
FileNotFoundIf the file is not found in search paths.

Definition at line 205 of file MachineImplementation.cc.

205  {
206  vector<string> paths = Environment::decompressorPaths();
207  paths.insert(paths.begin(), FileSystem::directoryOfPath(sourceIDF_));
208  TCEString expandedPath(decompressorFile_);
209  expandedPath.replaceString("tce:", "");
210  return FileSystem::findFileInSearchPaths(paths, expandedPath);
211 }

References decompressorFile_, Environment::decompressorPaths(), FileSystem::directoryOfPath(), FileSystem::findFileInSearchPaths(), TCEString::replaceString(), and sourceIDF_.

Referenced by ProGe::BlockSourceCopier::copyProcessorSpecific().

Here is the call graph for this function:

◆ ensureIndexValidity()

void IDF::MachineImplementation::ensureIndexValidity ( int  index,
const ImplementationTable table 
) const
private

Ensures that the given index is valid for getting an instance from the given implementation table.

Parameters
indexThe index.
tableThe table.
Exceptions
OutOfRangeIf the given index is not valid.

Definition at line 1340 of file MachineImplementation.cc.

1341  {
1342  if (index < 0 || static_cast<size_t>(index) >= table.size()) {
1343  const string procName = "MachineImplementation::ensureIndexValidity";
1344  throw OutOfRange(__FILE__, __LINE__, procName);
1345  }
1346 }

Referenced by busImplementation(), fuImplementation(), iuImplementation(), rfImplementation(), and socketImplementation().

◆ findImplementation()

UnitImplementationLocation * IDF::MachineImplementation::findImplementation ( const ImplementationTable table,
const std::string &  unitName 
) const
private

Finds implementation for the given unit from the given table.

Parameters
tableThe table to search from.
unitNameName of the unit.
Returns
The correct UnitImplementationLocation instance or NULL if no implementation is found.

Definition at line 1315 of file MachineImplementation.cc.

1317  {
1318 
1319  for (ImplementationTable::const_iterator iter = table.begin();
1320  iter != table.end(); iter++) {
1321  UnitImplementationLocation* implementation = *iter;
1322  if (implementation->unitName() == unitName) {
1323  return implementation;
1324  }
1325  }
1326 
1327  return NULL;
1328 }

References implementation.

Referenced by busImplementation(), fuImplementation(), hasBusImplementation(), hasFUImplementation(), hasIUImplementation(), hasRFImplementation(), hasSocketImplementation(), iuImplementation(), rfImplementation(), and socketImplementation().

◆ FUGenerations() [1/2]

std::vector<FUGenerated>& IDF::MachineImplementation::FUGenerations ( )

◆ FUGenerations() [2/2]

std::vector< FUGenerated > & IDF::MachineImplementation::FUGenerations ( ) const

Return all FUs to generate.

Definition at line 1572 of file MachineImplementation.cc.

1572  {
1573  return fuGenerated_;
1574 }

References fuGenerated_.

Referenced by ProGe::NetlistGenerator::generate(), ProGe::ProcessorGenerator::generateProcessor(), and makeImplFilesRelative().

◆ fuImplementation() [1/2]

UnitImplementationLocation & IDF::MachineImplementation::fuImplementation ( const std::string &  fu) const

Returns the implementation data of the given FU.

Parameters
fuName of the FU.
Returns
The implementation data.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given FU.

Definition at line 355 of file MachineImplementation.cc.

355  {
356  UnitImplementationLocation* impl = findImplementation(
357  fuImplementations_, fu);
358  if (impl == NULL) {
359  const string procName = "MachineImplementation::fuImplementation";
360  throw InstanceNotFound(
361  __FILE__, __LINE__, procName,
362  "No implementation data found for function unit " + fu + ".");
363  } else {
364  return *impl;
365  }
366 }

References findImplementation(), and fuImplementations_.

Referenced by IDFValidator::checkFUImplementations(), checkImplFiles(), ProGe::BlockSourceCopier::copyShared(), ProGeTestBenchGenerator::generate(), ProGe::NetlistGenerator::generate(), ProGeScriptGenerator::getBlockOrder(), PlatformIntegrator::loadFUExternalPorts(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), saveState(), testUnits(), CostEstimator::Estimator::totalAreaOfFunctionUnits(), and CostEstimator::Estimator::totalEnergyOfFunctionUnits().

Here is the call graph for this function:

◆ fuImplementation() [2/2]

UnitImplementationLocation & IDF::MachineImplementation::fuImplementation ( int  index) const

Returns the FU implementation at the given position.

Parameters
indexThe position index.
Returns
The implementation data.
Exceptions
OutOfRangeIf the index is smaller than 0 or not smaller than the number of FU implementations.

Definition at line 462 of file MachineImplementation.cc.

462  {
464  return *fuImplementations_[index];
465 }

References ensureIndexValidity(), and fuImplementations_.

Here is the call graph for this function:

◆ fuImplementationCount()

int IDF::MachineImplementation::fuImplementationCount ( ) const

Returns the number of FU implementations.

Returns
The number of FU implementations.

Definition at line 299 of file MachineImplementation.cc.

299  {
300  return fuImplementations_.size();
301 }

References fuImplementations_.

Referenced by IDFValidator::checkFUImplementations(), checkImplFiles(), ProGe::BlockSourceCopier::copyShared(), ProGeScriptGenerator::getBlockOrder(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), saveState(), and testUnits().

◆ hasBusImplementation()

bool IDF::MachineImplementation::hasBusImplementation ( const std::string &  busName) const

Tells whether there is an implementation for the given bus defined.

Parameters
busNameName of the bus.
Returns
True if there is an implementation, otherwise false.

Definition at line 272 of file MachineImplementation.cc.

273  {
274 
275  return findImplementation(busImplementations_, busName) != NULL;
276 }

References busImplementations_, and findImplementation().

Referenced by addBusImplementation(), and CostEstimator::Estimator::longestPath().

Here is the call graph for this function:

◆ hasDecompressorFile()

bool IDF::MachineImplementation::hasDecompressorFile ( ) const

Tells whether the decompressor definition file is given in IDF.

Returns
True if the file is given, otherwise false.

Definition at line 219 of file MachineImplementation.cc.

219  {
220  return decompressorFile_ != "";
221 }

References decompressorFile_.

Referenced by checkImplFiles(), ProGe::BlockSourceCopier::copyProcessorSpecific(), makeImplFilesRelative(), and saveState().

◆ hasFUGeneration()

bool IDF::MachineImplementation::hasFUGeneration ( const std::string &  name) const

Return true if fu is to be generated.

Parameters
nameName of the FU Generation to check.

Definition at line 1590 of file MachineImplementation.cc.

1590  {
1591  for (const auto fug : fuGenerated_) {
1592  if (fug.name() == name) {
1593  return true;
1594  }
1595  }
1596  return false;
1597 }

References fuGenerated_.

Referenced by IDFValidator::checkFUImplementations(), and ProGe::ProGeUI::generateIDF().

◆ hasFUImplementation()

bool IDF::MachineImplementation::hasFUImplementation ( const std::string &  unitName) const

Tells whether there is an implementation for the given FU defined.

Parameters
unitNameName of the FU.
Returns
True if there is an implementation, otherwise false.

Definition at line 231 of file MachineImplementation.cc.

232  {
233 
234  return findImplementation(fuImplementations_, unitName) != NULL;
235 }

References findImplementation(), and fuImplementations_.

Referenced by addFUImplementation(), IDFValidator::checkFUImplementations(), ProGe::ProGeUI::generateIDF(), CostEstimator::Estimator::longestPath(), CostEstimator::Estimator::totalAreaOfFunctionUnits(), and CostEstimator::Estimator::totalEnergyOfFunctionUnits().

Here is the call graph for this function:

◆ hasICDecoderHDB()

bool IDF::MachineImplementation::hasICDecoderHDB ( ) const

Returns true in case IC/decoder HDB file is set.

Returns
True in case IC/decoder HDB file is set.

Definition at line 193 of file MachineImplementation.cc.

193  {
194  return icDecoderHDB_ != "";
195 }

References icDecoderHDB_.

Referenced by checkImplFiles(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().

◆ hasICDecoderPluginFile()

bool IDF::MachineImplementation::hasICDecoderPluginFile ( ) const

Returns true in case IC/decoder file is set.

Returns
True in case IC/decoder file is set.

Definition at line 168 of file MachineImplementation.cc.

168  {
169  return icDecoderPluginFile_ != "";
170 }

References icDecoderPluginFile_.

Referenced by checkImplFiles(), ProGe::ProGeUI::generateIDF(), ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().

◆ hasICDecoderPluginName()

bool IDF::MachineImplementation::hasICDecoderPluginName ( ) const

Returns true in case IC/decoder name is set.

Returns
True in case IC/decoder name is set.

Definition at line 142 of file MachineImplementation.cc.

142  {
143  return icDecoderPluginName_ != "";
144 }

References icDecoderPluginName_.

Referenced by checkImplFiles(), ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().

◆ hasIUImplementation()

bool IDF::MachineImplementation::hasIUImplementation ( const std::string &  unitName) const

Tells whether there is an implementation for the given IU defined.

Parameters
unitNameName of the IU.
Returns
True if there is an implementation, otherwise false.

Definition at line 259 of file MachineImplementation.cc.

260  {
261 
262  return findImplementation(iuImplementations_, unitName) != NULL;
263 }

References findImplementation(), and iuImplementations_.

Referenced by addIUImplementation(), IDFValidator::checkIUImplementations(), ProGe::ProGeUI::generateIDF(), and CostEstimator::Estimator::longestPath().

Here is the call graph for this function:

◆ hasRFImplementation()

bool IDF::MachineImplementation::hasRFImplementation ( const std::string &  unitName) const

Tells whether there is an implementation for the given RF defined.

Parameters
unitNameName of the RF.
Returns
True if there is an implementation, otherwise false.

Definition at line 245 of file MachineImplementation.cc.

246  {
247 
248  return findImplementation(rfImplementations_, unitName) != NULL;
249 }

References findImplementation(), and rfImplementations_.

Referenced by addRFImplementation(), IDFValidator::checkRFImplementations(), ProGe::ProGeUI::generateIDF(), CostEstimator::Estimator::longestPath(), CostEstimator::Estimator::totalAreaOfRegisterFiles(), and CostEstimator::Estimator::totalEnergyOfRegisterFiles().

Here is the call graph for this function:

◆ hasSocketImplementation()

bool IDF::MachineImplementation::hasSocketImplementation ( const std::string &  socketName) const

Tells whether there is an implementation for the given socket defined.

Parameters
socketNameName of the IU.
Returns
True if there is an implementation, otherwise false.

Definition at line 286 of file MachineImplementation.cc.

287  {
288 
289  return findImplementation(socketImplementations_, socketName) != NULL;
290 }

References findImplementation(), and socketImplementations_.

Referenced by addSocketImplementation(), and CostEstimator::Estimator::longestPath().

Here is the call graph for this function:

◆ icDecoderHDB()

std::string IDF::MachineImplementation::icDecoderHDB ( ) const

Returns the absolute path to the IC/decoder HDB file.

Returns
the absolute path to the IC/decoder HDB file.
Exceptions
FileNotFoundIf the file is not found in search paths.

Definition at line 179 of file MachineImplementation.cc.

179  {
180  vector<string> paths = Environment::hdbPaths();
181  paths.insert(paths.begin(), FileSystem::directoryOfPath(sourceIDF_));
182  TCEString expandedPath(icDecoderHDB_);
183  expandedPath.replaceString("tce:", "");
184  return FileSystem::findFileInSearchPaths(paths, expandedPath);
185 }

References FileSystem::directoryOfPath(), FileSystem::findFileInSearchPaths(), Environment::hdbPaths(), icDecoderHDB_, TCEString::replaceString(), and sourceIDF_.

Referenced by DefaultICDecoderEstimator::estimateICArea(), DefaultICDecoderEstimator::estimateICDelayOfPath(), and DefaultICDecoderEstimator::estimateICEnergy().

Here is the call graph for this function:

◆ icDecoderParameterCount()

unsigned IDF::MachineImplementation::icDecoderParameterCount ( ) const

Returns number of ic&decoder plugin parameters defined.

Definition at line 1371 of file MachineImplementation.cc.

1371  {
1372  return icDecoderParameters_.size();
1373 }

References icDecoderParameters_.

Referenced by ProGe::ProGeUI::generateIDF(), and ProGe::ProGeUI::generateProcessor().

◆ icDecoderParameterName()

std::string IDF::MachineImplementation::icDecoderParameterName ( unsigned  param) const

Returns name of the ic/decoder parameter with the given index.

Parameters
paramIndex of the parameter.
Returns
Name of the parameter.

Definition at line 1382 of file MachineImplementation.cc.

1382  {
1383  if (param >= icDecoderParameters_.size()) {
1384  const string procName =
1385  "MachineImplementation::icDecoderParameterName";
1386  throw OutOfRange(__FILE__, __LINE__, procName);
1387 
1388  }
1389  return icDecoderParameters_[param].name;
1390 }

References icDecoderParameters_.

Referenced by ProGe::ProGeUI::generateProcessor().

◆ icDecoderParameterValue() [1/2]

std::string IDF::MachineImplementation::icDecoderParameterValue ( const std::string &  name) const

Returns value of the ic/decoder parameter with the given name.

Parameters
nameName of the parameter.
Returns
Value of the parameter.

Definition at line 1415 of file MachineImplementation.cc.

1415  {
1416 
1417  std::vector<Parameter>::const_iterator iter =
1418  icDecoderParameters_.begin();
1419 
1420  for (; iter != icDecoderParameters_.end(); iter++) {
1421  if ((*iter).name == name) {
1422  return (*iter).value;
1423  }
1424  }
1425 
1426  // Parameter value not defined.
1427  return "";
1428 }

References icDecoderParameters_.

Referenced by AlmaIFIntegrator::AlmaIFIntegrator(), ProGeTestBenchGenerator::generate(), ProGe::ProGeUI::generateProcessor(), and ProGe::TestBenchBlock::write().

◆ icDecoderParameterValue() [2/2]

std::string IDF::MachineImplementation::icDecoderParameterValue ( unsigned  param) const

Returns value of the ic/decoder parameter with the given index.

Parameters
paramIndex of the parameter.
Returns
Value of the parameter.

Definition at line 1399 of file MachineImplementation.cc.

1399  {
1400  if (param >= icDecoderParameters_.size()) {
1401  const string procName = "MachineImplementation::icDecoderParamterName";
1402  throw OutOfRange(__FILE__, __LINE__, procName);
1403 
1404  }
1405  return icDecoderParameters_[param].value;
1406 }

References icDecoderParameters_.

◆ icDecoderPluginFile()

std::string IDF::MachineImplementation::icDecoderPluginFile ( ) const

Returns the absolute path to the IC/decoder plugin file given in IDF.

Returns
The absolute path to the IC/decoder plugin file.
Exceptions
FileNotFoundIf the file is not found in search paths.

Definition at line 153 of file MachineImplementation.cc.

153  {
154  vector<string> paths = Environment::icDecoderPluginPaths();
155  paths.insert(paths.begin(), FileSystem::directoryOfPath(sourceIDF_));
156  TCEString expandedPath(icDecoderPluginFile_);
157  expandedPath.replaceString("tce:", "");
158  expandedPath = FileSystem::expandTilde(expandedPath);
159  return FileSystem::findFileInSearchPaths(paths, expandedPath);
160 }

References FileSystem::directoryOfPath(), FileSystem::expandTilde(), FileSystem::findFileInSearchPaths(), icDecoderPluginFile_, Environment::icDecoderPluginPaths(), TCEString::replaceString(), and sourceIDF_.

Referenced by ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), and CostEstimator::Estimator::longestPath().

Here is the call graph for this function:

◆ icDecoderPluginName()

std::string IDF::MachineImplementation::icDecoderPluginName ( ) const

Returns the name of the IC/decoder plugin.

Returns
The name of the IC/decoder plugin.

Definition at line 132 of file MachineImplementation.cc.

132  {
133  return icDecoderPluginName_;
134 }

References icDecoderPluginName_.

Referenced by ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), and saveState().

◆ isLibraryImplFile() [1/2]

bool IDF::MachineImplementation::isLibraryImplFile ( )
private

Referenced by checkImplFiles().

◆ isLibraryImplFile() [2/2]

bool IDF::MachineImplementation::isLibraryImplFile ( const std::string &  path,
std::string &  resolvedPath 
)

Returns true if the given file is a library file of TCE.

If the file is a TCE library file, its absolute absolute path returned via reference.

Parameters
pathThe file path that is relative or absolute.
resolvedPathThe resolved absolute path.
Returns
True, if the file is TCE library file. Otherwise, false.

Definition at line 1542 of file MachineImplementation.cc.

1544  {
1545 
1546  TCEString toSearched(path);
1547  toSearched.replaceString("tce:", "");
1548 
1549  std::vector<std::string> defaultPaths;
1550  std::vector<std::string> tmp = Environment::hdbPaths(true);
1551  defaultPaths.insert(defaultPaths.end(), tmp.begin(), tmp.end());
1553  defaultPaths.insert(defaultPaths.end(), tmp.begin(), tmp.end());
1554  tmp = Environment::decompressorPaths(true);
1555  defaultPaths.insert(defaultPaths.end(), tmp.begin(), tmp.end());
1556 
1557  try {
1558  resolvedPath = FileSystem::findFileInSearchPaths(
1559  defaultPaths, toSearched);
1560  return true;
1561  } catch (Exception& e) {
1562  // file was not found
1563  }
1564 
1565  return false;
1566 }

References Environment::decompressorPaths(), FileSystem::findFileInSearchPaths(), Environment::hdbPaths(), Environment::icDecoderPluginPaths(), and TCEString::replaceString().

Here is the call graph for this function:

◆ iuImplementation() [1/2]

UnitImplementationLocation & IDF::MachineImplementation::iuImplementation ( const std::string &  iu) const

Returns the implementation data of the given IU.

Parameters
iuName of the IU.
Returns
The implementation data.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given IU.

Definition at line 399 of file MachineImplementation.cc.

399  {
400  UnitImplementationLocation* impl = findImplementation(
401  iuImplementations_, iu);
402  if (impl == NULL) {
403  throw InstanceNotFound(
404  __FILE__, __LINE__, __func__,
405  "No implementation data found for immediate unit " + iu + ".");
406  } else {
407  return *impl;
408  }
409 }

References __func__, findImplementation(), and iuImplementations_.

Referenced by checkImplFiles(), IDFValidator::checkIUImplementations(), ProGe::ProcessorGenerator::checkIULatencies(), ProGe::BlockSourceCopier::copyShared(), ProGe::NetlistGenerator::generate(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), and saveState().

Here is the call graph for this function:

◆ iuImplementation() [2/2]

UnitImplementationLocation & IDF::MachineImplementation::iuImplementation ( int  index) const

Returns the IU implementation at the given position.

Parameters
indexThe position index.
Returns
The implementation data.
Exceptions
OutOfRangeIf the index is smaller than 0 or not smaller than the number of IU implementations.

Definition at line 490 of file MachineImplementation.cc.

490  {
492  return *iuImplementations_[index];
493 }

References ensureIndexValidity(), and iuImplementations_.

Here is the call graph for this function:

◆ iuImplementationCount()

int IDF::MachineImplementation::iuImplementationCount ( ) const

Returns the number of IU implementations.

Returns
The number of IU implementations.

Definition at line 321 of file MachineImplementation.cc.

321  {
322  return iuImplementations_.size();
323 }

References iuImplementations_.

Referenced by checkImplFiles(), IDFValidator::checkIUImplementations(), ProGe::BlockSourceCopier::copyShared(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), and saveState().

◆ loadFromIDF()

MachineImplementation * IDF::MachineImplementation::loadFromIDF ( const std::string &  idfFileName)
static

Loads a MachineImplementation from the given IDF file.

Parameters
idfFileNameThe name of the file to load the IDF from.
Returns
A machine implementation instance.
Exceptions
ExceptionIn case some error occured.

Definition at line 1524 of file MachineImplementation.cc.

1524  {
1525  IDFSerializer serializer;
1526  serializer.setSourceFile(idfFileName);
1527 
1528  return serializer.readMachineImplementation();
1529 }

References IDF::IDFSerializer::readMachineImplementation(), and XMLSerializer::setSourceFile().

Referenced by Evaluate::createConfig(), MinimalOpSet::createConfig(), and main().

Here is the call graph for this function:

◆ loadState()

void IDF::MachineImplementation::loadState ( const ObjectState state)
virtual

Loads the state of the object from the given ObjectState tree.

Parameters
stateThe given ObjectState tree.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState tree is invalid.

Implements Serializable.

Definition at line 762 of file MachineImplementation.cc.

762  {
763  const string procName = "MachineImplementation::loadState";
764 
765  if (state->name() != OSNAME_MACHINE_IMPLEMENTATION) {
766  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
767  }
768 
769  clearState();
770 
771 
772  if (state->hasChild(OSNAME_IC_DECODER_PLUGIN)) {
773  ObjectState* icdecState = state->childByName(OSNAME_IC_DECODER_PLUGIN);
778  if (icdecState->hasAttribute(OSKEY_IC_DECODER_HDB)) {
780  }
781 
782  // Load ic/decoder plugin parameters.
783  for (int i = 0; i < icdecState->childCount(); i++) {
784  ObjectState* parameterState = icdecState->child(i);
785  if (parameterState->name() != OSNAME_IC_DECODER_PARAMETER) {
787  __FILE__, __LINE__, procName);
788  }
789  std::string name = parameterState->stringAttribute(
791 
792  std::string value = parameterState->stringAttribute(
794 
795  Parameter parameter = { name, value };
796  icDecoderParameters_.push_back(parameter);
797  }
798  }
799 
802  }
803 
804  ObjectState* fuGenerate = state->childByName(OSNAME_FU_GENERATED);
805 
806  for (int i = 0; i < fuGenerate->childCount(); i++) {
807  ObjectState* child = fuGenerate->child(i);
808  FUGenerated newfug;
809  newfug.loadState(child);
810  fuGenerated_.emplace_back(newfug);
811  }
812 
813  try {
815  ObjectState* fuImplementations = state->childByName(
817  ObjectState* rfImplementations = state->childByName(
819  ObjectState* iuImplementations = state->childByName(
821  ObjectState* busImplementations = state->childByName(
823  ObjectState* socketImplementations = state->childByName(
825 
826  for (int i = 0; i < fuImplementations->childCount(); i++) {
827  ObjectState* child = fuImplementations->child(i);
828  addFUImplementation(new UnitImplementationLocation(child));
829  }
830 
831  for (int i = 0; i < rfImplementations->childCount(); i++) {
832  ObjectState* child = rfImplementations->child(i);
833  addRFImplementation(new UnitImplementationLocation(child));
834  }
835 
836  for (int i = 0; i < iuImplementations->childCount(); i++) {
837  ObjectState* child = iuImplementations->child(i);
838  addIUImplementation(new UnitImplementationLocation(child));
839  }
840  for (int i = 0; i < busImplementations->childCount(); i++) {
841  ObjectState* child = busImplementations->child(i);
842  addBusImplementation(new UnitImplementationLocation(child));
843  }
844 
845  for (int i = 0; i < socketImplementations->childCount(); i++) {
846  ObjectState* child = socketImplementations->child(i);
847  addSocketImplementation(new UnitImplementationLocation(child));
848  }
849 
850  } catch (const Exception& exception) {
852  __FILE__, __LINE__, procName, exception.errorMessage());
853  }
854 }

References addBusImplementation(), addFUImplementation(), addIUImplementation(), addRFImplementation(), addSocketImplementation(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), clearState(), decompressorFile_, Exception::errorMessage(), fuGenerated_, ObjectState::hasAttribute(), ObjectState::hasChild(), icDecoderHDB_, icDecoderParameters_, icDecoderPluginFile_, icDecoderPluginName_, IDF::FUGenerated::loadState(), ObjectState::name(), OSKEY_DECOMPRESSOR_FILE, OSKEY_IC_DECODER_FILE, OSKEY_IC_DECODER_HDB, OSKEY_IC_DECODER_NAME, OSKEY_IC_DECODER_PARAMETER_NAME, OSKEY_IC_DECODER_PARAMETER_VALUE, OSKEY_SOURCE_IDF, OSNAME_BUS_IMPLEMENTATIONS, OSNAME_FU_GENERATED, OSNAME_FU_IMPLEMENTATIONS, OSNAME_IC_DECODER_PARAMETER, OSNAME_IC_DECODER_PLUGIN, OSNAME_IU_IMPLEMENTATIONS, OSNAME_MACHINE_IMPLEMENTATION, OSNAME_RF_IMPLEMENTATIONS, OSNAME_SOCKET_IMPLEMENTATIONS, sourceIDF_, and ObjectState::stringAttribute().

Referenced by DSDBManager::implementation(), and MachineImplementation().

Here is the call graph for this function:

◆ makeHDBPathRelative()

void IDF::MachineImplementation::makeHDBPathRelative ( const std::vector< std::string > &  searchPaths,
UnitImplementationLocation implem 
) const
private

Tries to find a relative path for an HDB file.

If a relative path is found under any of the search paths, the first match is saved. In case the HDB file path is invalid, the path field is left empty.

Parameters
searchPathsSearch for relative paths is done under these paths.
implemObject containing a file path, which points to an HDB file.

Definition at line 1288 of file MachineImplementation.cc.

1290  {
1291 
1292  try {
1293  string filePath = implem.hdbFile();
1294  string relPath;
1295  if (FileSystem::makeRelativePath(searchPaths, filePath, relPath)) {
1296  implem.setHDBFile(relPath);
1298  filePath, relPath)) {
1299  implem.setHDBFile(std::string("tce:") + relPath);
1300  }
1301  } catch (FileNotFound& e) {
1302  implem.setHDBFile("");
1303  }
1304 }

References IDF::UnitImplementationLocation::hdbFile(), Environment::hdbPaths(), FileSystem::makeRelativePath(), and IDF::UnitImplementationLocation::setHDBFile().

Referenced by makeImplFilesRelative().

Here is the call graph for this function:

◆ makeImplFilesRelative()

void IDF::MachineImplementation::makeImplFilesRelative ( const std::vector< std::string > &  sPaths)

Changes file paths in machine implementation to relative file paths.

Tries to find relative file paths under provided search paths.

Parameters
sPathsSearch paths, used for finding relative paths.

Definition at line 967 of file MachineImplementation.cc.

968  {
969 
970  // ic&decoder files
971  if (hasICDecoderPluginName()) {
972  if (hasICDecoderPluginFile()) {
973  string filePath = icDecoderPluginFile_;
974  string relPath;
975  if (FileSystem::makeRelativePath(sPaths, filePath, relPath)) {
976  icDecoderPluginFile_ = relPath;
977  } else if (FileSystem::makeRelativePath(
979  filePath, relPath)) {
980  icDecoderPluginFile_ = std::string("tce:") + relPath;
981  }
982  }
983  if (hasICDecoderHDB()) {
984  string filePath = icDecoderHDB_;
985  string relPath;
986  if (FileSystem::makeRelativePath(sPaths, filePath, relPath)) {
987  icDecoderHDB_ = relPath;
988  } else if (FileSystem::makeRelativePath(
989  Environment::decompressorPaths(true), filePath, relPath)) {
990  icDecoderHDB_ = std::string("tce:") + relPath;
991  }
992  }
993  }
994 
995  // decompressor file
996  if (hasDecompressorFile()) {
997  string filePath = decompressorFile_;
998  string relPath;
999  if (FileSystem::makeRelativePath(sPaths, filePath, relPath)) {
1000  decompressorFile_ = relPath;
1001  } else if (FileSystem::makeRelativePath(
1002  Environment::decompressorPaths(), filePath, relPath)) {
1003  decompressorFile_ = std::string("tce:") + relPath;
1004  }
1005  }
1006 
1007  // FU files
1008  for (int i = 0; i < fuImplementationCount(); i++) {
1009  UnitImplementationLocation& impl = fuImplementation(i);
1010  makeHDBPathRelative(sPaths, impl);
1011  }
1012 
1013  // RF files
1014  for (int i = 0; i < rfImplementationCount(); i++) {
1015  UnitImplementationLocation& impl = rfImplementation(i);
1016  makeHDBPathRelative(sPaths, impl);
1017  }
1018 
1019  // IU files
1020  for (int i = 0; i < iuImplementationCount(); i++) {
1021  UnitImplementationLocation& impl = iuImplementation(i);
1022  makeHDBPathRelative(sPaths, impl);
1023  }
1024 
1025  // bus files
1026  for (int i = 0; i < busImplementationCount(); i++) {
1027  UnitImplementationLocation& impl = busImplementation(i);
1028  makeHDBPathRelative(sPaths, impl);
1029  }
1030 
1031  // socket files
1032  for (int i = 0; i < socketImplementationCount(); i++) {
1033  UnitImplementationLocation& impl = socketImplementation(i);
1034  makeHDBPathRelative(sPaths, impl);
1035  }
1036 
1037  // Generated FUs and their operations.
1038  for (auto&& fug : FUGenerations()) {
1039  for (auto&& op : fug.operations()) {
1040  std::string& hdb = op.hdb;
1041  std::string rel;
1042  if (FileSystem::makeRelativePath(sPaths, hdb, rel)) {
1043  hdb = rel;
1044  } else if (FileSystem::makeRelativePath(
1045  Environment::hdbPaths(true), hdb, rel)) {
1046  hdb = "tce:" + rel;
1047  }
1048  }
1049  }
1050 }

References busImplementation(), busImplementationCount(), decompressorFile_, Environment::decompressorPaths(), FUGenerations(), fuImplementation(), fuImplementationCount(), hasDecompressorFile(), hasICDecoderHDB(), hasICDecoderPluginFile(), hasICDecoderPluginName(), Environment::hdbPaths(), icDecoderHDB_, icDecoderPluginFile_, Environment::icDecoderPluginPaths(), iuImplementation(), iuImplementationCount(), makeHDBPathRelative(), FileSystem::makeRelativePath(), rfImplementation(), rfImplementationCount(), socketImplementation(), and socketImplementationCount().

Here is the call graph for this function:

◆ removeBusImplementation()

void IDF::MachineImplementation::removeBusImplementation ( const std::string &  unitName)

Removes the bus implementation with given name.

Parameters
unitNameName of the implementation to remove.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given bus.

Definition at line 709 of file MachineImplementation.cc.

709  {
710  bool removed = false;
711  for (
712  ImplementationTable::iterator iter = busImplementations_.begin();
713  iter != busImplementations_.end(); iter++) {
714 
715  UnitImplementationLocation* implementation = *iter;
716  if (implementation->unitName() == unitName) {
717  busImplementations_.erase(iter);
718  removed = true;
719  break;
720  }
721  }
722  if (!removed) {
723  throw InstanceNotFound(__FILE__, __LINE__, __func__);
724  }
725 }

References __func__, busImplementations_, and implementation.

Referenced by MinimizeMachine::minimizeBuses().

◆ removeFuGeneration()

void IDF::MachineImplementation::removeFuGeneration ( const std::string &  name)

Remove fu from generation list.

Parameters
nameName of the FU Generation to remove.

Definition at line 1605 of file MachineImplementation.cc.

1605  {
1606  fuGenerated_.erase(
1607  std::remove_if(
1608  fuGenerated_.begin(), fuGenerated_.end(),
1609  [name](FUGenerated& fu) { return fu.name() == name; }),
1610  fuGenerated_.end());
1611 }

References fuGenerated_.

◆ removeFUImplementation()

void IDF::MachineImplementation::removeFUImplementation ( const std::string &  unitName)

Removes the FU implementation with given name.

Parameters
unitNameName of the implementation to remove.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given FU.

Definition at line 634 of file MachineImplementation.cc.

634  {
635  bool removed = false;
636  for (ImplementationTable::iterator iter = fuImplementations_.begin();
637  iter != fuImplementations_.end(); iter++) {
638 
639  UnitImplementationLocation* implementation = *iter;
640  if (implementation->unitName() == unitName) {
641  fuImplementations_.erase(iter);
642  removed = true;
643  break;
644  }
645  }
646  if (!removed) {
647  throw InstanceNotFound(__FILE__, __LINE__, __func__);
648  }
649 }

References __func__, fuImplementations_, and implementation.

Referenced by RemoveUnconnectedComponents::explore(), and IDFValidator::removeUnknownImplementations().

◆ removeIUImplementation()

void IDF::MachineImplementation::removeIUImplementation ( const std::string &  unitName)

Removes the IU implementation with given name.

Parameters
unitNameName of the implementation to remove.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given IU.

Definition at line 684 of file MachineImplementation.cc.

684  {
685  bool removed = false;
686  for (ImplementationTable::iterator iter = iuImplementations_.begin();
687  iter != iuImplementations_.end(); iter++) {
688 
689  UnitImplementationLocation* implementation = *iter;
690  if (implementation->unitName() == unitName) {
691  iuImplementations_.erase(iter);
692  removed = true;
693  break;
694  }
695  }
696  if (!removed) {
697  throw InstanceNotFound(__FILE__, __LINE__, __func__);
698  }
699 }

References __func__, implementation, and iuImplementations_.

Referenced by IDFValidator::removeUnknownImplementations().

◆ removeRFImplementation()

void IDF::MachineImplementation::removeRFImplementation ( const std::string &  unitName)

Removes the RF implementation with given name.

Parameters
unitNameName of the implementation to remove.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given RF.

Definition at line 659 of file MachineImplementation.cc.

659  {
660  bool removed = false;
661  for (ImplementationTable::iterator iter = rfImplementations_.begin();
662  iter != rfImplementations_.end(); iter++) {
663 
664  UnitImplementationLocation* implementation = *iter;
665  if (implementation->unitName() == unitName) {
666  rfImplementations_.erase(iter);
667  removed = true;
668  break;
669  }
670  }
671  if (!removed) {
672  throw InstanceNotFound(__FILE__, __LINE__, __func__);
673  }
674 }

References __func__, implementation, and rfImplementations_.

Referenced by RemoveUnconnectedComponents::explore(), and IDFValidator::removeUnknownImplementations().

◆ removeSocketImplementation()

void IDF::MachineImplementation::removeSocketImplementation ( const std::string &  unitName)

Removes the socket implementation with given name.

Parameters
unitNameName of the implementation to remove.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given socket.

Definition at line 735 of file MachineImplementation.cc.

735  {
736  bool removed = false;
737  for (
738  ImplementationTable::iterator iter =
739  socketImplementations_.begin();
740  iter != socketImplementations_.end(); iter++) {
741 
742  UnitImplementationLocation* implementation = *iter;
743  if (implementation->unitName() == unitName) {
744  socketImplementations_.erase(iter);
745  removed = true;
746  break;
747  }
748  }
749  if (!removed) {
750  throw InstanceNotFound(__FILE__, __LINE__, __func__);
751  }
752 }

References __func__, implementation, and socketImplementations_.

◆ rfImplementation() [1/2]

UnitImplementationLocation & IDF::MachineImplementation::rfImplementation ( const std::string &  rf) const

Returns the implementation data of the given RF.

Parameters
rfName of the RF.
Returns
The implementation data.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given RF.

Definition at line 377 of file MachineImplementation.cc.

377  {
378  UnitImplementationLocation* impl = findImplementation(
379  rfImplementations_, rf);
380  if (impl == NULL) {
381  const string procName = "MachineImplementation::rfImplementation";
382  throw InstanceNotFound(
383  __FILE__, __LINE__, procName,
384  "No implementation data found for register file " + rf + ".");
385  } else {
386  return *impl;
387  }
388 }

References findImplementation(), and rfImplementations_.

Referenced by checkImplFiles(), IDFValidator::checkRFImplementations(), ProGe::BlockSourceCopier::copyShared(), ProGe::NetlistGenerator::generate(), ProGeScriptGenerator::getBlockOrder(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), saveState(), testUnits(), CostEstimator::Estimator::totalAreaOfRegisterFiles(), and CostEstimator::Estimator::totalEnergyOfRegisterFiles().

Here is the call graph for this function:

◆ rfImplementation() [2/2]

UnitImplementationLocation & IDF::MachineImplementation::rfImplementation ( int  index) const

Returns the RF implementation at the given position.

Parameters
indexThe position index.
Returns
The implementation data.
Exceptions
OutOfRangeIf the index is smaller than 0 or not smaller than the number of RF implementations.

Definition at line 476 of file MachineImplementation.cc.

476  {
478  return *rfImplementations_[index];
479 }

References ensureIndexValidity(), and rfImplementations_.

Here is the call graph for this function:

◆ rfImplementationCount()

int IDF::MachineImplementation::rfImplementationCount ( ) const

Returns the number of RF implementations.

Returns
The number of RF implementations.

Definition at line 310 of file MachineImplementation.cc.

310  {
311  return rfImplementations_.size();
312 }

References rfImplementations_.

Referenced by checkImplFiles(), IDFValidator::checkRFImplementations(), ProGe::BlockSourceCopier::copyShared(), ProGeScriptGenerator::getBlockOrder(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), saveState(), and testUnits().

◆ saveState()

ObjectState * IDF::MachineImplementation::saveState ( ) const
virtual

Saves the state of the object to an ObjectState tree.

Returns
The newly created ObjectState tree.

Implements Serializable.

Definition at line 862 of file MachineImplementation.cc.

862  {
863 
866 
867  // add ic&decoder data
868  if (hasICDecoderPluginName()) {
870  if (hasICDecoderPluginName()) {
871  icdecState->setAttribute(
873  }
874  if (hasICDecoderPluginFile()) {
875  icdecState->setAttribute(
877  }
878  if (hasICDecoderHDB()) {
879  icdecState->setAttribute(
881  }
882 
883  std::vector<Parameter>::const_iterator iter =
884  icDecoderParameters_.begin();
885 
886  // add ic&decoder parameters
887  for (; iter != icDecoderParameters_.end(); iter++) {
888  ObjectState* parameterState =
890  parameterState->setAttribute(
891  OSKEY_IC_DECODER_PARAMETER_NAME, (*iter).name);
892  parameterState->setAttribute(
893  OSKEY_IC_DECODER_PARAMETER_VALUE, (*iter).value);
894  icdecState->addChild(parameterState);
895  }
896  state->addChild(icdecState);
897  }
898 
899  // add decompressor file data
900  if (hasDecompressorFile()) {
902  }
903 
904  // add Generated FUs.
905  ObjectState* fuGenerated = new ObjectState(OSNAME_FU_GENERATED);
906  state->addChild(fuGenerated);
907  for (const auto fug : fuGenerated_) {
908  fuGenerated->addChild(fug.saveState());
909  }
910 
911  // add FU implementations
912  ObjectState* fuImplementations = new ObjectState(
914  state->addChild(fuImplementations);
915  for (int i = 0; i < fuImplementationCount(); i++) {
916  UnitImplementationLocation& impl = fuImplementation(i);
917  fuImplementations->addChild(impl.saveState());
918  }
919 
920  // add RF implementations
921  ObjectState* rfImplementations = new ObjectState(
923  state->addChild(rfImplementations);
924  for (int i = 0; i < rfImplementationCount(); i++) {
925  UnitImplementationLocation& impl = rfImplementation(i);
926  rfImplementations->addChild(impl.saveState());
927  }
928 
929  // add IU implementations
930  ObjectState* iuImplementations = new ObjectState(
932  state->addChild(iuImplementations);
933  for (int i = 0; i < iuImplementationCount(); i++) {
934  UnitImplementationLocation& impl = iuImplementation(i);
935  iuImplementations->addChild(impl.saveState());
936  }
937 
938  // add bus implementations
939  ObjectState* busImplementations = new ObjectState(
941  state->addChild(busImplementations);
942  for (int i = 0; i < busImplementationCount(); i++) {
943  UnitImplementationLocation& impl = busImplementation(i);
944  busImplementations->addChild(impl.saveState());
945  }
946 
947  // add socket implementations
948  ObjectState* socketImplementations = new ObjectState(
950  state->addChild(socketImplementations);
951  for (int i = 0; i < socketImplementationCount(); i++) {
952  UnitImplementationLocation& impl = socketImplementation(i);
953  socketImplementations->addChild(impl.saveState());
954  }
955 
956  return state;
957 }

References ObjectState::addChild(), busImplementation(), busImplementationCount(), decompressorFile_, fuGenerated_, fuImplementation(), fuImplementationCount(), hasDecompressorFile(), hasICDecoderHDB(), hasICDecoderPluginFile(), hasICDecoderPluginName(), icDecoderHDB_, icDecoderParameters_, icDecoderPluginFile_, icDecoderPluginName(), iuImplementation(), iuImplementationCount(), OSKEY_DECOMPRESSOR_FILE, OSKEY_IC_DECODER_FILE, OSKEY_IC_DECODER_HDB, OSKEY_IC_DECODER_NAME, OSKEY_IC_DECODER_PARAMETER_NAME, OSKEY_IC_DECODER_PARAMETER_VALUE, OSKEY_SOURCE_IDF, OSNAME_BUS_IMPLEMENTATIONS, OSNAME_FU_GENERATED, OSNAME_FU_IMPLEMENTATIONS, OSNAME_IC_DECODER_PARAMETER, OSNAME_IC_DECODER_PLUGIN, OSNAME_IU_IMPLEMENTATIONS, OSNAME_MACHINE_IMPLEMENTATION, OSNAME_RF_IMPLEMENTATIONS, OSNAME_SOCKET_IMPLEMENTATIONS, rfImplementation(), rfImplementationCount(), IDF::UnitImplementationLocation::saveState(), ObjectState::setAttribute(), socketImplementation(), socketImplementationCount(), and sourceIDF_.

Referenced by DSDBManager::addImplementation(), ProGe::ProGeUI::loadMachineImplementation(), and IDF::IDFSerializer::writeMachineImplementation().

Here is the call graph for this function:

◆ setDecompressorFile()

void IDF::MachineImplementation::setDecompressorFile ( const std::string &  file)

Sets the decompressor block file.

Parameters
fileFull path to the decompressor block file.

Definition at line 1502 of file MachineImplementation.cc.

1502  {
1503  vector<string> paths = Environment::decompressorPaths();
1504  paths.insert(paths.begin(), FileSystem::directoryOfPath(sourceIDF_));
1506 }

References decompressorFile_, Environment::decompressorPaths(), FileSystem::directoryOfPath(), FileSystem::findFileInSearchPaths(), and sourceIDF_.

Here is the call graph for this function:

◆ setICDecoderHDB()

void IDF::MachineImplementation::setICDecoderHDB ( const std::string &  file)

Sets the ic/decoder HDB file.

Parameters
fileFull path of the ic/decoder HDB file.

Definition at line 1488 of file MachineImplementation.cc.

1488  {
1489  vector<string> paths = Environment::hdbPaths();
1490  paths.insert(paths.begin(), FileSystem::directoryOfPath(sourceIDF_));
1491  string expandedPath = FileSystem::expandTilde(file);
1492  icDecoderHDB_ =
1493  FileSystem::findFileInSearchPaths(paths, expandedPath);
1494 }

References FileSystem::directoryOfPath(), FileSystem::expandTilde(), FileSystem::findFileInSearchPaths(), Environment::hdbPaths(), icDecoderHDB_, and sourceIDF_.

Referenced by ComponentImplementationSelector::selectComponents().

Here is the call graph for this function:

◆ setICDecoderParameter()

void IDF::MachineImplementation::setICDecoderParameter ( const std::string &  name,
const std::string &  value 
)

Sets value of an ic/decoder parameter.

Parameters
nameName of the parameter.
valueValue of the parameter.

Definition at line 1437 of file MachineImplementation.cc.

1438  {
1439 
1440  std::vector<Parameter>::iterator iter =
1441  icDecoderParameters_.begin();
1442 
1443  // Check if the parameter already exists.
1444  for (; iter != icDecoderParameters_.end(); iter++) {
1445  if ((*iter).name == name) {
1446  (*iter).value = value;
1447  return;
1448  }
1449  }
1450 
1451  // New parameter.
1452  Parameter parameter = { name, value };
1453  icDecoderParameters_.push_back(parameter);
1454 }

References icDecoderParameters_.

Referenced by ProGe::ProGeUI::generateIDF().

◆ setICDecoderPluginFile()

void IDF::MachineImplementation::setICDecoderPluginFile ( const std::string &  file)

Sets the ic/decoder plugin file.

Parameters
fileFull path of the ic/decoder plugin file.

Definition at line 1474 of file MachineImplementation.cc.

1474  {
1475  vector<string> paths = Environment::icDecoderPluginPaths();
1476  paths.insert(paths.begin(), FileSystem::directoryOfPath(sourceIDF_));
1477  string expandedPath = FileSystem::expandTilde(file);
1479  FileSystem::findFileInSearchPaths(paths, expandedPath);
1480 }

References FileSystem::directoryOfPath(), FileSystem::expandTilde(), FileSystem::findFileInSearchPaths(), icDecoderPluginFile_, Environment::icDecoderPluginPaths(), and sourceIDF_.

Referenced by ProGe::ProGeUI::generateIDF(), and ComponentImplementationSelector::selectComponents().

Here is the call graph for this function:

◆ setICDecoderPluginName()

void IDF::MachineImplementation::setICDecoderPluginName ( const std::string &  name)

Sets the ic/decoder plugin name.

Parameters
nameName of the ic/decoder plugin.

Definition at line 1462 of file MachineImplementation.cc.

1462  {
1463  icDecoderPluginName_ = name;
1464 
1465 }

References icDecoderPluginName_.

Referenced by ProGe::ProGeUI::generateIDF(), and ComponentImplementationSelector::selectComponents().

◆ socketImplementation() [1/2]

UnitImplementationLocation & IDF::MachineImplementation::socketImplementation ( const std::string &  socket) const

Returns the implementation data of the given socket.

Parameters
socketName of the socket.
Returns
The implementation data.
Exceptions
InstanceNotFoundIf there is no implementation defined for the given socket.

Definition at line 441 of file MachineImplementation.cc.

441  {
442  UnitImplementationLocation* impl = findImplementation(
443  socketImplementations_, socket);
444  if (impl == NULL) {
445  throw InstanceNotFound(
446  __FILE__, __LINE__, __func__,
447  "No implementation data found for socket " + socket + ".");
448  } else {
449  return *impl;
450  }
451 }

References __func__, findImplementation(), and socketImplementations_.

Referenced by checkImplFiles(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().

Here is the call graph for this function:

◆ socketImplementation() [2/2]

UnitImplementationLocation & IDF::MachineImplementation::socketImplementation ( int  index) const

Returns the socket implementation at the given position.

Parameters
indexThe position index.
Returns
The implementation data.
Exceptions
OutOfRangeIf the index is smaller than 0 or not smaller than the number of socket implementations.

Definition at line 518 of file MachineImplementation.cc.

518  {
520  return *socketImplementations_[index];
521 }

References ensureIndexValidity(), and socketImplementations_.

Here is the call graph for this function:

◆ socketImplementationCount()

int IDF::MachineImplementation::socketImplementationCount ( ) const

Returns the number of socket implementations.

Returns
The number of socket implementations.

Definition at line 341 of file MachineImplementation.cc.

341  {
342  return socketImplementations_.size();
343 }

References socketImplementations_.

Referenced by checkImplFiles(), makeImplFilesRelative(), and saveState().

◆ sourceIDF()

std::string IDF::MachineImplementation::sourceIDF ( ) const

Returns the path to the source IDF file.

Returns
The source IDF.

Definition at line 121 of file MachineImplementation.cc.

121  {
122  return sourceIDF_;
123 }

References sourceIDF_.

Referenced by IDF::UnitImplementationLocation::hdbFile().

Member Data Documentation

◆ alternativeFiles_

std::vector<std::string> IDF::MachineImplementation::alternativeFiles_
private

Possible alternative file paths for missing implementation files.

Definition at line 231 of file MachineImplementation.hh.

Referenced by checkImplFile(), and checkImplFiles().

◆ busImplementations_

ImplementationTable IDF::MachineImplementation::busImplementations_
private

◆ decompressorFile_

std::string IDF::MachineImplementation::decompressorFile_
private

◆ fuGenerated_

std::vector<FUGenerated> IDF::MachineImplementation::fuGenerated_
private

◆ fuImplementations_

ImplementationTable IDF::MachineImplementation::fuImplementations_
private

◆ icDecoderHDB_

std::string IDF::MachineImplementation::icDecoderHDB_
private

Name of the HDB of the IC/decoder plugin.

Definition at line 220 of file MachineImplementation.hh.

Referenced by checkImplFiles(), clearState(), hasICDecoderHDB(), icDecoderHDB(), loadState(), makeImplFilesRelative(), saveState(), and setICDecoderHDB().

◆ icDecoderParameters_

std::vector<Parameter> IDF::MachineImplementation::icDecoderParameters_
private

◆ icDecoderPluginFile_

std::string IDF::MachineImplementation::icDecoderPluginFile_
private

◆ icDecoderPluginName_

std::string IDF::MachineImplementation::icDecoderPluginName_
private

Name of the IC/decoder plugin.

Definition at line 216 of file MachineImplementation.hh.

Referenced by clearState(), hasICDecoderPluginName(), icDecoderPluginName(), loadState(), and setICDecoderPluginName().

◆ iuImplementations_

ImplementationTable IDF::MachineImplementation::iuImplementations_
private

◆ missingFiles_

std::vector<std::string> IDF::MachineImplementation::missingFiles_
private

Implementation files defined in IDF which cannot be located.

Definition at line 229 of file MachineImplementation.hh.

Referenced by checkImplFile(), and checkImplFiles().

◆ OSKEY_DECOMPRESSOR_FILE

const std::string IDF::MachineImplementation::OSKEY_DECOMPRESSOR_FILE
static
Initial value:
=
"decompressor_file"

ObjectState attribute key for the name of the decompressor file.

Definition at line 157 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSKEY_IC_DECODER_FILE

const std::string IDF::MachineImplementation::OSKEY_IC_DECODER_FILE
static
Initial value:
=
"ic_dec_file"

ObjectState attribute name for ic&decoder file.

Definition at line 147 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSKEY_IC_DECODER_HDB

const std::string IDF::MachineImplementation::OSKEY_IC_DECODER_HDB
static
Initial value:
=
"ic_dec_hdb"

ObjectState attribute name for ic&decoder HDB.

Definition at line 155 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSKEY_IC_DECODER_NAME

const std::string IDF::MachineImplementation::OSKEY_IC_DECODER_NAME
static
Initial value:
=
"ic_dec_name"

ObjectState attribute name for ic&decoder name.

Definition at line 145 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSKEY_IC_DECODER_PARAMETER_NAME

const std::string IDF::MachineImplementation::OSKEY_IC_DECODER_PARAMETER_NAME
static
Initial value:
=
"ic_dec_parameter_name"

ObjectState attribute name for ic&decoder parameter name.

Definition at line 151 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSKEY_IC_DECODER_PARAMETER_VALUE

const std::string IDF::MachineImplementation::OSKEY_IC_DECODER_PARAMETER_VALUE
static
Initial value:
=
"ic_dec_parameter_value"

ObjectState attribute name for ic&decoder parameter value.

Definition at line 153 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSKEY_SOURCE_IDF

const std::string IDF::MachineImplementation::OSKEY_SOURCE_IDF = "source_idf"
static

ObjectState attribute name for the source IDF.

Definition at line 141 of file MachineImplementation.hh.

Referenced by loadState(), IDF::IDFSerializer::readState(), and saveState().

◆ OSNAME_BUS_IMPLEMENTATIONS

const std::string IDF::MachineImplementation::OSNAME_BUS_IMPLEMENTATIONS
static
Initial value:
=
"bus_impls"

ObjectState name for bus implementation container.

Definition at line 167 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_FU_GENERATED

const std::string IDF::MachineImplementation::OSNAME_FU_GENERATED = "fu_generated"
static

◆ OSNAME_FU_IMPLEMENTATIONS

const std::string IDF::MachineImplementation::OSNAME_FU_IMPLEMENTATIONS
static
Initial value:
=
"fu_impls"

ObjectState name for FU implementation container.

Definition at line 161 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_IC_DECODER_PARAMETER

const std::string IDF::MachineImplementation::OSNAME_IC_DECODER_PARAMETER
static
Initial value:
=
"ic_dec_parameter"

ObjectState attribute name for ic&decoder parameter.

Definition at line 149 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_IC_DECODER_PLUGIN

const std::string IDF::MachineImplementation::OSNAME_IC_DECODER_PLUGIN
static
Initial value:
=
"ic_dec_plugin"

ObjectState name for the name of the IC/decoder plugin file.

Definition at line 143 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_IU_IMPLEMENTATIONS

const std::string IDF::MachineImplementation::OSNAME_IU_IMPLEMENTATIONS
static
Initial value:
=
"iu_impls"

ObjectState name for IU implementation container.

Definition at line 165 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_MACHINE_IMPLEMENTATION

const std::string IDF::MachineImplementation::OSNAME_MACHINE_IMPLEMENTATION
static
Initial value:
=
"mach_impl"

ObjectState name for machine implementation.

Definition at line 139 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_RF_IMPLEMENTATIONS

const std::string IDF::MachineImplementation::OSNAME_RF_IMPLEMENTATIONS
static
Initial value:
=
"rf_impls"

ObjectState name for RF implementation container.

Definition at line 163 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ OSNAME_SOCKET_IMPLEMENTATIONS

const std::string IDF::MachineImplementation::OSNAME_SOCKET_IMPLEMENTATIONS
static
Initial value:
=
"socket_impls"

ObjectState name for socket implementation container.

Definition at line 169 of file MachineImplementation.hh.

Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().

◆ rfImplementations_

ImplementationTable IDF::MachineImplementation::rfImplementations_
private

◆ socketImplementations_

ImplementationTable IDF::MachineImplementation::socketImplementations_
private

◆ sourceIDF_

std::string IDF::MachineImplementation::sourceIDF_
private

The documentation for this class was generated from the following files:
IDF::MachineImplementation::checkImplFile
bool checkImplFile(const std::vector< std::string > &primarySearchPaths, const std::vector< std::string > &secondarySearchPaths, std::string &file)
Definition: MachineImplementation.cc:1224
ObjectState::hasAttribute
bool hasAttribute(const std::string &name) const
Definition: ObjectState.cc:205
IDF::MachineImplementation::OSNAME_RF_IMPLEMENTATIONS
static const std::string OSNAME_RF_IMPLEMENTATIONS
ObjectState name for RF implementation container.
Definition: MachineImplementation.hh:163
IDF::MachineImplementation::alternativeFiles_
std::vector< std::string > alternativeFiles_
Possible alternative file paths for missing implementation files.
Definition: MachineImplementation.hh:231
IDF::MachineImplementation::hasRFImplementation
bool hasRFImplementation(const std::string &unitName) const
Definition: MachineImplementation.cc:245
IDF::MachineImplementation::missingFiles_
std::vector< std::string > missingFiles_
Implementation files defined in IDF which cannot be located.
Definition: MachineImplementation.hh:229
IDF::MachineImplementation::hasICDecoderPluginFile
bool hasICDecoderPluginFile() const
Definition: MachineImplementation.cc:168
FileNotFound
Definition: Exception.hh:224
IDF::MachineImplementation::loadState
virtual void loadState(const ObjectState *state)
Definition: MachineImplementation.cc:762
ObjectState::stringAttribute
std::string stringAttribute(const std::string &name) const
Definition: ObjectState.cc:249
IDF::MachineImplementation::decompressorFile_
std::string decompressorFile_
Name of the decompressor block file.
Definition: MachineImplementation.hh:222
IDF::MachineImplementation::OSNAME_IU_IMPLEMENTATIONS
static const std::string OSNAME_IU_IMPLEMENTATIONS
ObjectState name for IU implementation container.
Definition: MachineImplementation.hh:165
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
ObjectStateLoadingException
Definition: Exception.hh:551
OutOfRange
Definition: Exception.hh:320
IDF::MachineImplementation::iuImplementation
RFImplementationLocation & iuImplementation(const std::string &iu) const
Definition: MachineImplementation.cc:399
ObjectState
Definition: ObjectState.hh:59
Environment::icDecoderPluginPaths
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
Definition: Environment.cc:635
IDF::MachineImplementation::OSKEY_IC_DECODER_PARAMETER_VALUE
static const std::string OSKEY_IC_DECODER_PARAMETER_VALUE
ObjectState attribute name for ic&decoder parameter value.
Definition: MachineImplementation.hh:153
IDF::MachineImplementation::socketImplementation
SocketImplementationLocation & socketImplementation(const std::string &socket) const
Definition: MachineImplementation.cc:441
IDF::MachineImplementation::rfImplementations_
ImplementationTable rfImplementations_
RF implementations.
Definition: MachineImplementation.hh:207
Environment::decompressorPaths
static std::vector< std::string > decompressorPaths(bool libraryPathsOnly=false)
Definition: Environment.cc:793
IDF::MachineImplementation::OSKEY_DECOMPRESSOR_FILE
static const std::string OSKEY_DECOMPRESSOR_FILE
ObjectState attribute key for the name of the decompressor file.
Definition: MachineImplementation.hh:157
IDF::MachineImplementation::hasDecompressorFile
bool hasDecompressorFile() const
Definition: MachineImplementation.cc:219
FileSystem::fileOfPath
static std::string fileOfPath(const std::string pathName)
Definition: FileSystem.cc:101
IDF::MachineImplementation::hasFUImplementation
bool hasFUImplementation(const std::string &unitName) const
Definition: MachineImplementation.cc:231
IDF::MachineImplementation::iuImplementations_
ImplementationTable iuImplementations_
IU implementations.
Definition: MachineImplementation.hh:209
ObjectState::childByName
ObjectState * childByName(const std::string &name) const
Definition: ObjectState.cc:443
IDF::MachineImplementation::hasIUImplementation
bool hasIUImplementation(const std::string &unitName) const
Definition: MachineImplementation.cc:259
IDF::MachineImplementation::icDecoderParameters_
std::vector< Parameter > icDecoderParameters_
IC/decoder plugin parameters.
Definition: MachineImplementation.hh:226
IDF::MachineImplementation::OSKEY_IC_DECODER_PARAMETER_NAME
static const std::string OSKEY_IC_DECODER_PARAMETER_NAME
ObjectState attribute name for ic&decoder parameter name.
Definition: MachineImplementation.hh:151
IDF::MachineImplementation::rfImplementation
RFImplementationLocation & rfImplementation(const std::string &rf) const
Definition: MachineImplementation.cc:377
IDF::MachineImplementation::clearState
void clearState()
Definition: MachineImplementation.cc:1352
FileSystem::makeRelativePath
static bool makeRelativePath(const std::vector< std::string > &searchPaths, const std::string &basePath, std::string &toRelPath)
Definition: FileSystem.cc:844
IDF::MachineImplementation::sourceIDF_
std::string sourceIDF_
Absolute path to the source IDF file.
Definition: MachineImplementation.hh:224
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
IDF::MachineImplementation::busImplementations_
ImplementationTable busImplementations_
BUS implementations.
Definition: MachineImplementation.hh:211
IDF::MachineImplementation::makeHDBPathRelative
void makeHDBPathRelative(const std::vector< std::string > &searchPaths, UnitImplementationLocation &implem) const
Definition: MachineImplementation.cc:1288
IDF::MachineImplementation::hasBusImplementation
bool hasBusImplementation(const std::string &busName) const
Definition: MachineImplementation.cc:272
IDF::MachineImplementation::OSNAME_SOCKET_IMPLEMENTATIONS
static const std::string OSNAME_SOCKET_IMPLEMENTATIONS
ObjectState name for socket implementation container.
Definition: MachineImplementation.hh:169
IDF::MachineImplementation::fuImplementations_
ImplementationTable fuImplementations_
FU implementations.
Definition: MachineImplementation.hh:205
Environment::hdbPaths
static std::vector< std::string > hdbPaths(bool libraryPathsOnly=false)
Definition: Environment.cc:683
IDF::MachineImplementation::addBusImplementation
void addBusImplementation(BusImplementationLocation *implementation)
Definition: MachineImplementation.cc:596
IDF::MachineImplementation::icDecoderPluginFile_
std::string icDecoderPluginFile_
Name of the IC/decoder plugin file.
Definition: MachineImplementation.hh:218
IDF::MachineImplementation::OSKEY_IC_DECODER_NAME
static const std::string OSKEY_IC_DECODER_NAME
ObjectState attribute name for ic&decoder name.
Definition: MachineImplementation.hh:145
__func__
#define __func__
Definition: Application.hh:67
FileSystem::directoryOfPath
static std::string directoryOfPath(const std::string fileName)
Definition: FileSystem.cc:79
IDF::MachineImplementation::fuGenerated_
std::vector< FUGenerated > fuGenerated_
Generated FUs.
Definition: MachineImplementation.hh:202
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
IDF::MachineImplementation::rfImplementationCount
int rfImplementationCount() const
Definition: MachineImplementation.cc:310
ObjectState::childCount
int childCount() const
IDF::MachineImplementation::addRFImplementation
void addRFImplementation(RFImplementationLocation *implementation)
Definition: MachineImplementation.cc:554
IDF::MachineImplementation::busImplementationCount
int busImplementationCount() const
Definition: MachineImplementation.cc:331
ObjectState::hasChild
bool hasChild(const std::string &name) const
Definition: ObjectState.cc:358
Exception
Definition: Exception.hh:54
FileSystem::expandTilde
static std::string expandTilde(const std::string &stringWithTilde)
Definition: FileSystem.cc:217
IDF::MachineImplementation::busImplementation
BusImplementationLocation & busImplementation(const std::string &bus) const
Definition: MachineImplementation.cc:420
ObjectState::name
std::string name() const
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
IDF::MachineImplementation::OSNAME_IC_DECODER_PLUGIN
static const std::string OSNAME_IC_DECODER_PLUGIN
ObjectState name for the name of the IC/decoder plugin file.
Definition: MachineImplementation.hh:143
IDF::MachineImplementation::iuImplementationCount
int iuImplementationCount() const
Definition: MachineImplementation.cc:321
IDF::MachineImplementation::OSNAME_IC_DECODER_PARAMETER
static const std::string OSNAME_IC_DECODER_PARAMETER
ObjectState attribute name for ic&decoder parameter.
Definition: MachineImplementation.hh:149
TCEString::replaceString
TCEString & replaceString(const std::string &old, const std::string &newString)
Definition: TCEString.cc:94
IDF::MachineImplementation::OSNAME_FU_GENERATED
static const std::string OSNAME_FU_GENERATED
ObjectState name for FU generations container.
Definition: MachineImplementation.hh:159
IDF::MachineImplementation::OSNAME_FU_IMPLEMENTATIONS
static const std::string OSNAME_FU_IMPLEMENTATIONS
ObjectState name for FU implementation container.
Definition: MachineImplementation.hh:161
IDF::MachineImplementation::socketImplementations_
ImplementationTable socketImplementations_
SOCKET implementations.
Definition: MachineImplementation.hh:213
IDF::MachineImplementation::OSKEY_IC_DECODER_HDB
static const std::string OSKEY_IC_DECODER_HDB
ObjectState attribute name for ic&decoder HDB.
Definition: MachineImplementation.hh:155
IDF::MachineImplementation::fuImplementationCount
int fuImplementationCount() const
Definition: MachineImplementation.cc:299
IDF::MachineImplementation::addFUImplementation
void addFUImplementation(FUImplementationLocation *implementation)
Definition: MachineImplementation.cc:533
ObjectAlreadyExists
Definition: Exception.hh:1002
TCEString
Definition: TCEString.hh:53
IDF::MachineImplementation::socketImplementationCount
int socketImplementationCount() const
Definition: MachineImplementation.cc:341
IDF::MachineImplementation::isLibraryImplFile
bool isLibraryImplFile()
FileSystem::currentWorkingDir
static std::string currentWorkingDir()
Definition: FileSystem.cc:142
IDF::MachineImplementation::hasICDecoderPluginName
bool hasICDecoderPluginName() const
Definition: MachineImplementation.cc:142
IDF::MachineImplementation::fuImplementation
FUImplementationLocation & fuImplementation(const std::string &fu) const
Definition: MachineImplementation.cc:355
IDF::MachineImplementation::OSNAME_MACHINE_IMPLEMENTATION
static const std::string OSNAME_MACHINE_IMPLEMENTATION
ObjectState name for machine implementation.
Definition: MachineImplementation.hh:139
IDF::MachineImplementation::ensureIndexValidity
void ensureIndexValidity(int index, const ImplementationTable &table) const
Definition: MachineImplementation.cc:1340
IDF::MachineImplementation::FUGenerations
const std::vector< FUGenerated > & FUGenerations() const
Definition: MachineImplementation.cc:1572
FileSystem::findFileInSearchPaths
static std::string findFileInSearchPaths(const std::vector< std::string > &searchPaths, const std::string &file)
Definition: FileSystem.cc:562
IDF::MachineImplementation::icDecoderPluginName_
std::string icDecoderPluginName_
Name of the IC/decoder plugin.
Definition: MachineImplementation.hh:216
IDF::MachineImplementation::icDecoderHDB_
std::string icDecoderHDB_
Name of the HDB of the IC/decoder plugin.
Definition: MachineImplementation.hh:220
IDF::MachineImplementation::icDecoderPluginName
std::string icDecoderPluginName() const
Definition: MachineImplementation.cc:132
IDF::MachineImplementation::addSocketImplementation
void addSocketImplementation(SocketImplementationLocation *implementation)
Definition: MachineImplementation.cc:616
IDF::MachineImplementation::OSNAME_BUS_IMPLEMENTATIONS
static const std::string OSNAME_BUS_IMPLEMENTATIONS
ObjectState name for bus implementation container.
Definition: MachineImplementation.hh:167
IDF::MachineImplementation::hasICDecoderHDB
bool hasICDecoderHDB() const
Definition: MachineImplementation.cc:193
IDF::MachineImplementation::findImplementation
UnitImplementationLocation * findImplementation(const ImplementationTable &table, const std::string &unitName) const
Definition: MachineImplementation.cc:1315
IDF::MachineImplementation::OSKEY_SOURCE_IDF
static const std::string OSKEY_SOURCE_IDF
ObjectState attribute name for the source IDF.
Definition: MachineImplementation.hh:141
IDF::MachineImplementation::OSKEY_IC_DECODER_FILE
static const std::string OSKEY_IC_DECODER_FILE
ObjectState attribute name for ic&decoder file.
Definition: MachineImplementation.hh:147
IDF::MachineImplementation::addIUImplementation
void addIUImplementation(RFImplementationLocation *implementation)
Definition: MachineImplementation.cc:575
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
InstanceNotFound
Definition: Exception.hh:304
IDF::MachineImplementation::hasSocketImplementation
bool hasSocketImplementation(const std::string &socketName) const
Definition: MachineImplementation.cc:286