OpenASIP
2.0
|
#include <ComponentImplementationSelector.hh>
Classes | |
struct | implComp |
Public Member Functions | |
ComponentImplementationSelector () | |
virtual | ~ComponentImplementationSelector () |
void | addHDB (const HDB::HDBManager &hdb) |
void | addCase (const TTAProgram::Program &program, const ExecutionTrace &traceDB) |
std::map< const IDF::FUImplementationLocation *, CostEstimates * > | fuImplementations (const TTAMachine::FunctionUnit &fu, double frequencyMHz=0, double maxArea=0) |
std::list< TTAMachine::FunctionUnit * > | fuArchsByOpSetWithMinLatency (const std::set< std::string > &operationSet, int width=0) const |
std::map< const IDF::RFImplementationLocation *, CostEstimates * > | rfImplementations (const TTAMachine::RegisterFile &rf, bool guarded=false, double frequencyMHz=0, double maxArea=0) |
std::map< const IDF::IUImplementationLocation *, CostEstimates * > | iuImplementations (const TTAMachine::ImmediateUnit &iu, double frequencyMHz=0, double maxArea=0) |
void | selectComponentsToConf (DSDBManager::MachineConfiguration &conf, DSDBManager &dsdb, TTAMachine::Machine *mach=NULL, const std::string &icDecoder="ic_hdb", const std::string &icDecoderHDB="asic_130nm_1.5V.hdb", const double &frequency=0, const double &maxArea=0) |
IDF::MachineImplementation * | selectComponents (const TTAMachine::Machine *mach, const std::string &icDecoder="ic_hdb", const std::string &icDecoderHDB="asic_130nm_1.5V.hdb", const double &frequency=0, const double &maxArea=0) |
void | selectFUs (const TTAMachine::Machine *mach, IDF::MachineImplementation *idf, const double &frequency=0, const double &maxArea=0, const bool &filterLongestPathDelay=true) |
void | selectRFs (const TTAMachine::Machine *mach, IDF::MachineImplementation *idf, const double &frequency=0, const double &maxArea=0) |
void | selectIUs (const TTAMachine::Machine *mach, IDF::MachineImplementation *idf, const double &frequency=0, const double &maxArea=0) |
Private Attributes | |
std::set< std::string > | usedHDBs_ |
HDBs from which implementations are serched are stored in this set. More... | |
CostEstimator::Estimator | estimator_ |
Cost estimator to estimate the unit costs. More... | |
Purpose of the component implementation selector class is to select suitable implementations to architecture components. The component implementation selector uses HDB to look for implementations and returns set of suitable implementations that fulfill the given cost requirements. Class uses cost estimator to estimate the costs of suitable implementations. Cost estimation data includes energy estimations of all program cases that are set.
Definition at line 74 of file ComponentImplementationSelector.hh.
ComponentImplementationSelector::ComponentImplementationSelector | ( | ) |
|
virtual |
void ComponentImplementationSelector::addCase | ( | const TTAProgram::Program & | program, |
const ExecutionTrace & | traceDB | ||
) |
Adds new traceDB and corresponding program.
program | Test case program to be used. |
traceDB | Simulation trace of the program. |
Definition at line 94 of file ComponentImplementationSelector.cc.
void ComponentImplementationSelector::addHDB | ( | const HDB::HDBManager & | hdb | ) |
Adds new HDB to look for components.
hdb | The HDB file name to be added. |
Definition at line 83 of file ComponentImplementationSelector.cc.
References HDB::HDBManager::fileName().
Referenced by AutoSelectImplementationsDialog::findFUImplementations(), AutoSelectImplementationsDialog::findIUImplementations(), AutoSelectImplementationsDialog::findRFImplementations(), and ImplementationSelector::setupSelector().
list< TTAMachine::FunctionUnit * > ComponentImplementationSelector::fuArchsByOpSetWithMinLatency | ( | const std::set< std::string > & | operationSet, |
int | width = 0 |
||
) | const |
Finds the minimum set of Function units that is needed to satisfy all the wanted operations.
Function units are selected so that the number of needed units would be as low as possible and smaller latency is preferred. If there are units with same latency then units with smaller amount of operations is preferred. If there still are units with equal operations then the unit with the widest triggering port is preferred.
operationSet | Set of operation names the resultig set of function units must include. |
width | Bitwidth of the funtion unit ports. Not used if left as default. |
Definition at line 212 of file ComponentImplementationSelector.cc.
References HDB::FUArchitecture::architecture(), HDB::CachedHDBManager::fuArchitectureByID(), HDB::HDBManager::fuArchitectureIDsByOperationSet(), HDB::HDBRegistry::hdb(), HDB::HDBRegistry::instance(), TTAMachine::FUPort::isTriggering(), TTAMachine::HWOperation::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), TTAMachine::FunctionUnit::port(), StringTools::stringToLower(), and TTAMachine::BaseFUPort::width().
map< const IDF::FUImplementationLocation *, CostEstimates * > ComponentImplementationSelector::fuImplementations | ( | const TTAMachine::FunctionUnit & | fu, |
double | frequencyMHz = 0 , |
||
double | maxArea = 0 |
||
) |
Finds set of possible function unit implementations.
Finds out which function unit implementations fulfill the frequency and area requirements. The implementations are selected by estimating costs of different function unit implementations that match the given funtion unit architecture. All implementations that fulfill the given frequency and area requirements are returned including the estimated cost data of those implementations.
fu | Function unit architecture. |
frequencyMHz | Target frequency (MHz) of the function unit. |
maxArea | Maximum area (in gates) of the function unit. |
Definition at line 116 of file ComponentImplementationSelector.cc.
References IDF::MachineImplementation::addFUImplementation(), HDB::HDBManager::fileName(), HDB::HDBManager::fuEntriesByArchitecture(), HDB::HDBRegistry::hdb(), HDB::HDBRegistry::instance(), TTAMachine::Component::name(), CostEstimates::setArea(), and CostEstimates::setLongestPathDelay().
Referenced by AutoSelectImplementationsDialog::findFUImplementations().
map< const IDF::IUImplementationLocation *, CostEstimates * > ComponentImplementationSelector::iuImplementations | ( | const TTAMachine::ImmediateUnit & | iu, |
double | frequencyMHz = 0 , |
||
double | maxArea = 0 |
||
) |
Finds set of possible immediate unit implementations.
Finds out which immediate unit implementations fulfill the frequency and area requirements. The implementations are selected by estimating costs of different immediate unit implementations that match the given immediate unit architecture. All implementations that fulfill the given frequency and area requirements are returned including the estimated cost data of those implementations.
iu | Immediate unit architecture. |
frequencyMHz | Target frequency (MHz) of the immediate unit. |
maxArea | Maximum area (in gates) of the immediate unit. |
Definition at line 494 of file ComponentImplementationSelector.cc.
References IDF::MachineImplementation::addIUImplementation(), HDB::HDBManager::fileName(), HDB::HDBRegistry::hdb(), HDB::HDBRegistry::instance(), TTAMachine::Component::name(), TTAMachine::BaseRegisterFile::numberOfRegisters(), TTAMachine::Unit::portCount(), HDB::HDBManager::rfEntriesByArchitecture(), CostEstimates::setArea(), CostEstimates::setLongestPathDelay(), and TTAMachine::BaseRegisterFile::width().
Referenced by AutoSelectImplementationsDialog::findIUImplementations().
map< const IDF::RFImplementationLocation *, CostEstimates * > ComponentImplementationSelector::rfImplementations | ( | const TTAMachine::RegisterFile & | rf, |
bool | guarded = false , |
||
double | frequencyMHz = 0 , |
||
double | maxArea = 0 |
||
) |
Finds set of possible register file implementations.
Finds out which register file implementations fulfill the frequency and area requirements. The implementations are selected by estimating costs of different register file implementations that match the given register file architecture. All implementations that fulfill the given frequency and area requirements are returned including the estimated cost data of those implementations.
rf | Register file architecture. |
guarded | Flag indicating if the register file is guarded, defaults to false. |
frequencyMHz | Target frequency (MHz) of the register file. |
maxArea | Maximum area (in gates) of the register file. |
Definition at line 377 of file ComponentImplementationSelector.cc.
References IDF::MachineImplementation::addRFImplementation(), HDB::HDBManager::fileName(), TTAMachine::RegisterFile::guardLatency(), HDB::HDBRegistry::hdb(), TTAMachine::Port::inputSocket(), HDB::HDBRegistry::instance(), TTAMachine::RegisterFile::maxReads(), TTAMachine::RegisterFile::maxWrites(), TTAMachine::Component::name(), TTAMachine::BaseRegisterFile::numberOfRegisters(), TTAMachine::Port::outputSocket(), TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), HDB::HDBManager::rfEntriesByArchitecture(), CostEstimates::setArea(), CostEstimates::setLongestPathDelay(), TTAMachine::BaseRegisterFile::width(), and TTAMachine::RegisterFile::zeroRegister().
Referenced by AutoSelectImplementationsDialog::findRFImplementations().
IDF::MachineImplementation * ComponentImplementationSelector::selectComponents | ( | const TTAMachine::Machine * | mach, |
const std::string & | icDecoder = "ic_hdb" , |
||
const std::string & | icDecoderHDB = "asic_130nm_1.5V.hdb" , |
||
const double & | frequency = 0 , |
||
const double & | maxArea = 0 |
||
) |
Selects the implementations for the machine configuration.
configuration | MachineConfiguration of which architecture is used. |
frequency | The minimum frequency of the implementations. |
icDecoder | The name of the ic decoder plugin for idf. |
icDecoderHDB | The name of the hdb used by ic decoder plugin. |
Exception | No suitable implementations found. |
Definition at line 645 of file ComponentImplementationSelector.cc.
References FileSystem::DIRECTORY_SEPARATOR, FileSystem::fileExists(), HDB::HDBRegistry::hdb(), HDB::HDBRegistry::hdbCount(), Environment::icDecoderPluginPaths(), HDB::HDBRegistry::instance(), IDF::MachineImplementation::setICDecoderHDB(), IDF::MachineImplementation::setICDecoderPluginFile(), and IDF::MachineImplementation::setICDecoderPluginName().
Referenced by DesignSpaceExplorer::selectComponents().
void ComponentImplementationSelector::selectComponentsToConf | ( | DSDBManager::MachineConfiguration & | conf, |
DSDBManager & | dsdb, | ||
TTAMachine::Machine * | mach = NULL , |
||
const std::string & | icDecoder = "ic_hdb" , |
||
const std::string & | icDecoderHDB = "asic_130nm_1.5V.hdb" , |
||
const double & | frequency = 0 , |
||
const double & | maxArea = 0 |
||
) |
Selects the implementations for machine configuration.
Stores created idf to the given configuration and the configuration hold information in the given dsdb. If no machine is given then read the machine from dsdb through given configuration.
conf | Machine configuration. |
dsdb | DSDB where implementation is added. |
mach | Machine for what the implementation is generated. |
icDecoder | The name of the ic decoder plugin for idf. |
icDecoderHDB | The name of the hdb used by ic decoder plugin. |
frequency | The minimum frequency of the implementations. |
maxArea | The maximum area of the implementations. |
Definition at line 601 of file ComponentImplementationSelector.cc.
References __func__, DSDBManager::addImplementation(), DSDBManager::architecture(), DSDBManager::MachineConfiguration::architectureID, Exception::errorMessage(), DSDBManager::MachineConfiguration::hasImplementation, DSDBManager::MachineConfiguration::implementationID, and Exception::setCause().
void ComponentImplementationSelector::selectFUs | ( | const TTAMachine::Machine * | mach, |
IDF::MachineImplementation * | idf, | ||
const double & | frequency = 0 , |
||
const double & | maxArea = 0 , |
||
const bool & | filterLongestPathDelay = true |
||
) |
Selects the implementations for FUs in the machine configuration.
frequency and maxArea to zero by default. TODO: throw more appropriate exceptions
Definition at line 691 of file ComponentImplementationSelector.cc.
References __func__, IDF::MachineImplementation::addFUImplementation(), CostEstimates::area(), TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), CostEstimates::longestPathDelay(), TTAMachine::Component::name(), IDF::UnitImplementationLocation::saveState(), Exception::setCause(), and Application::writeToErrorLog().
void ComponentImplementationSelector::selectIUs | ( | const TTAMachine::Machine * | mach, |
IDF::MachineImplementation * | idf, | ||
const double & | frequency = 0 , |
||
const double & | maxArea = 0 |
||
) |
Selects the implementations for IUs in the machine configuration.
Definition at line 867 of file ComponentImplementationSelector.cc.
References __func__, IDF::MachineImplementation::addIUImplementation(), CostEstimates::area(), TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), CostEstimates::longestPathDelay(), TTAMachine::Component::name(), IDF::UnitImplementationLocation::saveState(), Exception::setCause(), and Application::writeToErrorLog().
void ComponentImplementationSelector::selectRFs | ( | const TTAMachine::Machine * | mach, |
IDF::MachineImplementation * | idf, | ||
const double & | frequency = 0 , |
||
const double & | maxArea = 0 |
||
) |
Selects the implementations for RFs in the machine configuration.
Selects the the RF that has biggest longest path delay.
Definition at line 783 of file ComponentImplementationSelector.cc.
References __func__, IDF::MachineImplementation::addRFImplementation(), CostEstimates::area(), TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), TTAMachine::RegisterFile::isUsedAsGuard(), TTAMachine::Machine::Navigator< ComponentType >::item(), CostEstimates::longestPathDelay(), TTAMachine::Component::name(), TTAMachine::Machine::registerFileNavigator(), IDF::UnitImplementationLocation::saveState(), Exception::setCause(), and Application::writeToErrorLog().
|
private |
Cost estimator to estimate the unit costs.
Definition at line 131 of file ComponentImplementationSelector.hh.
|
private |
HDBs from which implementations are serched are stored in this set.
Definition at line 129 of file ComponentImplementationSelector.hh.