OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
CostDBEntryStatsRF Class Reference

#include <CostDBEntryStatsRF.hh>

Inheritance diagram for CostDBEntryStatsRF:
Inheritance graph
Collaboration diagram for CostDBEntryStatsRF:
Collaboration graph

Public Member Functions

 CostDBEntryStatsRF (double areaData, double delayData)
 
virtual ~CostDBEntryStatsRF ()
 
 CostDBEntryStatsRF (const CostDBEntryStatsRF &stats1, const CostDBEntryStatsRF &stats2, double coefficient)
 
virtual double energyActive () const
 
virtual double energyRead () const
 
virtual double energyWrite () const
 
virtual double energyReadWrite (int reads, int writes) const
 
virtual void setEnergyActive (double energy)
 
virtual void setEnergyRead (double energy)
 
virtual void setEnergyWrite (double energy)
 
virtual void setEnergyReadWrite (int reads, int writes, 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 energyOperation (const std::string &name) const
 
virtual bool hasEnergyOperation (const std::string &name) const
 
virtual void setEnergyIdle (double energy)
 
virtual void setEnergyOperation (const std::string &name, 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 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

 CostDBEntryStatsRF (const CostDBEntryStatsRF &)
 Copying not allowed. More...
 
CostDBEntryStatsRFoperator= (const CostDBEntryStatsRF &)
 Assignment not allowed. More...
 

Static Private Member Functions

static std::string generateReadWriteString (int reads, int writes)
 

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 register files.

Definition at line 45 of file CostDBEntryStatsRF.hh.

Member Typedef Documentation

◆ DelayMap

typedef std::map<const std::string, double> CostDBEntryStatsRF::DelayMap
private

Map of delays.

Definition at line 71 of file CostDBEntryStatsRF.hh.

◆ EnergyMap

typedef std::map<const std::string, double> CostDBEntryStatsRF::EnergyMap
private

Map of energies.

Definition at line 69 of file CostDBEntryStatsRF.hh.

Constructor & Destructor Documentation

◆ CostDBEntryStatsRF() [1/3]

CostDBEntryStatsRF::CostDBEntryStatsRF ( double  areaData,
double  delayData 
)

Constructor.

Parameters
areaDataarea.
delayDatadelay.

Definition at line 50 of file CostDBEntryStatsRF.cc.

50  :
51  CostDBEntryStats(areaData, delayData) {
52 }

Referenced by createStats().

◆ ~CostDBEntryStatsRF()

CostDBEntryStatsRF::~CostDBEntryStatsRF ( )
virtual

Destructor.

Definition at line 77 of file CostDBEntryStatsRF.cc.

77  {
78 }

◆ CostDBEntryStatsRF() [2/3]

CostDBEntryStatsRF::CostDBEntryStatsRF ( const CostDBEntryStatsRF stats1,
const CostDBEntryStatsRF 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 66 of file CostDBEntryStatsRF.cc.

69  :
70  CostDBEntryStats(stats1, stats2, coefficient) {
71 }

◆ CostDBEntryStatsRF() [3/3]

CostDBEntryStatsRF::CostDBEntryStatsRF ( const CostDBEntryStatsRF )
private

Copying not allowed.

Member Function Documentation

◆ createStats()

CostDBEntryStats * CostDBEntryStatsRF::createStats ( ) const
protectedvirtual

Create correct type of statistics.

Returns
Correct type of statistics.

Reimplemented from CostDBEntryStats.

Definition at line 88 of file CostDBEntryStatsRF.cc.

88  {
89 
90  return new CostDBEntryStatsRF(area(), delay());
91 }

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

Here is the call graph for this function:

◆ energyActive()

double CostDBEntryStatsRF::energyActive ( ) const
virtual

Returns the energy of an entry in an active cycle.

The function will fail since register files do not have unambiguous energy for the whole unit but separately for each access pairs.

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

Reimplemented from CostDBEntryStats.

Definition at line 105 of file CostDBEntryStatsRF.cc.

105  {
106  throw WrongSubclass(__FILE__, __LINE__,
107  "CostDBEntryStatsRF::energyActive");
108  return 0.0; // stupid return statement to make compiler quiet
109 }

◆ energyRead()

double CostDBEntryStatsRF::energyRead ( ) const
virtual

Returns the read energy of an entry.

Returns
The read energy of an entry.
Exceptions
WrongSubclassNever thrown by this function.
KeyNotFoundThrows if read energy is not set.

Reimplemented from CostDBEntryStats.

Definition at line 119 of file CostDBEntryStatsRF.cc.

119  {
120  return findEnergy(ENERGY_READ);
121 }

References CostDBEntryStats::ENERGY_READ, and CostDBEntryStats::findEnergy().

Here is the call graph for this function:

◆ energyReadWrite()

double CostDBEntryStatsRF::energyReadWrite ( int  reads,
int  writes 
) const
virtual

Returns the reads and writes energy of an entry.

Parameters
readsThe number of simultaneus reads done for the unit.
writesThe number of simultaneus writes done for the unit.
Returns
The reads and writes energy of an entry.
Exceptions
WrongSubclassNever thrown by this function.
KeyNotFoundThrows if the requested energy is not found.

Reimplemented from CostDBEntryStats.

Definition at line 145 of file CostDBEntryStatsRF.cc.

145  {
146  return findEnergy(generateReadWriteString(reads, writes));
147 }

References CostDBEntryStats::findEnergy(), and generateReadWriteString().

Here is the call graph for this function:

◆ energyWrite()

double CostDBEntryStatsRF::energyWrite ( ) const
virtual

Returns the write energy of an entry.

Returns
The write energy of an entry.
Exceptions
WrongSubclassNever thrown by this function.
KeyNotFoundThrows if write energy is not set.

Reimplemented from CostDBEntryStats.

Definition at line 131 of file CostDBEntryStatsRF.cc.

131  {
132  return findEnergy(ENERGY_WRITE);
133 }

References CostDBEntryStats::ENERGY_WRITE, and CostDBEntryStats::findEnergy().

Here is the call graph for this function:

◆ generateReadWriteString()

std::string CostDBEntryStatsRF::generateReadWriteString ( int  reads,
int  writes 
)
staticprivate

Returns a string corresponding to given (read,write) combination in internal format.

Parameters
readsNumber of simultaneous reads.
writesNumber of simultaneous writes.
Returns
String corresponding to given (read,write) combination in internal format.

Definition at line 210 of file CostDBEntryStatsRF.cc.

210  {
211 
212  return ENERGY_READ_WRITE + "_" +
213  Conversion::toString(reads) + "_" +
214  Conversion::toString(writes);
215 }

References CostDBEntryStats::ENERGY_READ_WRITE, and Conversion::toString().

Referenced by energyReadWrite(), and setEnergyReadWrite().

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.

◆ setEnergyActive()

void CostDBEntryStatsRF::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 160 of file CostDBEntryStatsRF.cc.

160  {
161  throw WrongSubclass(__FILE__, __LINE__,
162  "CostDBEntryStatsRF::setEnergyActive");
163 }

◆ setEnergyRead()

void CostDBEntryStatsRF::setEnergyRead ( double  energy)
virtual

Set the read energy of an entry.

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

Reimplemented from CostDBEntryStats.

Definition at line 172 of file CostDBEntryStatsRF.cc.

172  {
173  addEnergy(ENERGY_READ, energy);
174 }

References CostDBEntryStats::addEnergy(), and CostDBEntryStats::ENERGY_READ.

Here is the call graph for this function:

◆ setEnergyReadWrite()

void CostDBEntryStatsRF::setEnergyReadWrite ( int  reads,
int  writes,
double  energy 
)
virtual

Set the reads and writes energy of an entry.

Parameters
energyThe reads and writes energy of an entry.
readsThe number of reads of the unit.
writesThe number of writes of the unit.
Exceptions
WrongSubclassNever thrown by this function.

Reimplemented from CostDBEntryStats.

Definition at line 196 of file CostDBEntryStatsRF.cc.

196  {
197  addEnergy(generateReadWriteString(reads, writes), energy);
198 }

References CostDBEntryStats::addEnergy(), and generateReadWriteString().

Referenced by CostDatabase::buildRegisterFiles().

Here is the call graph for this function:

◆ setEnergyWrite()

void CostDBEntryStatsRF::setEnergyWrite ( double  energy)
virtual

Set the write energy of an entry.

Parameters
energyThe write energy of an entry.
Exceptions
WrongSubclassNever thrown by this function.

Reimplemented from CostDBEntryStats.

Definition at line 183 of file CostDBEntryStatsRF.cc.

183  {
184  addEnergy(ENERGY_WRITE, energy);
185 }

References CostDBEntryStats::addEnergy(), and CostDBEntryStats::ENERGY_WRITE.

Here is the call graph for this function:

The documentation for this class was generated from the following files:
CostDBEntryStats::ENERGY_WRITE
static const std::string ENERGY_WRITE
String for write energy.
Definition: CostDBEntryStats.hh:92
CostDBEntryStats::ENERGY_READ_WRITE
static const std::string ENERGY_READ_WRITE
String for reads and writes energy.
Definition: CostDBEntryStats.hh:94
CostDBEntryStats::delay
virtual double delay() const
Conversion::toString
static std::string toString(const T &source)
WrongSubclass
Definition: Exception.hh:336
CostDBEntryStatsRF::CostDBEntryStatsRF
CostDBEntryStatsRF(double areaData, double delayData)
Definition: CostDBEntryStatsRF.cc:50
CostDBEntryStats::ENERGY_READ
static const std::string ENERGY_READ
String for read energy.
Definition: CostDBEntryStats.hh:90
CostDBEntryStats::area
virtual double area() const
CostDBEntryStats::addEnergy
virtual void addEnergy(const std::string &name, double energy)
Definition: CostDBEntryStats.cc:413
CostDBEntryStats::findEnergy
virtual double findEnergy(const std::string &key) const
Definition: CostDBEntryStats.cc:308
CostDBEntryStatsRF::generateReadWriteString
static std::string generateReadWriteString(int reads, int writes)
Definition: CostDBEntryStatsRF.cc:210
CostDBEntryStats::CostDBEntryStats
CostDBEntryStats(double areaData, double internalDelayData)
Definition: CostDBEntryStats.cc:58