VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
PowerSpicedComponent.h
Go to the documentation of this file.
1 /*********************************************************************
2  * The following code is part of the power modelling feature of VTR.
3  *
4  * For support:
5  * http://code.google.com/p/vtr-verilog-to-routing/wiki/Power
6  *
7  * or email:
8  * vtr.power.estimation@gmail.com
9  *
10  * If you are using power estimation for your researach please cite:
11  *
12  * Jeffrey Goeders and Steven Wilton. VersaPower: Power Estimation
13  * for Diverse FPGA Architectures. In International Conference on
14  * Field Programmable Technology, 2012.
15  *
16  ********************************************************************/
17 
18 #ifndef __POWER_POWERSPICEDCOMPONENT_NMOS_H__
19 #define __POWER_POWERSPICEDCOMPONENT_NMOS_H__
20 
21 #include <vector>
22 
23 /************************* STRUCTS **********************************/
25 
27 public:
29  float power;
30  float factor;
31 
32  PowerCallibSize(float size, float power_) :
33  transistor_size(size), power(power_), factor(0.) {
34  }
35  const bool operator<(const PowerCallibSize & rhs) {
36  return transistor_size < rhs.transistor_size;
37  }
38 };
39 
41 public:
44  std::vector<PowerCallibSize*> entries;
45  bool sorted;
46 
48 
49  void add_size(float transistor_size, float power = 0.);
50  PowerCallibSize * get_entry_bound(bool lower, float transistor_size);
51  void sort_me();
53  void callibrate();
54 };
55 
57 public:
58  std::vector<PowerCallibInputs*> entries;
59 
60  /* Estimation function for this component */
61  float (*component_usage)(int num_inputs, float transistor_size);
62 
63  bool sorted;
65 
66  PowerCallibInputs * add_entry(int num_inputs);
67  PowerCallibInputs* get_entry(int num_inputs);
68  PowerCallibInputs * get_entry_bound(bool lower, int num_inputs);
69 
71  float (*usage_fn)(int num_inputs, float transistor_size));
72 
73  void add_data_point(int num_inputs, float transistor_size, float power);
74  float scale_factor(int num_inputs, float transistor_size);
75  void sort_me();
76 
77 // void update_scale_factor(float (*fn)(float size));
78  void callibrate(void);
79  bool is_done_callibration(void);
80 };
81 
82 #endif
float(* component_usage)(int num_inputs, float transistor_size)
PowerSpicedComponent * parent
void add_size(float transistor_size, float power=0.)
PowerCallibSize(float size, float power_)
std::vector< PowerCallibInputs * > entries
PowerCallibInputs * add_entry(int num_inputs)
PowerSpicedComponent(float(*usage_fn)(int num_inputs, float transistor_size))
PowerCallibSize * get_entry_bound(bool lower, float transistor_size)
const bool operator<(const PowerCallibSize &rhs)
PowerCallibInputs * get_entry(int num_inputs)
void add_data_point(int num_inputs, float transistor_size, float power)
std::vector< PowerCallibSize * > entries
PowerCallibInputs * get_entry_bound(bool lower, int num_inputs)
PowerCallibInputs(PowerSpicedComponent *parent, float num_inputs)
float scale_factor(int num_inputs, float transistor_size)