OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
CostDBEntryStatsFU Class Reference

#include <CostDBEntryStatsFU.hh>

Inheritance diagram for CostDBEntryStatsFU:
Inheritance graph
Collaboration diagram for CostDBEntryStatsFU:
Collaboration graph

Public Member Functions

 CostDBEntryStatsFU (double areaData, double delayData)
 
virtual ~CostDBEntryStatsFU ()
 
 CostDBEntryStatsFU (const CostDBEntryStatsFU &stats1, const CostDBEntryStatsFU &stats2, double coefficient)
 
virtual double energyActive () const
 
virtual double energyOperation (const std::string &name) const
 
virtual bool hasEnergyOperation (const std::string &name) const
 
virtual void setEnergyActive (double energy)
 
virtual void setEnergyOperation (const std::string &name, double energy)
 
- Public Member Functions inherited from CostDBEntryStats
 CostDBEntryStats (double areaData, double internalDelayData)
 
virtual ~CostDBEntryStats ()
 
 CostDBEntryStats (const CostDBEntryStats &stats1, const CostDBEntryStats &stats2, double coefficient)
 
virtual CostDBEntryStatscopy () 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 energyIdle () const
 
virtual double energyRead () const
 
virtual double energyWrite () const
 
virtual double energyReadWrite (int reads, int writes) const
 
virtual void setEnergyIdle (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 CostDBEntryStatscreateStats () const
 
- Protected Member Functions inherited from CostDBEntryStats
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)
 

Private Member Functions

 CostDBEntryStatsFU (const CostDBEntryStatsFU &)
 Copying not allowed. More...
 
CostDBEntryStatsFUoperator= (const CostDBEntryStatsFU &)
 Assignment not allowed. More...
 

Additional Inherited Members

- Static Protected Attributes inherited from CostDBEntryStats
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...
 

Detailed Description

Stores area, delay and energy statistics of function units.

Definition at line 44 of file CostDBEntryStatsFU.hh.

Constructor & Destructor Documentation

◆ CostDBEntryStatsFU() [1/3]

CostDBEntryStatsFU::CostDBEntryStatsFU ( double  areaData,
double  delayData 
)

Constructor.

Parameters
areaDataarea.
delayDatadelay.

Definition at line 48 of file CostDBEntryStatsFU.cc.

48  :
49  CostDBEntryStats(areaData, delayData) {
50 }

Referenced by createStats().

◆ ~CostDBEntryStatsFU()

CostDBEntryStatsFU::~CostDBEntryStatsFU ( )
virtual

Destructor.

Definition at line 75 of file CostDBEntryStatsFU.cc.

75  {
76 }

◆ CostDBEntryStatsFU() [2/3]

