OpenASIP
2.0
|
#include <Estimator.hh>
Private Member Functions | |
DelayInNanoSeconds | estimateSocketToSocketDelayOfPath (const std::string pluginPath, const std::string pluginName, const TransportPath &path, const IDF::MachineImplementation &machineImplementation, const IDF::SocketImplementationLocation &sourceSocketImplementation, const IDF::BusImplementationLocation &busImplementation, const IDF::SocketImplementationLocation &destinationSocketImplementation) |
FUCostEstimationPlugin & | fuCostFunctionPluginOfImplementation (const IDF::FUImplementationLocation &implementation) |
RFCostEstimationPlugin & | rfCostFunctionPluginOfImplementation (const IDF::RFImplementationLocation &implementation) |
Static Private Member Functions | |
static TransportPathList * | findAllICPaths (const TTAMachine::Machine &machine) |
Private Attributes | |
FUCostEstimationPluginRegistry | fuEstimatorPluginRegistry_ |
all accessed FU estimation plugins are stored in this registry More... | |
RFCostEstimationPluginRegistry | rfEstimatorPluginRegistry_ |
all accessed RF estimation plugins are stored in this registry More... | |
ICDecoderCostEstimationPluginRegistry | icDecoderEstimatorPluginRegistry_ |
all accessed IC&decoder plugins are stored in this registry More... | |
The frontend to hardware cost estimation functionality.
This class is used by clients that need to estimate area, energy, or delay of a whole TTA processor or parts of it.
The estimation functions of this interface throw CannotEstimateCost, because it really is an exceptional situation when this class cannot estimate, because it's client's responsibility to make sure all plugins etc. can be found for estimating the machine. In case of single plugins, the situation is not exceptional, but they provide estimation as a "capability", thus they signal explicitly whether they can estimate a cost or not by returning true or false, respectively.
Definition at line 85 of file Estimator.hh.
CostEstimator::Estimator::Estimator | ( | ) |
|
virtual |
DelayInNanoSeconds CostEstimator::Estimator::decompressorDelay | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation | ||
) |
|
private |
Estimates the delay of a single socket-to-socket path.
Delegates the task to the given IC&decoder plugin.
pluginPath | The path of the IC&decoder estimator plugin to use. |
pluginName | The name of the IC&decoder estimator plugin to use. |
pluginDataHDB | The HDB from which the plugin should fetch its data. |
path | The path to estimate. |
machineImplementation | Implementation of the machine. |
sourceSocketImplementation | The implementation descriptor of source socket. |
busImplementation | The implementation descriptor of bus. |
destinationSocketImplementation | The implementation descriptor of destination socket. |
Definition at line 1316 of file Estimator.cc.
References __func__, Exception::errorMessage(), CostEstimator::ICDecoderEstimatorPlugin::estimateICDelayOfPath(), and HDB::HDBRegistry::instance().
|
staticprivate |
Finds all paths in the interconnection network of the given machine.
machine | Machine to search the paths in. |
IllegalMachine | In case the machine is badly formed, for example, has features that are not supported yet. |
Definition at line 1228 of file Estimator.cc.
References __func__, TTAMachine::Machine::busNavigator(), TTAMachine::Segment::connection(), TTAMachine::Segment::connectionCount(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Socket::direction(), TTAMachine::Socket::INPUT, TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), machine, TTAMachine::Port::name(), TTAMachine::Component::name(), TTAMachine::Socket::OUTPUT, TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), TTAMachine::Bus::segment(), and TTAMachine::Bus::segmentCount().
|
private |
Loads an FU cost estimation plugin for the given FU implementation.
implementationEntry | The implementation of the FU. |
Exception | In case the plugin was not found or could not be loaded. |
Definition at line 260 of file Estimator.cc.
References __func__, HDB::HDBEntry::costFunction(), Exception::errorMessage(), HDB::HDBManager::fuByEntryID(), HDB::HDBEntry::hasCostFunction(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), IDF::UnitImplementationLocation::id(), HDB::HDBRegistry::instance(), HDB::CostFunctionPlugin::name(), and HDB::CostFunctionPlugin::pluginFilePath().
AreaInGates CostEstimator::Estimator::functionUnitArea | ( | const TTAMachine::FunctionUnit & | architecture, |
const IDF::FUImplementationLocation & | implementationEntry | ||
) |
Estimates the area of the given function unit.
architecture | The FU architecture of which area to estimate. |
implementationEntry | The implementation information of FU. Can be an instance of NullFUImplementationLocation. |
CannotEstimateCost | In case the area could not be estimated. |
Definition at line 364 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), and TTAMachine::Component::name().
EnergyInMilliJoules CostEstimator::Estimator::functionUnitEnergy | ( | const TTAMachine::FunctionUnit & | architecture, |
const IDF::FUImplementationLocation & | implementationEntry, | ||
const TTAProgram::Program & | program, | ||
const ExecutionTrace & | traceDB | ||
) |
Estimates the energy consumed by the given FU when running the given program.
architecture | The FU architecture of which area to estimate. |
implementationEntry | The implementation information of FU. Can be an instance of NullFUImplementationLocation. |
program | The program of which energy to calculate. |
traceDB | The simulation trace database of the program running in the target architecture. |
CannotEstimateCost | In case the energy could not be estimated. |
Definition at line 510 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), TTAMachine::Component::name(), and program.
DelayInNanoSeconds CostEstimator::Estimator::functionUnitMaximumComputationDelay | ( | const TTAMachine::FunctionUnit & | architecture, |
const IDF::FUImplementationLocation & | implementationEntry | ||
) |
Estimates the maximum computation delay of the given function unit.
The maximum computation delay is the longest stage in the FU unit's pipeline. It's used mainly for calculating the maximum clock frequency of target architecture by finding the longest path of the machine.
architecture | The FU architecture of which area to estimate. |
implementationEntry | The implementation information of FU. |
CannotEstimateCost | In case the computation delay could not be estimated. |
Definition at line 834 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), and TTAMachine::Component::name().
DelayInNanoSeconds CostEstimator::Estimator::functionUnitPortReadDelay | ( | const TTAMachine::FUPort & | port, |
const IDF::FUImplementationLocation & | implementationEntry | ||
) |
Estimates the output delay of the given function unit port.
port | The architecture of the FU port of which area to estimate. |
implementationEntry | The implementation information of the FU port belongs to. |
CannotEstimateCost | In case the output delay could not be estimated. |
Definition at line 718 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), TTAMachine::Port::name(), TTAMachine::Component::name(), and TTAMachine::BaseFUPort::parentUnit().
DelayInNanoSeconds CostEstimator::Estimator::functionUnitPortWriteDelay | ( | const TTAMachine::FUPort & | port, |
const IDF::FUImplementationLocation & | implementationEntry | ||
) |
Estimates the input delay of the given function unit port.
port | The architecture of FU port of which area to estimate. |
implementationEntry | The implementation information of the FU the port belongs to. |
CannotEstimateCost | In case the input delay could not be estimated. |
Definition at line 679 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), TTAMachine::Port::name(), TTAMachine::Component::name(), and TTAMachine::BaseFUPort::parentUnit().
AreaInGates CostEstimator::Estimator::icArea | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation | ||
) |
Estimates the area consumed by the interconnection network.
machine | The machine of which IC area to estimate. |
machineImplementation | The machine implementation information. |
CannotEstimateCost | In case cost cannot be estimated for some reason. Reason is given in error message. |
Definition at line 206 of file Estimator.cc.
References __func__, Exception::errorMessage(), CostEstimator::ICDecoderEstimatorPlugin::estimateICArea(), IDF::MachineImplementation::hasICDecoderHDB(), IDF::MachineImplementation::hasICDecoderPluginFile(), IDF::MachineImplementation::hasICDecoderPluginName(), IDF::MachineImplementation::icDecoderPluginFile(), IDF::MachineImplementation::icDecoderPluginName(), HDB::HDBRegistry::instance(), Application::logStream(), machine, and Application::verboseLevel().
EnergyInMilliJoules CostEstimator::Estimator::icEnergy | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation, | ||
const TTAProgram::Program & | program, | ||
const ExecutionTrace & | traceDB | ||
) |
Estimates the total energy consumed by the interconnection network of the given machine running the given program.
machine | Architecture of the processor. |
machineImplementation | Implementation information of the processor. |
traceDB | The simulation trace database obtained from simulating the program. |
CannotEstimateCost | If the energy could not be estimated. |
Definition at line 456 of file Estimator.cc.
References __func__, Exception::errorMessage(), CostEstimator::ICDecoderEstimatorPlugin::estimateICEnergy(), IDF::MachineImplementation::hasICDecoderHDB(), IDF::MachineImplementation::hasICDecoderPluginFile(), IDF::MachineImplementation::hasICDecoderPluginName(), IDF::MachineImplementation::icDecoderPluginFile(), IDF::MachineImplementation::icDecoderPluginName(), HDB::HDBRegistry::instance(), machine, and program.
DelayInNanoSeconds CostEstimator::Estimator::longestPath | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation | ||
) |
delay estimation functions
Calculates the longest path of the machine.
The longest path is the longest delay in the machine. It can be a path in interconnection network or a computation delay of an FU.
machine | Machine to calculate the longest path for. |
machineImplementation | Implementation identifier for the machine. |
Definition at line 915 of file Estimator.cc.
References __func__, CostEstimator::TransportPath::bus(), IDF::MachineImplementation::busImplementation(), TTAMachine::Machine::busNavigator(), TTAMachine::Segment::connectionCount(), TTAMachine::Machine::Navigator< ComponentType >::count(), CostEstimator::TransportPath::destinationPort(), CostEstimator::TransportPath::destinationSocket(), IDF::MachineImplementation::fuImplementation(), TTAMachine::Machine::functionUnitNavigator(), IDF::MachineImplementation::hasBusImplementation(), IDF::MachineImplementation::hasFUImplementation(), IDF::MachineImplementation::hasICDecoderHDB(), IDF::MachineImplementation::hasICDecoderPluginFile(), IDF::MachineImplementation::hasICDecoderPluginName(), IDF::MachineImplementation::hasIUImplementation(), IDF::MachineImplementation::hasRFImplementation(), IDF::MachineImplementation::hasSocketImplementation(), IDF::MachineImplementation::icDecoderPluginFile(), IDF::MachineImplementation::icDecoderPluginName(), IDF::NullUnitImplementationLocation::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), IDF::MachineImplementation::iuImplementation(), Application::logStream(), machine, TTAMachine::Port::name(), TTAMachine::Component::name(), TTAMachine::BaseFUPort::parentUnit(), TTAMachine::RFPort::parentUnit(), TTAMachine::Port::parentUnit(), TTAMachine::Machine::registerFileNavigator(), IDF::MachineImplementation::rfImplementation(), TTAMachine::Bus::segment(), IDF::MachineImplementation::socketImplementation(), TTAMachine::Machine::socketNavigator(), CostEstimator::TransportPath::sourcePort(), and CostEstimator::TransportPath::sourceSocket().
Referenced by ImmediateGenerator::explore(), and main().
AreaInGates CostEstimator::Estimator::registerFileArea | ( | const TTAMachine::BaseRegisterFile & | architecture, |
const IDF::RFImplementationLocation & | implementationEntry | ||
) |
Estimates the area of the given register file.
architecture | The RF architecture of which area to estimate. |
implementationEntry | The implementation information of RF. Can be an instance of NullRFImplementationLocation. |
CannotEstimateCost | In case the area could not be estimated. |
Definition at line 398 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), and TTAMachine::Component::name().
EnergyInMilliJoules CostEstimator::Estimator::registerFileEnergy | ( | const TTAMachine::BaseRegisterFile & | architecture, |
const IDF::RFImplementationLocation & | implementationEntry, | ||
const TTAProgram::Program & | program, | ||
const ExecutionTrace & | traceDB | ||
) |
Estimates the energy consumed by the given register file when running the given program.
architecture | The RF architecture of which area to estimate. |
implementationEntry | The implementation information of RF. Can be an instance of NullRFImplementationLocation. |
program | The program of which energy to calculate. |
traceDB | The simulation trace database of the program running in the target architecture. |
CannotEstimateCost | In case the energy could not be estimated. |
Definition at line 551 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), TTAMachine::Component::name(), and program.
DelayInNanoSeconds CostEstimator::Estimator::registerFileMaximumComputationDelay | ( | const TTAMachine::BaseRegisterFile & | architecture, |
const IDF::RFImplementationLocation & | implementationEntry | ||
) |
Estimates the maximum computation delay of the given register file.
The maximum computation delay is the longest stage in a RF's execution. It's used mainly for calculating the maximum clock frequency of target architecture.
architecture | The RF architecture of which area to estimate. |
implementationEntry | The implementation information of RF. |
CannotEstimateCost | In case the computation delay could not be estimated. |
Definition at line 876 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), and TTAMachine::Component::name().
DelayInNanoSeconds CostEstimator::Estimator::registerFilePortReadDelay | ( | const TTAMachine::RFPort & | port, |
const IDF::RFImplementationLocation & | implementationEntry | ||
) |
Estimates the output delay of the given register file port.
port | The RF port of which output delay to estimate. |
implementationEntry | The implementation information of RF. |
CannotEstimateCost | In case the output delay could not be estimated. |
Definition at line 793 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), TTAMachine::Port::name(), TTAMachine::Component::name(), and TTAMachine::RFPort::parentUnit().
DelayInNanoSeconds CostEstimator::Estimator::registerFilePortWriteDelay | ( | const TTAMachine::RFPort & | port, |
const IDF::RFImplementationLocation & | implementationEntry | ||
) |
Estimates the input delay of the given register file port.
port | The RF port of which input delay to estimate. |
implementationEntry | The implementation information of the RF the port belongs to. |
CannotEstimateCost | In case the input delay could not be estimated. |
Definition at line 756 of file Estimator.cc.
References __func__, Exception::errorMessage(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), HDB::HDBRegistry::instance(), TTAMachine::Port::name(), TTAMachine::Component::name(), and TTAMachine::RFPort::parentUnit().
|
private |
Loads a RF cost estimation plugin for the given RF implementation.
implementationEntry | The implementation of the RF. |
Exception | In case the plugin was not found or could not be loaded. |
Definition at line 312 of file Estimator.cc.
References __func__, HDB::HDBEntry::costFunction(), Exception::errorMessage(), HDB::HDBEntry::hasCostFunction(), HDB::HDBRegistry::hdb(), IDF::UnitImplementationLocation::hdbFile(), IDF::UnitImplementationLocation::id(), HDB::HDBRegistry::instance(), HDB::CostFunctionPlugin::name(), HDB::CostFunctionPlugin::pluginFilePath(), and HDB::HDBManager::rfByEntryID().
AreaInGates CostEstimator::Estimator::totalArea | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation | ||
) |
area estimation functions
Estimates the total area of given machine.
Area estimate is calculated as a sum of areas of different machine parts.
machine | The machine architecture to estimate. |
machineImplementation | The machine implementation information. |
CannotEstimateCost | In case cost cannot be estimated for some reason. Reason is given in error message. |
Definition at line 84 of file Estimator.cc.
References machine.
Referenced by ImmediateGenerator::explore(), and main().
AreaInGates CostEstimator::Estimator::totalAreaOfFunctionUnits | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation | ||
) |
Estimates the total area of all function units in the given machine.
GCU is not treated as an FU. It should be estimated as a part of IC.
machine | The machine architecture to estimate. |
machineImplementation | The machine implementation information. |
CannotEstimateCost | In case cost cannot be estimated for some reason. Reason is given in error message. |
Definition at line 103 of file Estimator.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), IDF::MachineImplementation::fuImplementation(), TTAMachine::Machine::functionUnitNavigator(), IDF::MachineImplementation::hasFUImplementation(), IDF::NullUnitImplementationLocation::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), machine, TTAMachine::Component::name(), Application::verboseLevel(), and Application::warningStream().
AreaInGates CostEstimator::Estimator::totalAreaOfRegisterFiles | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation | ||
) |
Estimates the total area of all register files in the given machine.
machine | The machine architecture to estimate. |
machineImplementation | The machine implementation information. |
CannotEstimateCost | In case cost cannot be estimated for some reason. Reason is given in error message. |
Definition at line 162 of file Estimator.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), IDF::MachineImplementation::hasRFImplementation(), IDF::NullUnitImplementationLocation::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), machine, TTAMachine::Component::name(), TTAMachine::Machine::registerFileNavigator(), IDF::MachineImplementation::rfImplementation(), Application::verboseLevel(), and Application::warningStream().
EnergyInMilliJoules CostEstimator::Estimator::totalEnergy | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation, | ||
const TTAProgram::Program & | program, | ||
const ExecutionTrace & | traceDB | ||
) |
energy estimation functions
Estimates the total energy consumed by the given processor running the given program.
machine | Architecture of the processor. |
machineImplementation | Implementation information of the processor. |
traceDB | The execution trace database obtained from simulating the program. |
CannotEstimateCost | If the energy could not be estimated. |
Definition at line 433 of file Estimator.cc.
References machine, and program.
Referenced by main().
EnergyInMilliJoules CostEstimator::Estimator::totalEnergyOfFunctionUnits | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation, | ||
const TTAProgram::Program & | program, | ||
const ExecutionTrace & | traceDB | ||
) |
Estimates the total energy consumed by all function units in the machine (GCU not included).
Energy estimate is calculated as a sum of consumed energies of all FUs.
machine | The machine architecture to estimate. |
machineImplementation | The machine implementation information. |
program | The program of which energy to calculate. |
traceDB | The simulation trace database of the program running in the target architecture. |
CannotEstimateCost | In case cost cannot be estimated for some reason. Reason is given in error message. |
Definition at line 592 of file Estimator.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), IDF::MachineImplementation::fuImplementation(), TTAMachine::Machine::functionUnitNavigator(), IDF::MachineImplementation::hasFUImplementation(), IDF::NullUnitImplementationLocation::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Component::name(), and program.
EnergyInMilliJoules CostEstimator::Estimator::totalEnergyOfRegisterFiles | ( | const TTAMachine::Machine & | machine, |
const IDF::MachineImplementation & | machineImplementation, | ||
const TTAProgram::Program & | program, | ||
const ExecutionTrace & | traceDB | ||
) |
Estimates the total energy consumed by all register files in the machine.
Energy estimate is calculated as a sum of energies of RFs.
machine | The machine architecture to estimate. |
machineImplementation | The machine implementation information. |
program | The program of which energy to calculate. |
traceDB | The simulation trace database of the program running in the target architecture. |
CannotEstimateCost | In case cost cannot be estimated for some reason. Reason is given in error message. |
Definition at line 645 of file Estimator.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), IDF::MachineImplementation::hasRFImplementation(), IDF::NullUnitImplementationLocation::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, TTAMachine::Component::name(), program, TTAMachine::Machine::registerFileNavigator(), and IDF::MachineImplementation::rfImplementation().
|
private |
all accessed FU estimation plugins are stored in this registry
Definition at line 202 of file Estimator.hh.
|
private |
all accessed IC&decoder plugins are stored in this registry
Definition at line 206 of file Estimator.hh.
|
private |
all accessed RF estimation plugins are stored in this registry
Definition at line 204 of file Estimator.hh.