OpenASIP 2.2
Loading...
Searching...
No Matches
CostDBEntryStats.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file CostDBEntryStats.hh
26 *
27 * Declaration of CostDBEntryStats class.
28 *
29 * @author Tommi Rantanen 2003 (tommi.rantanen-no.spam-tut.fi)
30 * @author Jari Mäntyneva 2005 (jari.mantyneva-no.spam-tut.fi)
31 * @note rating: red
32 */
33
34#ifndef TTA_COSTDB_ENTRY_STATS_HH
35#define TTA_COSTDB_ENTRY_STATS_HH
36
37
38#include <map>
39
40#include "Exception.hh"
41
42
43/**
44 * Stores area, delay and energy statistics.
45 */
47public:
48 CostDBEntryStats(double areaData, double internalDelayData);
49 virtual ~CostDBEntryStats();
51 const CostDBEntryStats& stats1, const CostDBEntryStats& stats2,
52 double coefficient);
53 virtual CostDBEntryStats* copy() const;
54
55 virtual double area() const;
56 virtual double delay() const;
57 virtual double delayPort(const std::string& port) const;
58
59 virtual void setDelay(const std::string& port, double delay);
60
61 virtual double energyActive() const;
62 virtual double energyIdle() const;
63 virtual double energyOperation(const std::string& name) const;
64 virtual bool hasEnergyOperation(const std::string& name) const;
65 virtual double energyRead() const;
66 virtual double energyWrite() const;
67 virtual double energyReadWrite(int reads, int writes) const;
68
69 virtual void setEnergyActive(double energy);
70 virtual void setEnergyIdle(double energy);
71 virtual void setEnergyOperation(const std::string& name, double energy);
72 virtual void setEnergyRead(double energy);
73 virtual void setEnergyWrite(double energy);
74 virtual void setEnergyReadWrite(int reads, int writes, double energy);
75
76protected:
77 virtual bool hasEnergy(const std::string& key) const;
78 virtual double findEnergy(const std::string& key) const;
79 virtual void addEnergy(const std::string& name, double energy);
80 virtual bool hasDelay(const std::string& key) const;
81 virtual double findDelay(const std::string& key) const;
82 virtual void addDelay(const std::string& name, double delay);
83 virtual CostDBEntryStats* createStats() const;
84
85 /// String for active energy.
86 static const std::string ENERGY_ACTIVE;
87 /// String for idle energy.
88 static const std::string ENERGY_IDLE;
89 /// String for read energy.
90 static const std::string ENERGY_READ;
91 /// String for write energy.
92 static const std::string ENERGY_WRITE;
93 /// String for reads and writes energy.
94 static const std::string ENERGY_READ_WRITE;
95
96private:
97 /// Map of energies.
98 typedef std::map<const std::string, double> EnergyMap;
99 /// Map of delays.
100 typedef std::map<const std::string, double> DelayMap;
101
102 /// area in gates.
103 double area_;
104 /// delay in nanoseconds.
105 double delay_;
106 /// input and output delays in nanoseconds.
108 /// Energies of one specific type of usage of a resource.
109 /// Usually the map contains energies for active and idle usage of
110 /// a resource. However, in case of FUs the active energy does not
111 /// exist and but energies are defined for each operation.
113
114 /// Copying not allowed.
116 /// Assignment not allowed.
118};
119
120#include "CostDBEntryStats.icc"
121
122#endif
virtual void setEnergyRead(double energy)
CostDBEntryStats & operator=(const CostDBEntryStats &)
Assignment not allowed.
std::map< const std::string, double > DelayMap
Map of delays.
virtual double energyIdle() const
virtual void setEnergyOperation(const std::string &name, double energy)
virtual CostDBEntryStats * createStats() const
virtual CostDBEntryStats * copy() const
static const std::string ENERGY_ACTIVE
String for active energy.
virtual double findDelay(const std::string &key) const
virtual bool hasDelay(const std::string &key) const
virtual void addDelay(const std::string &name, double delay)
static const std::string ENERGY_READ_WRITE
String for reads and writes energy.
virtual double findEnergy(const std::string &key) const
virtual double delayPort(const std::string &port) const
DelayMap delays_
input and output delays in nanoseconds.
double delay_
delay in nanoseconds.
virtual bool hasEnergyOperation(const std::string &name) const
virtual double energyWrite() const
virtual void setEnergyReadWrite(int reads, int writes, double energy)
EnergyMap energies_
Energies of one specific type of usage of a resource. Usually the map contains energies for active an...
virtual double energyActive() const
virtual double delay() const
virtual void setEnergyIdle(double energy)
virtual void setEnergyWrite(double energy)
virtual double energyReadWrite(int reads, int writes) const
static const std::string ENERGY_READ
String for read energy.
double area_
area in gates.
virtual double energyRead() const
virtual void setEnergyActive(double energy)
CostDBEntryStats(const CostDBEntryStats &)
Copying not allowed.
virtual void setDelay(const std::string &port, double delay)
virtual bool hasEnergy(const std::string &key) const
static const std::string ENERGY_WRITE
String for write energy.
virtual void addEnergy(const std::string &name, double energy)
std::map< const std::string, double > EnergyMap
Map of energies.
virtual double energyOperation(const std::string &name) const
virtual double area() const
static const std::string ENERGY_IDLE
String for idle energy.