CostDBEntryStatsFU::CostDBEntryStatsFU ( const CostDBEntryStatsFU stats1,
const CostDBEntryStatsFU 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.

Parameters
stats1First statistics.
stats2Second statistics.
coefficientWeighting factor.

Definition at line 64 of file CostDBEntryStatsFU.cc.

67  :
68  CostDBEntryStats(stats1, stats2, coefficient) {
69 }

◆ CostDBEntryStatsFU() [3/3]

CostDBEntryStatsFU::CostDBEntryStatsFU ( const CostDBEntryStatsFU )
private

Copying not allowed.

Member Function Documentation

◆ createStats()

CostDBEntryStats * CostDBEntryStatsFU::createStats ( ) const
protectedvirtual

Create correct type of statistics.

Returns
Correct type of statistics.

Reimplemented from CostDBEntryStats.

Definition at line 84 of file CostDBEntryStatsFU.cc.

84  {
85  return new CostDBEntryStatsFU(area(), delay());
86 }

References CostDBEntryStats::area(), CostDBEntryStatsFU(), and CostDBEntryStats::delay().

Here is the call graph for this function:

◆ energyActive()

double CostDBEntryStatsFU::energyActive ( ) const
virtual

Returns the energy of an entry in an active cycle.

The function will fail since function units do not have unambiguous energy for the whole unit but separately for each operation.

Returns
The energy of an entry in an active cycle.
Exceptions
WrongSubclassAn illegal function was called for this instance.
KeyNotFoundNever thrown by this function.

Reimplemented from CostDBEntryStats.

Definition at line 100 of file CostDBEntryStatsFU.cc.

100  {
101  throw WrongSubclass(__FILE__, __LINE__,
102  "CostDBEntryStatsFU::energyActive");
103  return 0.0; // stupid return statement to make compiler quiet
104 }

◆ energyOperation()

double CostDBEntryStatsFU::energyOperation ( const std::string &  name) const
virtual

Returns the energy of an entry when given operation is executed.

Parameters
namename of the operation.
Returns
The energy of an entry when given operation is executed.
Exceptions
WrongSubclassNever thrown by this function.
KeyNotFoundNo energy matching the string found.

Reimplemented from CostDBEntryStats.

Definition at line 115 of file CostDBEntryStatsFU.cc.

115  {
116  return findEnergy(name);
117 }

References CostDBEntryStats::findEnergy().

Here is the call graph for this function:

◆ hasEnergyOperation()

bool CostDBEntryStatsFU::hasEnergyOperation ( const std::string &  name) const
virtual

Checks whether the energy exists for the given operation.

Parameters
namename of the operation.
Returns
True if the energy exists for the given operation.
Exceptions
WrongSubclassNever thrown by this function.

Reimplemented from CostDBEntryStats.

Definition at line 127 of file CostDBEntryStatsFU.cc.

127  {
128  return hasEnergy(name);
129 }

References CostDBEntryStats::hasEnergy().

Here is the call graph for this function:

◆ operator=()

CostDBEntryStatsFU& CostDBEntryStatsFU::operator= ( const CostDBEntryStatsFU )
private

Assignment not allowed.

◆ setEnergyActive()

void CostDBEntryStatsFU::setEnergyActive ( double  energy)
virtual

Set the energy of an entry in an active cycle.

The function will fail since function units do not have unambiguous energy for the whole unit but separately for each operation.

Parameters
energyThe energy of an entry in an active cycle.
Exceptions
WrongSubclassAn illegal function was called for this instance.

Reimplemented from CostDBEntryStats.

Definition at line 142 of file CostDBEntryStatsFU.cc.

142  {
143  throw WrongSubclass(__FILE__, __LINE__,
144  "CostDBEntryStatsFU::setEnergyActive");
145 }

◆ setEnergyOperation()

void CostDBEntryStatsFU::setEnergyOperation ( const std::string &  name,
double  energy 
)
virtual

Set the energy of an entry when given operation is executed.

Parameters
namename of the operation.
energyThe energy of an entry when given operation is executed.
Exceptions
WrongSubclassNever thrown by this function.

Reimplemented from CostDBEntryStats.

Definition at line 155 of file CostDBEntryStatsFU.cc.

155  {
156  addEnergy(name, energy);
157 }

References CostDBEntryStats::addEnergy().

Referenced by CostDatabase::buildFunctionUnits().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
CostDBEntryStats::hasEnergy
virtual bool hasEnergy(const std::string &key) const
Definition: CostDBEntryStats.cc:294
CostDBEntryStats::delay
virtual double delay() const
WrongSubclass
Definition: Exception.hh:336
CostDBEntryStats::area
virtual double area() const
CostDBEntryStats::addEnergy
virtual void addEnergy(const std::string &name, double energy)
Definition: CostDBEntryStats.cc:413
CostDBEntryStatsFU::CostDBEntryStatsFU
CostDBEntryStatsFU(double areaData, double delayData)
Definition: CostDBEntryStatsFU.cc:48
CostDBEntryStats::findEnergy
virtual double findEnergy(const std::string &key) const
Definition: CostDBEntryStats.cc:308
CostDBEntryStats::CostDBEntryStats
CostDBEntryStats(double areaData, double internalDelayData)
Definition: CostDBEntryStats.cc:58