VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
PowerCallibInputs Class Reference

#include <PowerSpicedComponent.h>

+ Collaboration diagram for PowerCallibInputs:

Public Member Functions

 PowerCallibInputs (PowerSpicedComponent *parent, float num_inputs)
 
void add_size (float transistor_size, float power=0.)
 
PowerCallibSizeget_entry_bound (bool lower, float transistor_size)
 
void sort_me ()
 
void callibrate ()
 

Data Fields

PowerSpicedComponentparent
 
int num_inputs
 
std::vector< PowerCallibSize * > entries
 
bool sorted
 
bool done_callibration
 

Detailed Description

Definition at line 40 of file PowerSpicedComponent.h.

Constructor & Destructor Documentation

PowerCallibInputs::PowerCallibInputs ( PowerSpicedComponent parent,
float  num_inputs 
)

Definition at line 14 of file PowerSpicedComponent.c.

15  :
16  parent(parent_), num_inputs(inputs), sorted(false), done_callibration(
17  false) {
18 
19  /* Add min/max bounding entries */
20  add_size(0);
22 }
PowerSpicedComponent * parent
void add_size(float transistor_size, float power=0.)
#define max(a, b)
Definition: graphics.c:171

+ Here is the call graph for this function:

Member Function Documentation

void PowerCallibInputs::add_size ( float  transistor_size,
float  power = 0. 
)

Definition at line 24 of file PowerSpicedComponent.c.

24  {
25  PowerCallibSize * entry = new PowerCallibSize(transistor_size, power);
26  entries.push_back(entry);
27  sorted = false;
28 }
std::vector< PowerCallibSize * > entries

+ Here is the caller graph for this function:

void PowerCallibInputs::callibrate ( )

Definition at line 39 of file PowerSpicedComponent.c.

39  {
40  assert(entries.size() >= 2);
41 
42  for (vector<PowerCallibSize*>::iterator it = entries.begin() + 1;
43  it != entries.end() - 1; it++) {
44  float est_power = parent->component_usage(num_inputs,
45  (*it)->transistor_size);
46  (*it)->factor = (*it)->power / est_power;
47  }
48 
49  /* Set min-value placeholder */
50  entries[0]->factor = entries[1]->factor;
51 
52  /* Set max-value placeholder */
53  entries[entries.size() - 1]->factor = entries[entries.size() - 2]->factor;
54 
55  done_callibration = true;
56 }
float(* component_usage)(int num_inputs, float transistor_size)
PowerSpicedComponent * parent
std::vector< PowerCallibSize * > entries
PowerCallibSize * PowerCallibInputs::get_entry_bound ( bool  lower,
float  transistor_size 
)

Definition at line 58 of file PowerSpicedComponent.c.

59  {
60  PowerCallibSize * prev = entries[0];
61 
62  assert(sorted);
63  for (vector<PowerCallibSize*>::iterator it = entries.begin() + 1;
64  it != entries.end(); it++) {
65  if ((*it)->transistor_size > transistor_size) {
66  if (lower)
67  return prev;
68  else
69  return *it;
70  }
71  prev = *it;
72  }
73  return NULL;
74 }
std::vector< PowerCallibSize * > entries

+ Here is the caller graph for this function:

void PowerCallibInputs::sort_me ( )

Definition at line 34 of file PowerSpicedComponent.c.

34  {
35  sort(entries.begin(), entries.end(), sorter_PowerCallibSize);
36  sorted = true;
37 }
std::vector< PowerCallibSize * > entries
bool sorter_PowerCallibSize(PowerCallibSize *a, PowerCallibSize *b)

+ Here is the call graph for this function:

Field Documentation

bool PowerCallibInputs::done_callibration

Definition at line 52 of file PowerSpicedComponent.h.

std::vector<PowerCallibSize*> PowerCallibInputs::entries

Definition at line 44 of file PowerSpicedComponent.h.

int PowerCallibInputs::num_inputs

Definition at line 43 of file PowerSpicedComponent.h.

PowerSpicedComponent* PowerCallibInputs::parent

Definition at line 42 of file PowerSpicedComponent.h.

bool PowerCallibInputs::sorted

Definition at line 45 of file PowerSpicedComponent.h.


The documentation for this class was generated from the following files: