OpenASIP
2.0
|
#include <CostDBEntryStats.hh>
Public Member Functions | |
CostDBEntryStats (double areaData, double internalDelayData) | |
virtual | ~CostDBEntryStats () |
CostDBEntryStats (const CostDBEntryStats &stats1, const CostDBEntryStats &stats2, double coefficient) | |
virtual CostDBEntryStats * | copy () const |
virtual double | area () const |
virtual double | delay () const |
virtual double | delayPort (const std::string &port) const |
virtual void | setDelay (const std::string &port, double delay) |
virtual double | energyActive () const |
virtual double | energyIdle () const |
virtual double | energyOperation (const std::string &name) const |
virtual bool | hasEnergyOperation (const std::string &name) const |
virtual double | energyRead () const |
virtual double | energyWrite () const |
virtual double | energyReadWrite (int reads, int writes) const |
virtual void | setEnergyActive (double energy) |
virtual void | setEnergyIdle (double energy) |
virtual void | setEnergyOperation (const std::string &name, double energy) |
virtual void | setEnergyRead (double energy) |
virtual void | setEnergyWrite (double energy) |
virtual void | setEnergyReadWrite (int reads, int writes, double energy) |
Protected Member Functions | |
virtual bool | hasEnergy (const std::string &key) const |
virtual double | findEnergy (const std::string &key) const |
virtual void | addEnergy (const std::string &name, double energy) |
virtual bool | hasDelay (const std::string &key) const |
virtual double | findDelay (const std::string &key) const |
virtual void | addDelay (const std::string &name, double delay) |
virtual CostDBEntryStats * | createStats () const |
Static Protected Attributes | |
static const std::string | ENERGY_ACTIVE = "(active)" |
String for active energy. More... | |
static const std::string | ENERGY_IDLE = "(idle)" |
String for idle energy. More... | |
static const std::string | ENERGY_READ = "(read)" |
String for read energy. More... | |
static const std::string | ENERGY_WRITE = "(write)" |
String for write energy. More... | |
static const std::string | ENERGY_READ_WRITE = "(rd,wr)" |
String for reads and writes energy. More... | |
Private Types | |
typedef std::map< const std::string, double > | EnergyMap |
Map of energies. More... | |
typedef std::map< const std::string, double > | DelayMap |
Map of delays. More... | |
Private Member Functions | |
CostDBEntryStats (const CostDBEntryStats &) | |
Copying not allowed. More... | |
CostDBEntryStats & | operator= (const CostDBEntryStats &) |
Assignment not allowed. More... | |
Private Attributes | |
double | area_ |
area in gates. More... | |
double | delay_ |
delay in nanoseconds. More... | |
DelayMap | delays_ |
input and output delays in nanoseconds. More... | |
EnergyMap | energies_ |
Energies of one specific type of usage of a resource. Usually the map contains energies for active and idle usage of a resource. However, in case of FUs the active energy does not exist and but energies are defined for each operation. More... | |
Stores area, delay and energy statistics.
Definition at line 46 of file CostDBEntryStats.hh.
|
private |
Map of delays.
Definition at line 100 of file CostDBEntryStats.hh.
|
private |
Map of energies.
Definition at line 98 of file CostDBEntryStats.hh.
CostDBEntryStats::CostDBEntryStats | ( | double | areaData, |
double | internalDelayData | ||
) |
Constructor.
areaData | area. |
internalDelayData | Components internal delay. |
Definition at line 58 of file CostDBEntryStats.cc.
Referenced by createStats().
|
virtual |
CostDBEntryStats::CostDBEntryStats | ( | const CostDBEntryStats & | stats1, |
const CostDBEntryStats & | stats2, | ||
double | coefficient | ||
) |
Constructor.
Combines two statistics into one using coefficient as a weighting factor on interpolating the statistics. For example, if weighting factor is 0.4, the first area 100 and the second 200, area of new statistics will be 140. delay and energy will be handled similarly.
stats1 | First statistics. |
stats2 | Second statistics. |
coefficient | Weighting factor. |
KeyNotFound | Thrown in case that the two statistics won't contain equal keys. |
Definition at line 76 of file CostDBEntryStats.cc.
References addDelay(), addEnergy(), area(), area_, delay(), delay_, delays_, energies_, findDelay(), and findEnergy().
|
private |
Copying not allowed.
|
protectedvirtual |
Set the delay of an entry for a given key.
Removes the old value.
key | The key. |
delay | The delay of an entry for a given key. |
Definition at line 477 of file CostDBEntryStats.cc.
References delay(), and delays_.
Referenced by CostDBEntryStats(), and setDelay().
|
protectedvirtual |
Set the energy of an entry for a given key.
Removes the old value.
key | The key. |
energy | The energy of an entry for a given key. |
Definition at line 413 of file CostDBEntryStats.cc.
References energies_.
Referenced by copy(), CostDBEntryStats(), setEnergyActive(), setEnergyIdle(), CostDBEntryStatsFU::setEnergyOperation(), CostDBEntryStatsRF::setEnergyRead(), CostDBEntryStatsRF::setEnergyReadWrite(), and CostDBEntryStatsRF::setEnergyWrite().
|
virtual |
Referenced by CostDBEntryStats(), CostDBEntryStatsFU::createStats(), CostDBEntryStatsRF::createStats(), and createStats().
|
virtual |
Returns the copy of the statistics.
Definition at line 153 of file CostDBEntryStats.cc.
References addEnergy(), createStats(), delays_, energies_, and setDelay().
Referenced by CostDatabase::insertEntry().
|
protectedvirtual |
Create correct type of statistics.
Reimplemented in CostDBEntryStatsRF, and CostDBEntryStatsFU.
Definition at line 177 of file CostDBEntryStats.cc.
References area(), CostDBEntryStats(), and delay().
Referenced by copy().
|
virtual |
|
virtual |
Returns the delay of given port is usage an an input/output.
port | The name of the port. |
WrongSubclass | Never thrown by this function. |
KeyNotFound | Thrown if delay for given port is not set. |
Definition at line 434 of file CostDBEntryStats.cc.
References findDelay().
|
virtual |
Returns the energy of an entry in an active cycle.
WrongSubclass | Never thrown. |
KeyNotFound | Thrown if active energy is not set. |
Reimplemented in CostDBEntryStatsRF, and CostDBEntryStatsFU.
Definition at line 190 of file CostDBEntryStats.cc.
References ENERGY_ACTIVE, and findEnergy().
|
virtual |
Returns the energy of an entry in an idle cycle.
WrongSubclass | Never thrown by this function. |
KeyNotFound | Thrown if idle enrgy is not set. |
Definition at line 202 of file CostDBEntryStats.cc.
References ENERGY_IDLE, and findEnergy().
|
virtual |
Returns the energy of an entry when given operation is executed.
The function will fail since this class should be used for entries which do not have operation set as a search key.
name | The name of the operation. |
WrongSubclass | An illegal function was called for this instance. |
KeyNotFound | No energy matching the string found. |
Reimplemented in CostDBEntryStatsFU.
Definition at line 219 of file CostDBEntryStats.cc.
|
virtual |
Returns the read energy of an entry.
WrongSubclass | An illegal function was called for this instance. |
KeyNotFound | Never thrown by this function. |
Reimplemented in CostDBEntryStatsRF.
Definition at line 249 of file CostDBEntryStats.cc.
|
virtual |
Returns the reads and writes energy of an entry.
reads | The number of simultaneus reads done for the unit. |
writes | The number of simultaneus writes done for the unit. |
WrongSubclass | An illegal function was called for this instance. |
KeyNotFound | Never thrown by this function. |
Reimplemented in CostDBEntryStatsRF.
Definition at line 281 of file CostDBEntryStats.cc.
|
virtual |
Returns the write energy of an entry.
WrongSubclass | An illegal function was called for this instance. |
KeyNotFound | Never thrown by this function. |
Reimplemented in CostDBEntryStatsRF.
Definition at line 264 of file CostDBEntryStats.cc.
|
protectedvirtual |
Returns the input/output delay of an entry usign given key as an input/output port.
key | The key. |
KeyNotFound | Requested key was not found. |
Definition at line 459 of file CostDBEntryStats.cc.
References delays_.
Referenced by CostDBEntryStats(), and delayPort().
|
protectedvirtual |
Returns the energy of an entry for a given key.
key | The key. |
KeyNotFound | Requested key was not found. |
Definition at line 308 of file CostDBEntryStats.cc.
References energies_.
Referenced by CostDBEntryStats(), energyActive(), energyIdle(), CostDBEntryStatsFU::energyOperation(), CostDBEntryStatsRF::energyRead(), CostDBEntryStatsRF::energyReadWrite(), and CostDBEntryStatsRF::energyWrite().
|
protectedvirtual |
Checks whether the delay exists for a given key.
key | The key. |
Definition at line 496 of file CostDBEntryStats.cc.
References delays_.
|
protectedvirtual |
Checks whether the energy exists for a given key.
key | The key. |
Definition at line 294 of file CostDBEntryStats.cc.
References energies_.
Referenced by CostDBEntryStatsFU::hasEnergyOperation().
|
virtual |
Checks whether the energy exists for the given operation.
name | name of the operation. |
WrongSubclass | An illegal function was called for this instance. |
Reimplemented in CostDBEntryStatsFU.
Definition at line 234 of file CostDBEntryStats.cc.
|
private |
Assignment not allowed.
|
virtual |
Set the delay of an input/output port usage.
port | Name of the input/output port. |
delay | The delay of an input/ouput when using the given port. |
WrongSubclass | Never thrown by this function. |
Definition at line 446 of file CostDBEntryStats.cc.
References addDelay(), and delay().
Referenced by CostDatabase::buildFunctionUnits(), CostDatabase::buildRegisterFiles(), CostDatabase::buildSockets(), and copy().
|
virtual |
Set the energy of an entry in an active cycle.
energy | The energy of an entry in an active cycle. |
WrongSubclass | Never thrown by this function. |
Reimplemented in CostDBEntryStatsRF, and CostDBEntryStatsFU.
Definition at line 323 of file CostDBEntryStats.cc.
References addEnergy(), energies_, and ENERGY_ACTIVE.
Referenced by CostDatabase::buildBuses(), and CostDatabase::buildSockets().
|
virtual |
Set the energy of an entry in an idle cycle.
energy | The energy of an entry in an idle cycle. |
WrongSubclass | Never thrown by this function. |
Definition at line 338 of file CostDBEntryStats.cc.
References addEnergy(), energies_, and ENERGY_IDLE.
Referenced by CostDatabase::buildBuses(), CostDatabase::buildFunctionUnits(), CostDatabase::buildRegisterFiles(), and CostDatabase::buildSockets().
|
virtual |
Set the energy of an entry when given operation is executed.
The function will fail since this class should be used for entries which do not have operation set as a search key.
name | name of the operation. |
energy | The energy of an entry when given operation is executed. |
WrongSubclass | An illegal function was called for this instance. |
Reimplemented in CostDBEntryStatsFU.
Definition at line 358 of file CostDBEntryStats.cc.
|
virtual |
Set the read energy of an entry.
energy | The read energy of an entry. |
WrongSubclass | An illegal function was called for this instance. |
Reimplemented in CostDBEntryStatsRF.
Definition at line 371 of file CostDBEntryStats.cc.
|
virtual |
Set the reads and writes energy of an entry.
energy | The reads and writes energy of an entry. |
reads | The number of reads of the unit. |
writes | The number of writes of the unit. |
WrongSubclass | An illegal function was called for this instance. |
Reimplemented in CostDBEntryStatsRF.
Definition at line 399 of file CostDBEntryStats.cc.
|
virtual |
Set the write energy of an entry.
energy | The write energy of an entry. |
WrongSubclass | An illegal function was called for this instance. |
Reimplemented in CostDBEntryStatsRF.
Definition at line 384 of file CostDBEntryStats.cc.
|
private |
area in gates.
Definition at line 103 of file CostDBEntryStats.hh.
Referenced by CostDBEntryStats().
|
private |
delay in nanoseconds.
Definition at line 105 of file CostDBEntryStats.hh.
Referenced by CostDBEntryStats().
|
private |
input and output delays in nanoseconds.
Definition at line 107 of file CostDBEntryStats.hh.
Referenced by addDelay(), copy(), CostDBEntryStats(), findDelay(), and hasDelay().
|
private |
Energies of one specific type of usage of a resource. Usually the map contains energies for active and idle usage of a resource. However, in case of FUs the active energy does not exist and but energies are defined for each operation.
Definition at line 112 of file CostDBEntryStats.hh.
Referenced by addEnergy(), copy(), CostDBEntryStats(), findEnergy(), hasEnergy(), setEnergyActive(), and setEnergyIdle().
|
staticprotected |
String for active energy.
Definition at line 86 of file CostDBEntryStats.hh.
Referenced by energyActive(), and setEnergyActive().
|
staticprotected |
String for idle energy.
Definition at line 88 of file CostDBEntryStats.hh.
Referenced by energyIdle(), and setEnergyIdle().
|
staticprotected |
String for read energy.
Definition at line 90 of file CostDBEntryStats.hh.
Referenced by CostDBEntryStatsRF::energyRead(), and CostDBEntryStatsRF::setEnergyRead().
|
staticprotected |
String for reads and writes energy.
Definition at line 94 of file CostDBEntryStats.hh.
Referenced by CostDBEntryStatsRF::generateReadWriteString().
|
staticprotected |
String for write energy.
Definition at line 92 of file CostDBEntryStats.hh.
Referenced by CostDBEntryStatsRF::energyWrite(), and CostDBEntryStatsRF::setEnergyWrite().