73 "FU cost estimator plugin that estimates costs of FUs by generating"
74 "cost database from cost values of HDB and uses interpolation to "
75 "estimate the costs. In case there's no cost data available for the "
76 "given FU the plugin interpolates the estimate if possible.");
94 CostDBTypes::EntryTable::const_iterator i = results.begin();
97 for (;i < results.end(); i++) {
98 for (
int n = 0; n < (*i)->statisticsCount(); n++) {
99 if (area < (*i)->statistics(n).area()) {
100 area = (*i)->statistics(n).area();
107#ifdef DEBUG_AREA_ESTIMATION
109 << fu.
name() <<
" area " << area << std::endl;
134 CostDBTypes::EntryTable::const_iterator i = results.begin();
137 for (;i < results.end(); i++) {
138 for (
int n = 0; n < (*i)->statisticsCount(); n++) {
139#ifndef UNIQUE_PORT_DELAY
140 if (delay < (*i)->statistics(n).delayPort(
"input_delay")) {
141 delay = (*i)->statistics(n).delayPort(
"input_delay");
144#ifdef UNIQUE_PORT_DELAY
147 if (delay < (*i)->statistics(n).delayPort(port.
name())) {
148 delay = (*i)->statistics(n).delayPort(port.
name());
154#ifdef DEBUG_DELAY_ESTIMATION
158 <<
" found in HDB." << std::endl;
162#ifdef DEBUG_DELAY_ESTIMATION
164 << port.
name() <<
" (port) delay " << delay << std::endl;
187 CostDBTypes::EntryTable::const_iterator i = results.begin();
190 for (;i < results.end(); i++) {
191 for (
int n = 0; n < (*i)->statisticsCount(); n++) {
192#ifndef UNIQUE_PORT_DELAY
193 if (delay < (*i)->statistics(n).delayPort(
"output_delay")) {
194 delay = (*i)->statistics(n).delayPort(
"output_delay");
197#ifdef UNIQUE_PORT_DELAY
200 if (delay < (*i)->statistics(n).delayPort(port.
name())) {
201 delay = (*i)->statistics(n).delayPort(port.
name());
207#ifdef DEBUG_DELAY_ESTIMATION
211 <<
" found in HDB." << std::endl;
215#ifdef DEBUG_DELAY_ESTIMATION
217 << port.
name() <<
" (port) delay " << delay << std::endl;
236 CostDBTypes::EntryTable::const_iterator i = results.begin();
239 for (;i < results.end(); i++) {
240 for (
int n = 0; n < (*i)->statisticsCount(); n++) {
241 if (delay < (*i)->statistics(n).delay()) {
242 delay = (*i)->statistics(n).delay();
249#ifdef DEBUG_DELAY_ESTIMATION
251 << fu.
name() <<
" computation delay " << delay << std::endl;
278#ifdef DEBUG_ENERGY_ESTIMATION
280 <<
"## function unit " << fu.
name() <<
": " << std::endl;
285 const_iterator i = operationTriggers->begin();
286 i != operationTriggers->end(); ++i) {
295 triggerCount.get<1>();
297 const std::string dataName =
298 std::string(
"operation_execution_energy ") + operation;
301 CostDBTypes::EntryTable::const_iterator i = results.begin();
302 for (;i < results.end(); i++) {
308 for (
int n = 0; n < (*i)->statisticsCount(); n++) {
309 if (((*i)->statistics(n).energyOperation(
310 operation) * count) > tempEnergy) {
313 (*i)->statistics(n).energyOperation(
316#ifdef DEBUG_ENERGY_ESTIMATION
319 <<
" NOTE: Multiple fu execution energy"
321 <<
" operation: " << operation
323 << (*i)->statistics(n).energyOperation(
329 energy += tempEnergy;
331 cyclesWithFUAccess += count;
334 delete operationTriggers;
335 operationTriggers = NULL;
337 <<
"Cost estimation data '" << dataName
338 <<
"' not found in HDB." << std::endl;
341 delete operationTriggers;
342 operationTriggers = NULL;
348 delete operationTriggers;
349 operationTriggers = NULL;
354 const std::string dataName = std::string(
"fu_idle_energy");
357 CostDBTypes::EntryTable::const_iterator i = results.begin();
358 for (;i < results.end(); i++) {
364 for (
int n = 0; n < (*i)->statisticsCount(); n++) {
365 if (((*i)->statistics(n).energyIdle() * idleCycles) >
369 (*i)->statistics(n).energyIdle() * idleCycles;
371#ifdef DEBUG_ENERGY_ESTIMATION
374 <<
" NOTE: Multiple fu idle energy results found!"
375 << (*i)->statistics(n).energyIdle()
380 energy += tempEnergy;
385 <<
"Cost estimation data '" << dataName
387 <<
" not found in HDB." << std::endl;
458 for (
int n = 0; n < ports; n++) {
460 if (
dynamic_cast<FUPort*
>(port) != NULL) {
463 width = fuPort->
width();
464 }
else if (width != fuPort->
width()) {
ExecutionTrace * trace
the execution trace database
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
#define EXPORT_FU_COST_ESTIMATOR_PLUGIN(PLUGIN_NAME__)
CycleCount ClockCycleCount
Alias for ClockCycleCount.
static std::ostream & logStream()
void addField(EntryKeyField *field)
static const std::string EK_UNIT
Entry type for function units.
std::vector< MatchType * > MatchTypeTable
Table of types of match.
static const std::string EKF_FUNCTION_UNIT
Field type for function unit entry;.
std::vector< CostDBEntry * > EntryTable
Table of database entries.
static const std::string EKF_BIT_WIDTH
Field type for bit width of an entry.
static CostDatabaseRegistry & instance()
CostDatabase & costDatabase(const HDB::HDBManager &hdb)
void setSearchStrategy(SearchStrategy *strategy)
CostDBTypes::EntryTable search(const CostDBEntryKey &searchKey, const CostDBTypes::MatchTypeTable &match) const
virtual std::string name() const
static EntryKeyProperty * find(std::string type)
EntryKeyFieldProperty * fieldProperty(std::string field) const
std::string errorMessage() const
std::string OperationID
a type for storing operation identifiers
ClockCycleCount OperationTriggerCount
a type for operation trigger counts
ClockCycleCount simulatedCycleCount() const
std::list< FUOperationTriggerCount > FUOperationTriggerCountList
type to be used for lists of function operation execution counts
FUOperationTriggerCountList * functionUnitOperationTriggerCounts(FunctionUnitID functionUnit) const
boost::tuple< OperationID, OperationTriggerCount > FUOperationTriggerCount
type to be used as a key for storing function unit operation execution counts
void initializeEstimator(const HDBManager &hdb)
virtual bool estimateEnergy(const TTAMachine::FunctionUnit &fu, const IDF::FUImplementationLocation &implementation, const TTAProgram::Program &, const ExecutionTrace &trace, EnergyInMilliJoules &energy, HDB::HDBManager &hdb)
bool estimateArea(const TTAMachine::FunctionUnit &fu, const IDF::FUImplementationLocation &, AreaInGates &area, HDB::HDBManager &hdb)
DESCRIPTION("FU cost estimator plugin that estimates costs of FUs by generating" "cost database from cost values of HDB and uses interpolation to " "estimate the costs. In case there's no cost data available for the " "given FU the plugin interpolates the estimate if possible.")
MatchTypeMap searchTypes_
Types of matches used for searching entries from the cost database.
CostDatabase * costdb_
Cost database being used.
bool estimatePortReadDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &, DelayInNanoSeconds &delay, HDB::HDBManager &hdb)
EntryKeyProperty * unitProperty_
Entry key property of function unit.
virtual ~InterpolatingFUEstimator()
bool estimateMaximumComputationDelay(const TTAMachine::FunctionUnit &fu, const IDF::FUImplementationLocation &, DelayInNanoSeconds &delay, HDB::HDBManager &hdb)
std::map< const EntryKeyProperty *, CostDBTypes::MatchTypeTable > MatchTypeMap
Search type for each entry type.
bool estimatePortWriteDelay(const TTAMachine::FUPort &port, const IDF::FUImplementationLocation &, DelayInNanoSeconds &delay, HDB::HDBManager &hdb)
SearchStrategy * strategy_
Search strategy to be used with the cost database.
CostDatabaseRegistry * costDatabaseRegistry_
Registry of cost databases.
CostDBTypes::EntryTable createSearch(const FunctionUnit &fu) const
CostDBTypes::MatchTypeTable unitMatchType_
Table of types of match.
InterpolatingFUEstimator(const std::string &name)
FunctionUnit * parentUnit() const
virtual int width() const
virtual TCEString name() const
virtual int operationPortCount() const
virtual BaseFUPort * port(const std::string &name) const
virtual std::string name() const
double AreaInGates
type for area values in equivalent gates
double DelayInNanoSeconds
type for propagation delays in nano seconds
double EnergyInMilliJoules
type for consumed energy in milli joules