35#include "boost/format.hpp"
109 for (
int i = 0; i < nav.
count(); ++i) {
115 fuArchitecture->
name())) {
117 fuArchitecture->
name());
126 <<
"Warning: gate count of FU '"
127 << fuArchitecture->
name() <<
"' was estimated as "
128 << areaFU << std::endl;
131 <<
"FU '" << fuArchitecture->
name()
132 <<
"' contributes " << areaFU <<
" gates" << std::endl;
168 for (
int i = 0; i < nav.
count(); ++i) {
174 rfArchitecture->
name())) {
176 rfArchitecture->
name());
185 <<
"Warning: gate count of RF '"
186 << rfArchitecture->
name() <<
"' was estimated as "
187 << areaRF << std::endl;
190 <<
"RF '" << rfArchitecture->
name()
191 <<
"' contributes " << areaRF <<
" gates" << std::endl;
214 "Missing IC&decoder plugin information.");
231 "The IC&decoder estimator plugin '%s' unable to estimate "
238 std::string(
"Error while using ICDecoder estimation plugin. ") +
244 <<
"IC contributes " << area <<
" gates"
262 std::string pluginFileName =
"";
263 std::string pluginName =
"";
277 "Function unit entry %d does not have cost "
278 "estimation plugin set.") %
279 implementationEntry.
id()).str());
284 pluginName = pluginData.
name();
288 pluginFileName, pluginName);
292 std::string(
"Unable to open FU estimation plugin '") +
314 std::string pluginFileName =
"";
315 std::string pluginName =
"";
329 "Register file entry %d does not have cost "
330 "estimation plugin set.") % implementationEntry.
id()).str());
335 pluginName = pluginData.
name();
339 pluginFileName, pluginName);
343 std::string(
"Unable to open RF estimation plugin '") +
370 implementationEntry.
hdbFile());
372 estimateArea(architecture, implementationEntry, area, hdb)) {
376 "Plugin was unable to estimate area of function unit '") +
377 architecture.
name() +
".");
383 std::string(
"Unable to estimate area of function unit '") +
404 implementationEntry.
hdbFile());
406 estimateArea(architecture, implementationEntry, area, hdb)) {
409 std::string(
"Plugin was unable to estimate area."));
415 std::string(
"Unable to estimate area of register file '") +
465 "Missing IC&decoder plugin information.");
482 "The IC&decoder estimator plugin '%s' could not estimate "
490 std::string(
"Error while using ICDecoder estimation plugin. ") +
517 implementationEntry.
hdbFile());
520 architecture, implementationEntry,
program, traceDB, area,
524 std::string(
"Plugin was unable to estimate energy."));
530 std::string(
"Unable to estimate energy of function unit '") +
558 implementationEntry.
hdbFile());
561 architecture, implementationEntry,
program, traceDB, area,
565 std::string(
"Plugin was unable to estimate energy."));
571 std::string(
"Unable to estimate energy of register file '") +
599 for (
int i = 0; i < nav.
count(); ++i) {
605 fuArchitecture->
name())) {
607 fuArchitecture->
name());
610 *fuArchitecture, *fuImplementation,
program, traceDB);
652 for (
int i = 0; i < nav.
count(); ++i) {
658 rfArchitecture->
name())) {
660 rfArchitecture->
name());
663 *rfArchitecture, *rfImplementation,
program, traceDB);
685 implementationEntry.
hdbFile());
687 estimatePortWriteDelay(port, implementationEntry, delay, hdb)) {
691 "Plugin was unable to estimate input delay of port "
700 "Input delay estimation could not be done for the given "
701 "function unit entry. ") +
724 implementationEntry.
hdbFile());
726 estimatePortReadDelay(port, implementationEntry, delay, hdb)) {
730 "Plugin was unable to estimate output delay of port "
739 "Output delay estimation could not be done for the given "
762 implementationEntry.
hdbFile());
764 estimatePortWriteDelay(port, implementationEntry, delay, hdb)) {
768 "Plugin was unable to estimate input delay of port "
777 "Input delay estimation could not be done for a "
799 implementationEntry.
hdbFile());
801 estimatePortReadDelay(port, implementationEntry, delay, hdb)) {
805 "Plugin was unable to estimate output delay of port "
814 "Output delay estimation could not be done for the given "
840 implementationEntry.
hdbFile());
842 estimateMaximumComputationDelay(
843 architecture, implementationEntry, delay, hdb)) {
847 "Plugin was unable to estimate computation delay of FU ") +
848 architecture.
name());
855 "Computation delay estimation could not be done for the given "
856 "function unit entry. ") +
882 implementationEntry.
hdbFile());
884 estimateMaximumComputationDelay(
885 architecture, implementationEntry, delay, hdb)) {
889 "Plugin was unable to estimate computation delay of RF ") +
890 architecture.
name());
897 "Computation delay estimation could not be done for the given "
898 "register file entry. ") +
926 std::string fBusName =
"";
929 for (
int i = 0; i < busNav.
count(); ++i) {
935 fBusName = bus.
name();
941 for (TransportPathList::iterator i = icPaths->begin();
942 i != icPaths->end(); ++i) {
945 if (fBusName !=
"" && fBusName != (i->bus()).name()) {
966 "Implementation information missing for function unit "
967 "'%s'.") % fu.
name()).str());
993 "Implementation information missing for register file "
994 "'%s'.") % rf.
name()).str());
997 &sourcePort) != NULL) {
1002 __FILE__, __LINE__,
__func__,
"Unsupported port type.");
1023 "Implementation information missing for function "
1024 "unit '%s'.") % fu.
name()).str());
1042 "Implementation information missing for register file "
1043 "'%s'.") % rf.
name()).str());
1051 &destinationPort) != NULL) {
1056 __FILE__, __LINE__,
__func__,
"Unsupported port type.");
1065 "Missing IC&decoder plugin information.");
1073 sourceSocketImplementation =
1076 sourceSocketImplementation =
1084 destinationSocketImplementation =
1087 destinationSocketImplementation =
1106 machineImplementation,
1107 *sourceSocketImplementation,
1109 *destinationSocketImplementation);
1112 pathDelay = readDelay + busDelay + writeDelay;
1114 maximumICDelay = std::max(maximumICDelay, pathDelay);
1116#ifdef LONGEST_PATH_DEBUGGING
1120 << sourcePort.
name() <<
" (" << readDelay <<
"), "
1121 << bus.
name() <<
" (" << busDelay <<
"), "
1123 << destinationPort.
name() <<
" (" << writeDelay <<
") = "
1124 << pathDelay << std::endl;
1135 for (
int i = 0; i < fuNav.
count(); ++i) {
1142 "Implementation information missing for function unit "
1143 "'%s'.") % fu.
name()).str());
1148 maximumFUDelay = std::max(maximumFUDelay, delay);
1150#ifdef LONGEST_PATH_DEBUGGING
1152 <<
"maximum computation delay of " << fu.
name() <<
" = "
1153 << delay <<
" ns" << std::endl;
1189 for (
int i = 0; i < rfNav.
count(); ++i) {
1196 "Implementation information missing for register file "
1197 "'%s'.") % rf.
name()).str());
1204 maximumRFDelay = std::max(maximumRFDelay, delay);
1206#ifdef LONGEST_PATH_DEBUGGING
1208 <<
"maximum computation delay of " << rf.
name() <<
" = "
1209 << delay <<
" ns" << std::endl;
1216 return std::max(maximumICDelay, std::max(maximumFUDelay, maximumRFDelay));
1232 for (
int bi = 0; bi < busNav.
count(); ++bi) {
1233 typedef std::set<const TTAMachine::Socket*> SocketSet;
1234 SocketSet outputSockets, inputSockets;
1240 "Segmented buses not supported yet.");
1249 inputSockets.insert(&socket);
1251 outputSockets.insert(&socket);
1255 "Unsupported socket direction.");
1259 for (SocketSet::iterator osi = outputSockets.begin();
1260 osi != outputSockets.end(); ++osi) {
1264 for (
int opi = 0; opi < outputSocket.
portCount(); ++opi) {
1268 for (SocketSet::iterator isi = inputSockets.begin();
1269 isi != inputSockets.end(); ++isi) {
1273 for (
int ipi = 0; ipi < inputSocket.
portCount(); ++ipi) {
1277 outputPort, outputSocket, bus, inputSocket,
1279 paths->push_back(path);
1283 <<
"::" << outputPort.
name() <<
", "
1284 << outputSocket.
name() <<
", "
1285 << bus.
name() <<
", "
1286 << inputSocket.
name() <<
", "
1288 <<
"::" << inputPort.
name() <<
"}" << std::endl;
1317 const std::string pluginPath,
const std::string pluginName,
1328 pluginPath, pluginName);
1332 sourceSocketImplementation,
1333 busImplementation, destinationSocketImplementation, delay)) {
1337 "The IC&decoder estimator plugin '%s' could not estimate "
1338 "delay of a path.") % pluginName).str());
1343 std::string(
"Error while using ICDecoder estimation plugin. ") +
TTAMachine::Machine * machine
the architecture definition of the estimated processor
find Finds info of the inner loops in the program
static std::ostream & warningStream()
static int verboseLevel()
static std::ostream & logStream()
T & plugin(const std::string &pluginFileName, const std::string &pluginName)
AreaInGates icArea(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
FUCostEstimationPluginRegistry fuEstimatorPluginRegistry_
all accessed FU estimation plugins are stored in this registry
FUCostEstimationPlugin & fuCostFunctionPluginOfImplementation(const IDF::FUImplementationLocation &implementation)
AreaInGates totalAreaOfFunctionUnits(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
EnergyInMilliJoules registerFileEnergy(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
AreaInGates totalAreaOfRegisterFiles(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
EnergyInMilliJoules totalEnergyOfFunctionUnits(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
ICDecoderCostEstimationPluginRegistry icDecoderEstimatorPluginRegistry_
all accessed IC&decoder plugins are stored in this registry
EnergyInMilliJoules icEnergy(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
RFCostEstimationPluginRegistry rfEstimatorPluginRegistry_
all accessed RF estimation plugins are stored in this registry
AreaInGates totalArea(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
area estimation functions
EnergyInMilliJoules totalEnergy(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
energy estimation functions
static TransportPathList * findAllICPaths(const TTAMachine::Machine &machine)
DelayInNanoSeconds registerFileMaximumComputationDelay(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry)
DelayInNanoSeconds functionUnitMaximumComputationDelay(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementation)
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)
DelayInNanoSeconds registerFilePortWriteDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementationEntry)
DelayInNanoSeconds longestPath(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation)
delay estimation functions
EnergyInMilliJoules totalEnergyOfRegisterFiles(const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
AreaInGates registerFileArea(const TTAMachine::BaseRegisterFile &architecture, const IDF::RFImplementationLocation &implementationEntry)
AreaInGates functionUnitArea(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementationEntry)
DelayInNanoSeconds functionUnitPortReadDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementationEntry)
RFCostEstimationPlugin & rfCostFunctionPluginOfImplementation(const IDF::RFImplementationLocation &implementation)
DelayInNanoSeconds registerFilePortReadDelay(const TTAMachine::RFPort &port, const IDF::RFImplementationLocation &implementationEntry)
DelayInNanoSeconds functionUnitPortWriteDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &implementationEntry)
EnergyInMilliJoules functionUnitEnergy(const TTAMachine::FunctionUnit &architecture, const IDF::FUImplementationLocation &implementationEntry, const TTAProgram::Program &program, const ExecutionTrace &traceDB)
virtual bool estimateICDelayOfPath(HDB::HDBRegistry &hdbRegistry, const TransportPath &path, const IDF::MachineImplementation &machineImplementation, const IDF::SocketImplementationLocation &sourceSocketImplementation, const IDF::BusImplementationLocation &busImplementation, const IDF::SocketImplementationLocation &destinationSocketImplementation, DelayInNanoSeconds &delay)
virtual bool estimateICEnergy(HDB::HDBRegistry &hdbRegistry, const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, const TTAProgram::Program &program, const ExecutionTrace &traceDB, EnergyInMilliJoules &energy)
virtual bool estimateICArea(HDB::HDBRegistry &hdbRegistry, const TTAMachine::Machine &machine, const IDF::MachineImplementation &machineImplementation, AreaInGates &area)
const TTAMachine::Bus & bus() const
const TTAMachine::Port & destinationPort() const
const TTAMachine::Socket & sourceSocket() const
const TTAMachine::Port & sourcePort() const
const TTAMachine::Socket & destinationSocket() const
std::string errorMessage() const
std::string pluginFilePath() const
bool hasCostFunction() const
CostFunctionPlugin & costFunction() const
FUEntry * fuByEntryID(RowID id) const
RFEntry * rfByEntryID(RowID id) const
static HDBRegistry & instance()
CachedHDBManager & hdb(const std::string fileName)
bool hasICDecoderPluginName() const
BusImplementationLocation & busImplementation(const std::string &bus) const
std::string icDecoderPluginName() const
SocketImplementationLocation & socketImplementation(const std::string &socket) const
RFImplementationLocation & iuImplementation(const std::string &iu) const
RFImplementationLocation & rfImplementation(const std::string &rf) const
bool hasIUImplementation(const std::string &unitName) const
FUImplementationLocation & fuImplementation(const std::string &fu) const
std::string icDecoderPluginFile() const
bool hasRFImplementation(const std::string &unitName) const
bool hasBusImplementation(const std::string &busName) const
bool hasSocketImplementation(const std::string &socketName) const
bool hasICDecoderPluginFile() const
bool hasICDecoderHDB() const
bool hasFUImplementation(const std::string &unitName) const
static NullUnitImplementationLocation & instance()
virtual std::string hdbFile() const
FunctionUnit * parentUnit() const
virtual Segment * segment(int index) const
virtual int segmentCount() const
virtual TCEString name() const
ComponentType * item(int index) const
virtual RegisterFileNavigator registerFileNavigator() const
virtual FunctionUnitNavigator functionUnitNavigator() const
virtual SocketNavigator socketNavigator() const
virtual BusNavigator busNavigator() const
Unit * parentUnit() const
virtual std::string name() const
BaseRegisterFile * parentUnit() const
const Connection & connection(const Socket &socket) const
int connectionCount() const
@ OUTPUT
Data goes from port to bus.
@ INPUT
Data goes from bus to port.
Direction direction() const
Port * port(int index) const
double AreaInGates
type for area values in equivalent gates
std::list< TransportPath > TransportPathList
double DelayInNanoSeconds
type for propagation delays in nano seconds
double EnergyInMilliJoules
type for consumed energy in milli joules