OpenASIP
2.0
|
#include <MachineImplementation.hh>
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 |
FUImplementationLocation & | fuImplementation (const std::string &fu) const |
RFImplementationLocation & | rfImplementation (const std::string &rf) const |
RFImplementationLocation & | iuImplementation (const std::string &iu) const |
BusImplementationLocation & | busImplementation (const std::string &bus) const |
SocketImplementationLocation & | socketImplementation (const std::string &socket) const |
FUImplementationLocation & | fuImplementation (int index) const |
RFImplementationLocation & | rfImplementation (int index) const |
RFImplementationLocation & | iuImplementation (int index) const |
BusImplementationLocation & | busImplementation (int index) const |
SocketImplementationLocation & | socketImplementation (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 ObjectState * | saveState () 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 MachineImplementation * | loadFromIDF (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 |
UnitImplementationLocation * | findImplementation (const ImplementationTable &table, const std::string &unitName) const |
void | ensureIndexValidity (int index, const ImplementationTable &table) const |
void | clearState () |
Private Attributes | |
std::vector< FUGenerated > | fuGenerated_ |
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< Parameter > | icDecoderParameters_ |
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... | |
Represents the implementation of a machine defined in an IDF.
Definition at line 54 of file MachineImplementation.hh.
|
private |
Vector type for UnitImplementationLocation.
Definition at line 179 of file MachineImplementation.hh.
IDF::MachineImplementation::MachineImplementation | ( | ) |
IDF::MachineImplementation::MachineImplementation | ( | const ObjectState * | state | ) |
The constructor.
Loads the state of the object from the given ObjectState tree.
state | The ObjectState tree. |
ObjectStateLoadingException | If the given ObjectState tree is invalid. |
Definition at line 98 of file MachineImplementation.cc.
References loadState().
|
virtual |
The destructor.
Definition at line 110 of file MachineImplementation.cc.
References clearState().
void IDF::MachineImplementation::addBusImplementation | ( | BusImplementationLocation * | implementation | ) |
Adds the given bus implementation.
implementation | The implementation to add. |
ObjectAlreadyExists | If there is an implementation for the same bus already. |
InvalidData | If the given implementation is registered to another MachineImplementation instance. |
Definition at line 596 of file MachineImplementation.cc.
References __func__, busImplementations_, hasBusImplementation(), and implementation.
Referenced by loadState().
void IDF::MachineImplementation::addFuGeneration | ( | const FUGenerated & | fug | ) |
Add fu to generation list.
fug | FU Generation to add. |
Definition at line 1619 of file MachineImplementation.cc.
References fuGenerated_.
Referenced by ProGe::ProGeUI::generateIDF().
void IDF::MachineImplementation::addFUImplementation | ( | FUImplementationLocation * | implementation | ) |
Adds the given FU implementation.
implementation | The implementation to add. |
ObjectAlreadyExists | If there is an implementation for the same FU already. |
InvalidData | If the given implementation is registered to another MachineImplementation instance. |
Definition at line 533 of file MachineImplementation.cc.
References fuImplementations_, hasFUImplementation(), and implementation.
Referenced by ComponentImplementationSelector::fuImplementations(), ProGe::ProGeUI::generateIDF(), loadState(), and ComponentImplementationSelector::selectFUs().
void IDF::MachineImplementation::addIUImplementation | ( | RFImplementationLocation * | implementation | ) |
Adds the given IU implementation.
implementation | The implementation to add. |
ObjectAlreadyExists | If there is an implementation for the same IU already. |
InvalidData | If the given implementation is registered to another MachineImplementation instance. |
Definition at line 575 of file MachineImplementation.cc.
References hasIUImplementation(), implementation, and iuImplementations_.
Referenced by ProGe::ProGeUI::generateIDF(), ComponentImplementationSelector::iuImplementations(), loadState(), and ComponentImplementationSelector::selectIUs().
void IDF::MachineImplementation::addRFImplementation | ( | RFImplementationLocation * | implementation | ) |
Adds the given RF implementation.
implementation | The implementation to add. |
ObjectAlreadyExists | If there is an implementation for the same RF already. |
InvalidData | If the given implementation is registered to another MachineImplementation instance. |
Definition at line 554 of file MachineImplementation.cc.
References hasRFImplementation(), implementation, and rfImplementations_.
Referenced by ProGe::ProGeUI::generateIDF(), loadState(), ComponentImplementationSelector::rfImplementations(), and ComponentImplementationSelector::selectRFs().
void IDF::MachineImplementation::addSocketImplementation | ( | SocketImplementationLocation * | implementation | ) |
Adds the given socket implementation.
implementation | The implementation to add. |
ObjectAlreadyExists | If there is an implementation for the same socket already. |
InvalidData | If the given implementation is registered to another MachineImplementation instance. |
Definition at line 616 of file MachineImplementation.cc.
References __func__, hasSocketImplementation(), implementation, and socketImplementations_.
Referenced by loadState().
UnitImplementationLocation & IDF::MachineImplementation::busImplementation | ( | const std::string & | bus | ) | const |
Returns the implementation data of the given bus.
bus | Name of the bus. |
InstanceNotFound | If there is no implementation defined for the given bus. |
Definition at line 420 of file MachineImplementation.cc.
References __func__, busImplementations_, and findImplementation().
Referenced by checkImplFiles(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().
UnitImplementationLocation & IDF::MachineImplementation::busImplementation | ( | int | index | ) | const |
Returns the bus implementation at the given position.
index | The position index. |
OutOfRange | If the index is smaller than 0 or not smaller than the number of bus implementations. |
Definition at line 504 of file MachineImplementation.cc.
References busImplementations_, and ensureIndexValidity().
int IDF::MachineImplementation::busImplementationCount | ( | ) | const |
Returns the number of bus implementations.
Definition at line 331 of file MachineImplementation.cc.
References busImplementations_.
Referenced by checkImplFiles(), makeImplFilesRelative(), and saveState().
|
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.
primarySearchPaths | Paths where the file is searched first. |
secondarySearchPaths | Paths where the file is searched after. |
file | Path to file, might be relative of absolute. The alternative file path is returned in this. |
Definition at line 1224 of file MachineImplementation.cc.
References alternativeFiles_, FileSystem::fileOfPath(), FileSystem::findFileInSearchPaths(), missingFiles_, and TCEString::replaceString().
Referenced by 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.
missingFiles | Amount of missing files is returned using this. |
alternativeFiles | Amount of alt. files found for missing files. |
Definition at line 1066 of file MachineImplementation.cc.
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().
void IDF::MachineImplementation::clearICDecoderParameters | ( | ) |
Clears the ic/decoder parameters.
Definition at line 1512 of file MachineImplementation.cc.
References icDecoderParameters_.
|
private |
Clears the state of the object.
Definition at line 1352 of file MachineImplementation.cc.
References busImplementations_, decompressorFile_, SequenceTools::deleteAllItems(), fuGenerated_, fuImplementations_, icDecoderHDB_, icDecoderParameters_, icDecoderPluginFile_, icDecoderPluginName_, iuImplementations_, rfImplementations_, socketImplementations_, and sourceIDF_.
Referenced by loadState(), and ~MachineImplementation().
std::string IDF::MachineImplementation::decompressorFile | ( | ) | const |
Returns the absolute path to the the decompressor definition file.
FileNotFound | If the file is not found in search paths. |
Definition at line 205 of file MachineImplementation.cc.
References decompressorFile_, Environment::decompressorPaths(), FileSystem::directoryOfPath(), FileSystem::findFileInSearchPaths(), TCEString::replaceString(), and sourceIDF_.
Referenced by ProGe::BlockSourceCopier::copyProcessorSpecific().
|
private |
Ensures that the given index is valid for getting an instance from the given implementation table.
index | The index. |
table | The table. |
OutOfRange | If the given index is not valid. |
Definition at line 1340 of file MachineImplementation.cc.
Referenced by busImplementation(), fuImplementation(), iuImplementation(), rfImplementation(), and socketImplementation().
|
private |
Finds implementation for the given unit from the given table.
table | The table to search from. |
unitName | Name of the unit. |
Definition at line 1315 of file MachineImplementation.cc.
References implementation.
Referenced by busImplementation(), fuImplementation(), hasBusImplementation(), hasFUImplementation(), hasIUImplementation(), hasRFImplementation(), hasSocketImplementation(), iuImplementation(), rfImplementation(), and socketImplementation().
std::vector<FUGenerated>& IDF::MachineImplementation::FUGenerations | ( | ) |
std::vector< FUGenerated > & IDF::MachineImplementation::FUGenerations | ( | ) | const |
Return all FUs to generate.
Definition at line 1572 of file MachineImplementation.cc.
References fuGenerated_.
Referenced by ProGe::NetlistGenerator::generate(), ProGe::ProcessorGenerator::generateProcessor(), and makeImplFilesRelative().
UnitImplementationLocation & IDF::MachineImplementation::fuImplementation | ( | const std::string & | fu | ) | const |
Returns the implementation data of the given FU.
fu | Name of the FU. |
InstanceNotFound | If there is no implementation defined for the given FU. |
Definition at line 355 of file MachineImplementation.cc.
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().
UnitImplementationLocation & IDF::MachineImplementation::fuImplementation | ( | int | index | ) | const |
Returns the FU implementation at the given position.
index | The position index. |
OutOfRange | If the index is smaller than 0 or not smaller than the number of FU implementations. |
Definition at line 462 of file MachineImplementation.cc.
References ensureIndexValidity(), and fuImplementations_.
int IDF::MachineImplementation::fuImplementationCount | ( | ) | const |
Returns the number of FU implementations.
Definition at line 299 of file MachineImplementation.cc.
References fuImplementations_.
Referenced by IDFValidator::checkFUImplementations(), checkImplFiles(), ProGe::BlockSourceCopier::copyShared(), ProGeScriptGenerator::getBlockOrder(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), saveState(), and testUnits().
bool IDF::MachineImplementation::hasBusImplementation | ( | const std::string & | busName | ) | const |
Tells whether there is an implementation for the given bus defined.
busName | Name of the bus. |
Definition at line 272 of file MachineImplementation.cc.
References busImplementations_, and findImplementation().
Referenced by addBusImplementation(), and CostEstimator::Estimator::longestPath().
bool IDF::MachineImplementation::hasDecompressorFile | ( | ) | const |
Tells whether the decompressor definition file is given in IDF.
Definition at line 219 of file MachineImplementation.cc.
References decompressorFile_.
Referenced by checkImplFiles(), ProGe::BlockSourceCopier::copyProcessorSpecific(), makeImplFilesRelative(), and saveState().
bool IDF::MachineImplementation::hasFUGeneration | ( | const std::string & | name | ) | const |
Return true if fu is to be generated.
name | Name of the FU Generation to check. |
Definition at line 1590 of file MachineImplementation.cc.
References fuGenerated_.
Referenced by IDFValidator::checkFUImplementations(), and ProGe::ProGeUI::generateIDF().
bool IDF::MachineImplementation::hasFUImplementation | ( | const std::string & | unitName | ) | const |
Tells whether there is an implementation for the given FU defined.
unitName | Name of the FU. |
Definition at line 231 of file MachineImplementation.cc.
References findImplementation(), and fuImplementations_.
Referenced by addFUImplementation(), IDFValidator::checkFUImplementations(), ProGe::ProGeUI::generateIDF(), CostEstimator::Estimator::longestPath(), CostEstimator::Estimator::totalAreaOfFunctionUnits(), and CostEstimator::Estimator::totalEnergyOfFunctionUnits().
bool IDF::MachineImplementation::hasICDecoderHDB | ( | ) | const |
Returns true in case IC/decoder HDB file is set.
Definition at line 193 of file MachineImplementation.cc.
References icDecoderHDB_.
Referenced by checkImplFiles(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().
bool IDF::MachineImplementation::hasICDecoderPluginFile | ( | ) | const |
Returns true in case IC/decoder file is set.
Definition at line 168 of file MachineImplementation.cc.
References icDecoderPluginFile_.
Referenced by checkImplFiles(), ProGe::ProGeUI::generateIDF(), ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().
bool IDF::MachineImplementation::hasICDecoderPluginName | ( | ) | const |
Returns true in case IC/decoder name is set.
Definition at line 142 of file MachineImplementation.cc.
References icDecoderPluginName_.
Referenced by checkImplFiles(), ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().
bool IDF::MachineImplementation::hasIUImplementation | ( | const std::string & | unitName | ) | const |
Tells whether there is an implementation for the given IU defined.
unitName | Name of the IU. |
Definition at line 259 of file MachineImplementation.cc.
References findImplementation(), and iuImplementations_.
Referenced by addIUImplementation(), IDFValidator::checkIUImplementations(), ProGe::ProGeUI::generateIDF(), and CostEstimator::Estimator::longestPath().
bool IDF::MachineImplementation::hasRFImplementation | ( | const std::string & | unitName | ) | const |
Tells whether there is an implementation for the given RF defined.
unitName | Name of the RF. |
Definition at line 245 of file MachineImplementation.cc.
References findImplementation(), and rfImplementations_.
Referenced by addRFImplementation(), IDFValidator::checkRFImplementations(), ProGe::ProGeUI::generateIDF(), CostEstimator::Estimator::longestPath(), CostEstimator::Estimator::totalAreaOfRegisterFiles(), and CostEstimator::Estimator::totalEnergyOfRegisterFiles().
bool IDF::MachineImplementation::hasSocketImplementation | ( | const std::string & | socketName | ) | const |
Tells whether there is an implementation for the given socket defined.
socketName | Name of the IU. |
Definition at line 286 of file MachineImplementation.cc.
References findImplementation(), and socketImplementations_.
Referenced by addSocketImplementation(), and CostEstimator::Estimator::longestPath().
std::string IDF::MachineImplementation::icDecoderHDB | ( | ) | const |
Returns the absolute path to the IC/decoder HDB file.
FileNotFound | If the file is not found in search paths. |
Definition at line 179 of file MachineImplementation.cc.
References FileSystem::directoryOfPath(), FileSystem::findFileInSearchPaths(), Environment::hdbPaths(), icDecoderHDB_, TCEString::replaceString(), and sourceIDF_.
Referenced by DefaultICDecoderEstimator::estimateICArea(), DefaultICDecoderEstimator::estimateICDelayOfPath(), and DefaultICDecoderEstimator::estimateICEnergy().
unsigned IDF::MachineImplementation::icDecoderParameterCount | ( | ) | const |
Returns number of ic&decoder plugin parameters defined.
Definition at line 1371 of file MachineImplementation.cc.
References icDecoderParameters_.
Referenced by ProGe::ProGeUI::generateIDF(), and ProGe::ProGeUI::generateProcessor().
std::string IDF::MachineImplementation::icDecoderParameterName | ( | unsigned | param | ) | const |
Returns name of the ic/decoder parameter with the given index.
param | Index of the parameter. |
Definition at line 1382 of file MachineImplementation.cc.
References icDecoderParameters_.
Referenced by ProGe::ProGeUI::generateProcessor().
std::string IDF::MachineImplementation::icDecoderParameterValue | ( | const std::string & | name | ) | const |
Returns value of the ic/decoder parameter with the given name.
name | Name of the parameter. |
Definition at line 1415 of file MachineImplementation.cc.
References icDecoderParameters_.
Referenced by AlmaIFIntegrator::AlmaIFIntegrator(), ProGeTestBenchGenerator::generate(), ProGe::ProGeUI::generateProcessor(), and ProGe::TestBenchBlock::write().
std::string IDF::MachineImplementation::icDecoderParameterValue | ( | unsigned | param | ) | const |
Returns value of the ic/decoder parameter with the given index.
param | Index of the parameter. |
Definition at line 1399 of file MachineImplementation.cc.
References icDecoderParameters_.
std::string IDF::MachineImplementation::icDecoderPluginFile | ( | ) | const |
Returns the absolute path to the IC/decoder plugin file given in IDF.
FileNotFound | If the file is not found in search paths. |
Definition at line 153 of file MachineImplementation.cc.
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().
std::string IDF::MachineImplementation::icDecoderPluginName | ( | ) | const |
Returns the name of the IC/decoder plugin.
Definition at line 132 of file MachineImplementation.cc.
References icDecoderPluginName_.
Referenced by ProGe::ProGeUI::generateProcessor(), CostEstimator::Estimator::icArea(), CostEstimator::Estimator::icEnergy(), CostEstimator::Estimator::longestPath(), and saveState().
|
private |
Referenced by checkImplFiles().
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.
path | The file path that is relative or absolute. |
resolvedPath | The resolved absolute path. |
Definition at line 1542 of file MachineImplementation.cc.
References Environment::decompressorPaths(), FileSystem::findFileInSearchPaths(), Environment::hdbPaths(), Environment::icDecoderPluginPaths(), and TCEString::replaceString().
UnitImplementationLocation & IDF::MachineImplementation::iuImplementation | ( | const std::string & | iu | ) | const |
Returns the implementation data of the given IU.
iu | Name of the IU. |
InstanceNotFound | If there is no implementation defined for the given IU. |
Definition at line 399 of file MachineImplementation.cc.
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().
UnitImplementationLocation & IDF::MachineImplementation::iuImplementation | ( | int | index | ) | const |
Returns the IU implementation at the given position.
index | The position index. |
OutOfRange | If the index is smaller than 0 or not smaller than the number of IU implementations. |
Definition at line 490 of file MachineImplementation.cc.
References ensureIndexValidity(), and iuImplementations_.
int IDF::MachineImplementation::iuImplementationCount | ( | ) | const |
Returns the number of IU implementations.
Definition at line 321 of file MachineImplementation.cc.
References iuImplementations_.
Referenced by checkImplFiles(), IDFValidator::checkIUImplementations(), ProGe::BlockSourceCopier::copyShared(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), and saveState().
|
static |
Loads a MachineImplementation from the given IDF file.
idfFileName | The name of the file to load the IDF from. |
Exception | In case some error occured. |
Definition at line 1524 of file MachineImplementation.cc.
References IDF::IDFSerializer::readMachineImplementation(), and XMLSerializer::setSourceFile().
Referenced by Evaluate::createConfig(), MinimalOpSet::createConfig(), and main().
|
virtual |
Loads the state of the object from the given ObjectState tree.
state | The given ObjectState tree. |
ObjectStateLoadingException | If the given ObjectState tree is invalid. |
Implements Serializable.
Definition at line 762 of file MachineImplementation.cc.
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().
|
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.
searchPaths | Search for relative paths is done under these paths. |
implem | Object containing a file path, which points to an HDB file. |
Definition at line 1288 of file MachineImplementation.cc.
References IDF::UnitImplementationLocation::hdbFile(), Environment::hdbPaths(), FileSystem::makeRelativePath(), and IDF::UnitImplementationLocation::setHDBFile().
Referenced by 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.
sPaths | Search paths, used for finding relative paths. |
Definition at line 967 of file MachineImplementation.cc.
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().
void IDF::MachineImplementation::removeBusImplementation | ( | const std::string & | unitName | ) |
Removes the bus implementation with given name.
unitName | Name of the implementation to remove. |
InstanceNotFound | If there is no implementation defined for the given bus. |
Definition at line 709 of file MachineImplementation.cc.
References __func__, busImplementations_, and implementation.
Referenced by MinimizeMachine::minimizeBuses().
void IDF::MachineImplementation::removeFuGeneration | ( | const std::string & | name | ) |
Remove fu from generation list.
name | Name of the FU Generation to remove. |
Definition at line 1605 of file MachineImplementation.cc.
References fuGenerated_.
void IDF::MachineImplementation::removeFUImplementation | ( | const std::string & | unitName | ) |
Removes the FU implementation with given name.
unitName | Name of the implementation to remove. |
InstanceNotFound | If there is no implementation defined for the given FU. |
Definition at line 634 of file MachineImplementation.cc.
References __func__, fuImplementations_, and implementation.
Referenced by RemoveUnconnectedComponents::explore(), and IDFValidator::removeUnknownImplementations().
void IDF::MachineImplementation::removeIUImplementation | ( | const std::string & | unitName | ) |
Removes the IU implementation with given name.
unitName | Name of the implementation to remove. |
InstanceNotFound | If there is no implementation defined for the given IU. |
Definition at line 684 of file MachineImplementation.cc.
References __func__, implementation, and iuImplementations_.
Referenced by IDFValidator::removeUnknownImplementations().
void IDF::MachineImplementation::removeRFImplementation | ( | const std::string & | unitName | ) |
Removes the RF implementation with given name.
unitName | Name of the implementation to remove. |
InstanceNotFound | If there is no implementation defined for the given RF. |
Definition at line 659 of file MachineImplementation.cc.
References __func__, implementation, and rfImplementations_.
Referenced by RemoveUnconnectedComponents::explore(), and IDFValidator::removeUnknownImplementations().
void IDF::MachineImplementation::removeSocketImplementation | ( | const std::string & | unitName | ) |
Removes the socket implementation with given name.
unitName | Name of the implementation to remove. |
InstanceNotFound | If there is no implementation defined for the given socket. |
Definition at line 735 of file MachineImplementation.cc.
References __func__, implementation, and socketImplementations_.
UnitImplementationLocation & IDF::MachineImplementation::rfImplementation | ( | const std::string & | rf | ) | const |
Returns the implementation data of the given RF.
rf | Name of the RF. |
InstanceNotFound | If there is no implementation defined for the given RF. |
Definition at line 377 of file MachineImplementation.cc.
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().
UnitImplementationLocation & IDF::MachineImplementation::rfImplementation | ( | int | index | ) | const |
Returns the RF implementation at the given position.
index | The position index. |
OutOfRange | If the index is smaller than 0 or not smaller than the number of RF implementations. |
Definition at line 476 of file MachineImplementation.cc.
References ensureIndexValidity(), and rfImplementations_.
int IDF::MachineImplementation::rfImplementationCount | ( | ) | const |
Returns the number of RF implementations.
Definition at line 310 of file MachineImplementation.cc.
References rfImplementations_.
Referenced by checkImplFiles(), IDFValidator::checkRFImplementations(), ProGe::BlockSourceCopier::copyShared(), ProGeScriptGenerator::getBlockOrder(), makeImplFilesRelative(), IDFValidator::removeUnknownImplementations(), saveState(), and testUnits().
|
virtual |
Saves the state of the object to an ObjectState tree.
Implements Serializable.
Definition at line 862 of file MachineImplementation.cc.
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().
void IDF::MachineImplementation::setDecompressorFile | ( | const std::string & | file | ) |
Sets the decompressor block file.
file | Full path to the decompressor block file. |
Definition at line 1502 of file MachineImplementation.cc.
References decompressorFile_, Environment::decompressorPaths(), FileSystem::directoryOfPath(), FileSystem::findFileInSearchPaths(), and sourceIDF_.
void IDF::MachineImplementation::setICDecoderHDB | ( | const std::string & | file | ) |
Sets the ic/decoder HDB file.
file | Full path of the ic/decoder HDB file. |
Definition at line 1488 of file MachineImplementation.cc.
References FileSystem::directoryOfPath(), FileSystem::expandTilde(), FileSystem::findFileInSearchPaths(), Environment::hdbPaths(), icDecoderHDB_, and sourceIDF_.
Referenced by ComponentImplementationSelector::selectComponents().
void IDF::MachineImplementation::setICDecoderParameter | ( | const std::string & | name, |
const std::string & | value | ||
) |
Sets value of an ic/decoder parameter.
name | Name of the parameter. |
value | Value of the parameter. |
Definition at line 1437 of file MachineImplementation.cc.
References icDecoderParameters_.
Referenced by ProGe::ProGeUI::generateIDF().
void IDF::MachineImplementation::setICDecoderPluginFile | ( | const std::string & | file | ) |
Sets the ic/decoder plugin file.
file | Full path of the ic/decoder plugin file. |
Definition at line 1474 of file MachineImplementation.cc.
References FileSystem::directoryOfPath(), FileSystem::expandTilde(), FileSystem::findFileInSearchPaths(), icDecoderPluginFile_, Environment::icDecoderPluginPaths(), and sourceIDF_.
Referenced by ProGe::ProGeUI::generateIDF(), and ComponentImplementationSelector::selectComponents().
void IDF::MachineImplementation::setICDecoderPluginName | ( | const std::string & | name | ) |
Sets the ic/decoder plugin name.
name | Name of the ic/decoder plugin. |
Definition at line 1462 of file MachineImplementation.cc.
References icDecoderPluginName_.
Referenced by ProGe::ProGeUI::generateIDF(), and ComponentImplementationSelector::selectComponents().
UnitImplementationLocation & IDF::MachineImplementation::socketImplementation | ( | const std::string & | socket | ) | const |
Returns the implementation data of the given socket.
socket | Name of the socket. |
InstanceNotFound | If there is no implementation defined for the given socket. |
Definition at line 441 of file MachineImplementation.cc.
References __func__, findImplementation(), and socketImplementations_.
Referenced by checkImplFiles(), CostEstimator::Estimator::longestPath(), makeImplFilesRelative(), and saveState().
UnitImplementationLocation & IDF::MachineImplementation::socketImplementation | ( | int | index | ) | const |
Returns the socket implementation at the given position.
index | The position index. |
OutOfRange | If the index is smaller than 0 or not smaller than the number of socket implementations. |
Definition at line 518 of file MachineImplementation.cc.
References ensureIndexValidity(), and socketImplementations_.
int IDF::MachineImplementation::socketImplementationCount | ( | ) | const |
Returns the number of socket implementations.
Definition at line 341 of file MachineImplementation.cc.
References socketImplementations_.
Referenced by checkImplFiles(), makeImplFilesRelative(), and saveState().
std::string IDF::MachineImplementation::sourceIDF | ( | ) | const |
Returns the path to the source IDF file.
Definition at line 121 of file MachineImplementation.cc.
References sourceIDF_.
Referenced by IDF::UnitImplementationLocation::hdbFile().
|
private |
Possible alternative file paths for missing implementation files.
Definition at line 231 of file MachineImplementation.hh.
Referenced by checkImplFile(), and checkImplFiles().
|
private |
BUS implementations.
Definition at line 211 of file MachineImplementation.hh.
Referenced by addBusImplementation(), busImplementation(), busImplementationCount(), clearState(), hasBusImplementation(), and removeBusImplementation().
|
private |
Name of the decompressor block file.
Definition at line 222 of file MachineImplementation.hh.
Referenced by checkImplFiles(), clearState(), decompressorFile(), hasDecompressorFile(), loadState(), makeImplFilesRelative(), saveState(), and setDecompressorFile().
|
private |
Generated FUs.
Definition at line 202 of file MachineImplementation.hh.
Referenced by addFuGeneration(), clearState(), FUGenerations(), hasFUGeneration(), loadState(), removeFuGeneration(), and saveState().
|
private |
FU implementations.
Definition at line 205 of file MachineImplementation.hh.
Referenced by addFUImplementation(), clearState(), fuImplementation(), fuImplementationCount(), hasFUImplementation(), and removeFUImplementation().
|
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().
|
private |
IC/decoder plugin parameters.
Definition at line 226 of file MachineImplementation.hh.
Referenced by clearICDecoderParameters(), clearState(), icDecoderParameterCount(), icDecoderParameterName(), icDecoderParameterValue(), loadState(), saveState(), and setICDecoderParameter().
|
private |
Name of the IC/decoder plugin file.
Definition at line 218 of file MachineImplementation.hh.
Referenced by checkImplFiles(), clearState(), hasICDecoderPluginFile(), icDecoderPluginFile(), loadState(), makeImplFilesRelative(), saveState(), and setICDecoderPluginFile().
|
private |
Name of the IC/decoder plugin.
Definition at line 216 of file MachineImplementation.hh.
Referenced by clearState(), hasICDecoderPluginName(), icDecoderPluginName(), loadState(), and setICDecoderPluginName().
|
private |
IU implementations.
Definition at line 209 of file MachineImplementation.hh.
Referenced by addIUImplementation(), clearState(), hasIUImplementation(), iuImplementation(), iuImplementationCount(), and removeIUImplementation().
|
private |
Implementation files defined in IDF which cannot be located.
Definition at line 229 of file MachineImplementation.hh.
Referenced by checkImplFile(), and checkImplFiles().
|
static |
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().
|
static |
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().
|
static |
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().
|
static |
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().
|
static |
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().
|
static |
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().
|
static |
ObjectState attribute name for the source IDF.
Definition at line 141 of file MachineImplementation.hh.
Referenced by loadState(), IDF::IDFSerializer::readState(), and saveState().
|
static |
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().
|
static |
ObjectState name for FU generations container.
Definition at line 159 of file MachineImplementation.hh.
Referenced by IDF::IDFSerializer::convertToFileFormat(), IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().
|
static |
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().
|
static |
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().
|
static |
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().
|
static |
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().
|
static |
ObjectState name for machine implementation.
Definition at line 139 of file MachineImplementation.hh.
Referenced by IDF::IDFSerializer::convertToOMFormat(), loadState(), and saveState().
|
static |
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().
|
static |
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().
|
private |
RF implementations.
Definition at line 207 of file MachineImplementation.hh.
Referenced by addRFImplementation(), clearState(), hasRFImplementation(), removeRFImplementation(), rfImplementation(), and rfImplementationCount().
|
private |
SOCKET implementations.
Definition at line 213 of file MachineImplementation.hh.
Referenced by addSocketImplementation(), clearState(), hasSocketImplementation(), removeSocketImplementation(), socketImplementation(), and socketImplementationCount().
|
private |
Absolute path to the source IDF file.
Definition at line 224 of file MachineImplementation.hh.
Referenced by clearState(), decompressorFile(), icDecoderHDB(), icDecoderPluginFile(), loadState(), saveState(), setDecompressorFile(), setICDecoderHDB(), setICDecoderPluginFile(), and sourceIDF().