VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
power_components.c
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 /**
19  * This file offers functions to estimate power of major components
20  * within the FPGA (flip-flops, LUTs, interconnect structures, etc).
21  */
22 
23 /************************* INCLUDES *********************************/
24 #include <cstring>
25 using namespace std;
26 
27 #include <assert.h>
28 
29 #include "power_components.h"
30 #include "power_lowlevel.h"
31 #include "power_util.h"
32 #include "power_callibrate.h"
33 #include "globals.h"
34 
35 /************************* STRUCTS **********************************/
36 
37 /************************* GLOBALS **********************************/
39 
40 /************************* FUNCTION DECLARATIONS ********************/
41 static void power_usage_mux_rec(t_power_usage * power_usage, float * out_prob,
42  float * out_dens, float * v_out, t_mux_node * mux_node,
43  t_mux_arch * mux_arch, int * selector_values,
44  float * primary_input_prob, float * primary_input_dens,
45  boolean v_out_restored, float period);
46 
47 /************************* FUNCTION DEFINITIONS *********************/
48 
49 /**
50  * Module initializer function, called by power_init
51  */
53  int i;
54 
57  for (i = 0; i < POWER_COMPONENT_MAX_NUM; i++) {
59  }
60 }
61 
62 /**
63  * Module un-initializer function, called by power_uninit
64  */
67 }
68 
69 /**
70  * Adds power usage for a component to the global component tracker
71  * - power_usage: Power usage to add
72  * - component_idx: Type of component
73  */
75  e_power_component_type component_idx) {
77  power_usage);
78 }
79 
80 /**
81  * Gets power usage for a component
82  * - power_usage: (Return value) Power usage for the given component
83  * - component_idx: Type of component
84  */
86  e_power_component_type component_idx) {
87  memcpy(power_usage, &g_power_by_component.components[component_idx],
88  sizeof(t_power_usage));
89 }
90 
91 /**
92  * Returns total power for a given component
93  * - component_idx: Type of component
94  */
96  return power_sum_usage(&g_power_by_component.components[component_idx]);
97 }
98 
99 /**
100  * Calculates power of a D flip-flop
101  * - power_usage: (Return value) power usage of the flip-flop
102  * - D_prob: Signal probability of the input
103  * - D_dens: Transition density of the input
104  * - Q_prob: Signal probability of the output
105  * - Q_dens: Transition density of the output
106  * - clk_prob: Signal probability of the clock
107  * - clk_dens: Transition density of the clock
108  */
109 void power_usage_ff(t_power_usage * power_usage, float size, float D_prob,
110  float D_dens, float Q_prob, float Q_dens, float clk_prob,
111  float clk_dens, float period) {
112  t_power_usage sub_power_usage;
113  float mux_in_dens[2];
114  float mux_in_prob[2];
115  PowerSpicedComponent * callibration;
116  float scale_factor;
117 
118  power_zero_usage(power_usage);
119 
120  /* DFF is build using a master loop and slave loop.
121  * Each loop begins with a MUX and contains 2 inverters
122  * in a feedback loop to the mux.
123  * Each mux is built using two transmission gates.
124  */
125 
126  /* Master */
127  mux_in_dens[0] = D_dens;
128  mux_in_dens[1] = (1 - clk_prob) * D_dens;
129  mux_in_prob[0] = D_prob;
130  mux_in_prob[1] = D_prob;
131  power_usage_MUX2_transmission(&sub_power_usage, size, mux_in_dens,
132  mux_in_prob, clk_dens, (1 - clk_prob) * D_dens, period);
133  power_add_usage(power_usage, &sub_power_usage);
134 
135  power_usage_inverter(&sub_power_usage, (1 - clk_prob) * D_dens, D_prob,
136  size, period);
137  power_add_usage(power_usage, &sub_power_usage);
138 
139  power_usage_inverter(&sub_power_usage, (1 - clk_prob) * D_dens, 1 - D_prob,
140  size, period);
141  power_add_usage(power_usage, &sub_power_usage);
142 
143  /* Slave */
144  mux_in_dens[0] = Q_dens;
145  mux_in_dens[1] = (1 - clk_prob) * D_dens;
146  mux_in_prob[0] = (1 - Q_prob);
147  mux_in_prob[1] = (1 - D_prob);
148  power_usage_MUX2_transmission(&sub_power_usage, size, mux_in_dens,
149  mux_in_prob, clk_dens, Q_dens, period);
150  power_add_usage(power_usage, &sub_power_usage);
151 
152  power_usage_inverter(&sub_power_usage, Q_dens, 1 - Q_prob, size, period);
153  power_add_usage(power_usage, &sub_power_usage);
154 
155  power_usage_inverter(&sub_power_usage, Q_dens, Q_prob, size, period);
156  power_add_usage(power_usage, &sub_power_usage);
157 
158  /* Callibration */
159  callibration =
161  if (callibration->is_done_callibration()) {
162  scale_factor = callibration->scale_factor(1, size);
163  power_scale_usage(power_usage, scale_factor);
164  }
165 
166  return;
167 }
168 
169 /**
170  * Calculated power of a look-up table (LUT)
171  * - power_usage: (Return value) The power usage of the LUT
172  * - LUT_size: Number of LUT inputs
173  * - SRAM_values: The 2^(LUT_size) truth table values. String of '0' and '1' characters.
174  * First characters is for all inputs = 0 and last characters is for all inputs = 1.
175  * - input_prob: Array of input signal probabilities
176  * - input_dens: Array of input transition densities
177  *
178  * NOTE: The following provides a diagram of a 3-LUT, the sram bit ordering, and
179  * the input array ordering.
180  *
181  * X - NMOS gate controlled by complement of input
182  * Z - NMOS gate controlled by input
183  *
184  * S
185  * R I I I
186  * A N N N
187  * M 2 1 0
188  * | | | |
189  * v v | |
190  * v |
191  * 0 _X_ |
192  * |_X_ v
193  * 1 _Z_| |
194  * |_X_
195  * 2 _X_ | |
196  * |_Z_| |
197  * 3 _Z_| |
198  * |------ out
199  * 4 _X_ |
200  * |_X_ |
201  * 5 _Z_| | |
202  * |_Z_|
203  * 6 _X_ |
204  * |_Z_|
205  * 7 _Z_|
206  *
207  */
208 void power_usage_lut(t_power_usage * power_usage, int lut_size,
209  float transistor_size, char * SRAM_values, float * input_prob,
210  float * input_dens, float period) {
211  float **internal_prob;
212  float **internal_dens;
213  float **internal_v;
214  int i;
215  int level_idx;
216  PowerSpicedComponent * callibration;
217  float scale_factor;
218 
219  int num_SRAM_bits;
220 
221  boolean level_restorer_this_level = FALSE;
222 
223  power_zero_usage(power_usage);
224 
225  num_SRAM_bits = 1 << lut_size;
226 
227  /* Initialize internal node data */
228  internal_prob = (float**) my_calloc(lut_size + 1, sizeof(float*));
229  internal_dens = (float**) my_calloc(lut_size + 1, sizeof(float*));
230  internal_v = (float**) my_calloc(lut_size + 1, sizeof(float*));
231  for (i = 0; i <= lut_size; i++) {
232  internal_prob[i] = (float*) my_calloc(1 << (lut_size - i),
233  sizeof(float));
234  internal_dens[i] = (float*) my_calloc(1 << (lut_size - i),
235  sizeof(float));
236  internal_v[i] = (float*) my_calloc(1 << (lut_size - i), sizeof(float));
237  }
238 
239  /* Initialize internal probabilities/densities from SRAM bits */
240  for (i = 0; i < num_SRAM_bits; i++) {
241  if (SRAM_values[i] == '0') {
242  internal_prob[0][i] = 0.;
243  } else {
244  internal_prob[0][i] = 1.;
245  }
246  internal_dens[0][i] = 0.;
247  internal_v[0][i] = g_power_tech->Vdd;
248  }
249 
250  for (level_idx = 0; level_idx < lut_size; level_idx++) {
251  t_power_usage driver_power_usage;
252  int MUXs_this_level;
253  int MUX_idx;
254  int reverse_idx = lut_size - level_idx - 1;
255 
256  MUXs_this_level = 1 << (reverse_idx);
257 
258  /* Power of input drivers */
259  power_usage_inverter(&driver_power_usage, input_dens[reverse_idx],
260  input_prob[reverse_idx], 1.0, period);
261  power_add_usage(power_usage, &driver_power_usage);
262 
263  power_usage_inverter(&driver_power_usage, input_dens[reverse_idx],
264  input_prob[reverse_idx], 2.0, period);
265  power_add_usage(power_usage, &driver_power_usage);
266 
267  power_usage_inverter(&driver_power_usage, input_dens[reverse_idx],
268  1 - input_prob[reverse_idx], 2.0, period);
269  power_add_usage(power_usage, &driver_power_usage);
270 
271  /* Add level restorer after every 2 stages (level_idx %2 == 1)
272  * But if there is an odd # of stages, just put one at the last
273  * stage (level_idx == LUT_size - 1) and not at the stage just before
274  * the last stage (level_idx != LUT_size - 2)
275  */
276  if (((level_idx % 2 == 1) && (level_idx != lut_size - 2))
277  || (level_idx == lut_size - 1)) {
278  level_restorer_this_level = TRUE;
279  } else {
280  level_restorer_this_level = FALSE;
281  }
282 
283  /* Loop through the 2-muxs at each level */
284  for (MUX_idx = 0; MUX_idx < MUXs_this_level; MUX_idx++) {
285  t_power_usage sub_power;
286  float out_prob;
287  float out_dens;
288  float sum_prob = 0;
289  int sram_offset = MUX_idx * ipow(2, level_idx + 1);
290  int sram_per_branch = ipow(2, level_idx);
291  int branch_lvl_idx;
292  int sram_idx;
293  float v_out;
294 
295  /* Calculate output probability of multiplexer */
296  out_prob = internal_prob[level_idx][MUX_idx * 2]
297  * (1 - input_prob[reverse_idx])
298  + internal_prob[level_idx][MUX_idx * 2 + 1]
299  * input_prob[reverse_idx];
300 
301  /* Calculate output density of multiplexer */
302  out_dens = internal_dens[level_idx][MUX_idx * 2]
303  * (1 - input_prob[reverse_idx])
304  + internal_dens[level_idx][MUX_idx * 2 + 1]
305  * input_prob[reverse_idx];
306 
307 #ifdef POWER_LUT_FAST
308  out_dens += ((1 - internal_prob[level_idx][MUX_idx * 2]) * internal_prob[level_idx][MUX_idx * 2 + 1]
309  + internal_prob[level_idx][MUX_idx * 2] * (1 - internal_prob[level_idx][MUX_idx * 2 + 1]))
310  * input_dens[reverse_idx];
311 #elif defined(POWER_LUT_SLOW)
312  for (sram_idx = sram_offset;
313  sram_idx < sram_offset + sram_per_branch; sram_idx++) {
314  float branch_prob = 1.;
315  if (SRAM_values[sram_idx]
316  == SRAM_values[sram_idx + sram_per_branch]) {
317  continue;
318  }
319  for (branch_lvl_idx = 0; branch_lvl_idx < level_idx;
320  branch_lvl_idx++) {
321  int branch_lvl_reverse_idx = lut_size - branch_lvl_idx - 1;
322  int even_odd = sram_idx / ipow(2, branch_lvl_idx);
323  if (even_odd % 2 == 0) {
324  branch_prob *= (1 - input_prob[branch_lvl_reverse_idx]);
325  } else {
326  branch_prob *= input_prob[branch_lvl_reverse_idx];
327  }
328  }
329  sum_prob += branch_prob;
330  }
331  out_dens += sum_prob * input_dens[reverse_idx];
332 #endif
333 
334  /* Calculate output voltage of multiplexer */
335  if (level_restorer_this_level) {
336  v_out = g_power_tech->Vdd;
337  } else {
338  v_out = (1 - input_prob[reverse_idx])
339  * power_calc_mux_v_out(2, 1.0,
340  internal_v[level_idx][MUX_idx * 2],
341  internal_prob[level_idx][MUX_idx * 2 + 1])
342  + input_prob[reverse_idx]
343  * power_calc_mux_v_out(2, 1.0,
344  internal_v[level_idx][MUX_idx * 2 + 1],
345  internal_prob[level_idx][MUX_idx * 2]);
346  }
347 
348  /* Save internal node info */
349  internal_dens[level_idx + 1][MUX_idx] = out_dens;
350  internal_prob[level_idx + 1][MUX_idx] = out_prob;
351  internal_v[level_idx + 1][MUX_idx] = v_out;
352 
353  /* Calculate power of the 2-mux */
355  internal_dens[level_idx + 1][MUX_idx],
356  internal_v[level_idx + 1][MUX_idx],
357  &internal_prob[level_idx][MUX_idx * 2],
358  &internal_dens[level_idx][MUX_idx * 2],
359  &internal_v[level_idx][MUX_idx * 2],
360  input_dens[reverse_idx], input_prob[reverse_idx],
361  transistor_size, period);
362  power_add_usage(power_usage, &sub_power);
363 
364  /* Add the level-restoring buffer if necessary */
365  if (level_restorer_this_level) {
366  /* Level restorer */
367  power_usage_buffer(&sub_power, 1,
368  internal_prob[level_idx + 1][MUX_idx],
369  internal_dens[level_idx + 1][MUX_idx], TRUE, period);
370  power_add_usage(power_usage, &sub_power);
371  }
372  }
373 
374  }
375 
376  /* Free allocated memory */
377  for (i = 0; i <= lut_size; i++) {
378  free(internal_prob[i]);
379  free(internal_dens[i]);
380  free(internal_v[i]);
381  }
382  free(internal_prob);
383  free(internal_dens);
384  free(internal_v);
385 
386  /* Callibration */
387  callibration =
389  if (callibration->is_done_callibration()) {
390  scale_factor = callibration->scale_factor(lut_size, transistor_size);
391  power_scale_usage(power_usage, scale_factor);
392  }
393 
394  return;
395 }
396 
397 /**
398  * This function calculates power of a local interconnect structure
399  * - power_usage: (Return value) Power usage of the structure
400  * - pb: The physical block to which this interconnect belongs
401  * - interc_pins: The interconnect input/ouput pin information
402  * - interc_length: The physical length spanned by the interconnect (meters)
403  */
405  t_interconnect_pins * interc_pins) {
406  int pin_idx;
407  int out_port_idx;
408  int in_port_idx;
409  float * in_dens;
410  float * in_prob;
411  t_power_usage MUX_power;
412  t_interconnect * interc = interc_pins->interconnect;
413  t_interconnect_power * interc_power = interc->interconnect_power;
414 
415  power_zero_usage(power_usage);
416 
417  /* Ensure port/pins are structured as expected */
418  switch (interc_pins->interconnect->type) {
419  case DIRECT_INTERC:
420  assert(interc_power->num_input_ports == 1);
421  assert(interc_power->num_output_ports == 1);
422  break;
423  case MUX_INTERC:
424  assert(interc_power->num_output_ports == 1);
425  break;
426  case COMPLETE_INTERC:
427  break;
428  }
429 
430  /* Power of transistors to build interconnect structure */
431  switch (interc_pins->interconnect->type) {
432  case DIRECT_INTERC:
433  /* Direct connections require no transistors */
434  break;
435  case MUX_INTERC:
436  case COMPLETE_INTERC:
437  /* Many-to-1, or Many-to-Many
438  * Implemented as a multiplexer for each output
439  * */
440  in_dens = (float*) my_calloc(
441  interc->interconnect_power->num_input_ports, sizeof(float));
442  in_prob = (float*) my_calloc(
443  interc->interconnect_power->num_input_ports, sizeof(float));
444 
445  for (out_port_idx = 0;
446  out_port_idx < interc->interconnect_power->num_output_ports;
447  out_port_idx++) {
448  for (pin_idx = 0;
449  pin_idx < interc->interconnect_power->num_pins_per_port;
450  pin_idx++) {
451 
452  int selected_input = OPEN;
453 
454  /* Clear input densities */
455  for (in_port_idx = 0;
456  in_port_idx
458  in_port_idx++) {
459  in_dens[in_port_idx] = 0.;
460  in_prob[in_port_idx] = 0.;
461  }
462 
463  /* Get probability/density of input signals */
464  if (pb) {
465  int output_pin_net =
466  pb->rr_graph[interc_pins->output_pins[out_port_idx][pin_idx]->pin_count_in_cluster].net_num;
467 
468  if (output_pin_net == OPEN) {
469  selected_input = 0;
470  } else {
471  for (in_port_idx = 0;
472  in_port_idx
474  in_port_idx++) {
475  t_pb_graph_pin * input_pin =
476  interc_pins->input_pins[in_port_idx][pin_idx];
477  int input_pin_net =
478  pb->rr_graph[input_pin->pin_count_in_cluster].net_num;
479 
480  /* Find input pin that connects through the mux to the output pin */
481  if (output_pin_net == input_pin_net) {
482  selected_input = in_port_idx;
483  }
484 
485  /* Initialize input densities */
486  if (input_pin_net != OPEN) {
487  in_dens[in_port_idx] = pin_dens(pb, input_pin);
488  in_prob[in_port_idx] = pin_prob(pb, input_pin);
489  }
490  }
491 
492  /* Check that the input pin was found with a matching net to the output pin */
493  assert(selected_input != OPEN);
494  }
495  } else {
496  selected_input = 0;
497  }
498 
499  /* Calculate power of the multiplexer */
500  power_usage_mux_multilevel(&MUX_power,
504  in_dens, selected_input, TRUE, g_solution_inf.T_crit);
505 
506  power_add_usage(power_usage, &MUX_power);
507  }
508  }
509 
510  free(in_dens);
511  free(in_prob);
512  break;
513  default:
514  assert(0);
515  }
516 
518  power_usage);
519 }
520 
521 /**
522  * This calculates the power of a multilevel multiplexer, with static inputs
523  * - power_usage: (Return value) The power usage of the multiplexer
524  * - mux_arch: The information on the multiplexer architecture
525  * - in_prob: Array of input signal probabilities
526  * - in_dens: Array of input transition densitites
527  * - selected_input: The index of the input that has been statically selected
528  * - output_level_restored: Whether the output is level restored to Vdd.
529  */
531  t_mux_arch * mux_arch, float * in_prob, float * in_dens,
532  int selected_input, boolean output_level_restored, float period) {
533  float output_density;
534  float output_prob;
535  float V_out;
536  boolean found;
537  PowerSpicedComponent * callibration;
538  float scale_factor;
539  int * selector_values = (int*) my_calloc(mux_arch->levels, sizeof(int));
540 
541  assert(selected_input != OPEN);
542 
543  power_zero_usage(power_usage);
544 
545  /* Find selection index at each level */
546  found = mux_find_selector_values(selector_values, mux_arch->mux_graph_head,
547  selected_input);
548 
549  assert(found);
550 
551  /* Calculate power of the multiplexor stages, from final stage, to first stages */
552  power_usage_mux_rec(power_usage, &output_density, &output_prob, &V_out,
553  mux_arch->mux_graph_head, mux_arch, selector_values, in_prob,
554  in_dens, output_level_restored, period);
555 
556  free(selector_values);
557 
558  callibration =
560  if (callibration->is_done_callibration()) {
561  scale_factor = callibration->scale_factor(mux_arch->num_inputs,
562  mux_arch->transistor_size);
563  power_scale_usage(power_usage, scale_factor);
564  }
565 
566 }
567 
568 /**
569  * Internal function, used recursively by power_calc_mux
570  */
571 static void power_usage_mux_rec(t_power_usage * power_usage, float * out_prob,
572  float * out_dens, float * v_out, t_mux_node * mux_node,
573  t_mux_arch * mux_arch, int * selector_values,
574  float * primary_input_prob, float * primary_input_dens,
575  boolean v_out_restored, float period) {
576  int input_idx;
577  float * in_prob;
578  float * in_dens;
579  float * v_in;
580  t_power_usage sub_power_usage;
581 
582  /* Single input mux is really just a wire, and has no power.
583  * Ensure that it has no children before returning. */
584  if (mux_node->num_inputs == 1) {
585  assert(mux_node->level == 0);
586  return;
587  }
588 
589  v_in = (float*) my_calloc(mux_node->num_inputs, sizeof(float));
590  if (mux_node->level == 0) {
591  /* First level of mux - inputs are primar inputs */
592  in_prob = &primary_input_prob[mux_node->starting_pin_idx];
593  in_dens = &primary_input_dens[mux_node->starting_pin_idx];
594 
595  for (input_idx = 0; input_idx < mux_node->num_inputs; input_idx++) {
596  v_in[input_idx] = g_power_tech->Vdd;
597  }
598  } else {
599  /* Higher level of mux - inputs recursive from lower levels */
600  in_prob = (float*) my_calloc(mux_node->num_inputs, sizeof(float));
601  in_dens = (float*) my_calloc(mux_node->num_inputs, sizeof(float));
602 
603  for (input_idx = 0; input_idx < mux_node->num_inputs; input_idx++) {
604  /* Call recursively for multiplexer driving the input */
605  power_usage_mux_rec(power_usage, &in_prob[input_idx],
606  &in_dens[input_idx], &v_in[input_idx],
607  &mux_node->children[input_idx], mux_arch, selector_values,
608  primary_input_prob, primary_input_dens, FALSE, period);
609  }
610  }
611 
612  power_usage_mux_singlelevel_static(&sub_power_usage, out_prob, out_dens,
613  v_out, mux_node->num_inputs, selector_values[mux_node->level],
614  in_prob, in_dens, v_in, mux_arch->transistor_size, v_out_restored,
615  period);
616  power_add_usage(power_usage, &sub_power_usage);
617 
618  if (mux_node->level != 0) {
619  free(in_prob);
620  free(in_dens);
621  }
622 }
623 
624 /**
625  * This function calculates the power of a multistage buffer
626  * - power_usage: (Return value) Power usage of buffer
627  * - size: The size of the final buffer stage, relative to min-sized inverter
628  * - in_prob: The signal probability of the input
629  * - in_dens: The transition density of the input
630  * - level_restored: Whether this buffer must level restore the input
631  * - input_mux_size: If fed by a mux, the size of this mutliplexer
632  */
633 void power_usage_buffer(t_power_usage * power_usage, float size, float in_prob,
634  float in_dens, boolean level_restorer, float period) {
635  t_power_usage sub_power_usage;
636  int i, num_stages;
637  float stage_effort;
638  float stage_inv_size;
639  float stage_in_prob;
640  float input_dyn_power;
641  float scale_factor;
642  PowerSpicedComponent * callibration;
643 
644  power_zero_usage(power_usage);
645 
646  if (size == 0.) {
647  return;
648  }
649 
650  num_stages = power_calc_buffer_num_stages(size,
652  stage_effort = calc_buffer_stage_effort(num_stages, size);
653 
654  stage_in_prob = in_prob;
655  for (i = 0; i < num_stages; i++) {
656  stage_inv_size = pow(stage_effort, i);
657 
658  if (i == 0) {
659  if (level_restorer) {
660  /* Sense Buffer */
661  power_usage_level_restorer(&sub_power_usage, &input_dyn_power,
662  in_dens, stage_in_prob, period);
663  } else {
664  power_usage_inverter(&sub_power_usage, in_dens, stage_in_prob,
665  stage_inv_size, period);
666  }
667  } else {
668  power_usage_inverter(&sub_power_usage, in_dens, stage_in_prob,
669  stage_inv_size, period);
670  }
671  power_add_usage(power_usage, &sub_power_usage);
672 
673  stage_in_prob = 1 - stage_in_prob;
674  }
675 
676  /* Callibration */
677  if (level_restorer) {
678  callibration =
680  } else {
681  callibration =
683  }
684 
685  if (callibration->is_done_callibration()) {
686  scale_factor = callibration->scale_factor(1, size);
687  power_scale_usage(power_usage, scale_factor);
688  }
689 
690  /* Short-circuit: add a factor to dynamic power, but the factor is not in addition to the input power
691  * Need to subtract input before adding factor - this matters for small buffers
692  */
693  /*power_usage->dynamic += (power_usage->dynamic - input_dyn_power)
694  * power_calc_buffer_sc(num_stages, stage_effort, level_restorer,
695  input_mux_size); */
696 }
697 
int num_inputs
Definition: power.h:281
t_power_tech * g_power_tech
Definition: power.c:67
t_power_arch * g_power_arch
Definition: power.c:68
void power_usage_mux_multilevel(t_power_usage *power_usage, t_mux_arch *mux_arch, float *in_prob, float *in_dens, int selected_input, boolean output_level_restored, float period)
float power_component_get_usage_sum(e_power_component_type component_idx)
int net_num
Definition: vpr_types.h:917
void power_usage_mux_singlelevel_static(t_power_usage *power_usage, float *out_prob, float *out_dens, float *v_out, int num_inputs, int selected_idx, float *in_prob, float *in_dens, float *v_in, float transistor_size, boolean v_out_restored, float period)
struct s_rr_node * rr_graph
Definition: vpr_types.h:188
int ipow(int base, int exp)
Definition: util.c:775
PowerSpicedComponent ** component_callibration
Definition: power.h:237
void power_usage_level_restorer(t_power_usage *power_usage, float *dyn_power_in, float in_dens, float in_prob, float period)
float logical_effort_factor
t_power_commonly_used * g_power_commonly_used
Definition: power.c:66
void power_usage_local_interc_mux(t_power_usage *power_usage, t_pb *pb, t_interconnect_pins *interc_pins)
void power_usage_ff(t_power_usage *power_usage, float size, float D_prob, float D_dens, float Q_prob, float Q_dens, float clk_prob, float clk_dens, float period)
void * my_calloc(size_t nelem, size_t size)
Definition: util.c:132
int power_calc_buffer_num_stages(float final_stage_size, float desired_stage_effort)
Definition: power_util.c:179
t_interconnect * interconnect
e_power_component_type
void power_components_uninit(void)
Definition: util.h:12
t_solution_inf g_solution_inf
Definition: power.c:64
struct s_pb_graph_pin *** output_pins
t_mux_arch * power_get_mux_arch(int num_mux_inputs, float transistor_size)
Definition: power_util.c:490
void power_components_init(void)
float pin_prob(t_pb *pb, t_pb_graph_pin *pin)
Definition: power_util.c:96
void power_add_usage(t_power_usage *dest, const t_power_usage *src)
Definition: power_util.c:49
int level
Definition: power.h:295
void power_zero_usage(t_power_usage *power_usage)
Definition: power_util.c:44
enum e_interconnect type
void power_usage_MUX2_transmission(t_power_usage *power_usage, float size, float *in_dens, float *in_prob, float sel_dens, float out_dens, float period)
int starting_pin_idx
Definition: power.h:294
float transistor_size
Definition: power.h:282
static void power_usage_mux_rec(t_power_usage *power_usage, float *out_prob, float *out_dens, float *v_out, t_mux_node *mux_node, t_mux_arch *mux_arch, int *selector_values, float *primary_input_prob, float *primary_input_dens, boolean v_out_restored, float period)
float T_crit
Definition: power.h:83
float pin_dens(t_pb *pb, t_pb_graph_pin *pin)
Definition: power_util.c:81
void power_component_add_usage(t_power_usage *power_usage, e_power_component_type component_idx)
int levels
Definition: power.h:280
void power_usage_lut(t_power_usage *power_usage, int lut_size, float transistor_size, char *SRAM_values, float *input_prob, float *input_dens, float period)
void power_usage_mux_singlelevel_dynamic(t_power_usage *power_usage, int num_inputs, float out_density, float v_out, float *in_prob, float *in_dens, float *v_in, float sel_dens, float sel_prob, float transistor_size, float period)
float power_sum_usage(t_power_usage *power_usage)
Definition: power_util.c:59
float Vdd
Definition: power.h:132
Definition: slre.c:50
struct s_pb_graph_pin *** input_pins
int num_inputs
Definition: power.h:292
void power_scale_usage(t_power_usage *power_usage, float scale_factor)
Definition: power_util.c:54
void power_component_get_usage(t_power_usage *power_usage, e_power_component_type component_idx)
boolean mux_find_selector_values(int *selector_values, t_mux_node *mux_node, int selected_input_pin)
Definition: power_util.c:119
t_mux_node * mux_graph_head
Definition: power.h:284
t_power_usage power_usage
void power_usage_buffer(t_power_usage *power_usage, float size, float in_prob, float in_dens, boolean level_restorer, float period)
t_power_components g_power_by_component
float power_calc_mux_v_out(int num_inputs, float transistor_size, float v_in, float in_prob_avg)
float mux_transistor_size
float scale_factor(int num_inputs, float transistor_size)
t_interconnect_power * interconnect_power
float calc_buffer_stage_effort(int N, float final_stage_size)
Definition: power_util.c:204
t_mux_node * children
Definition: power.h:293
Definition: util.h:12
t_power_usage * components
void power_usage_inverter(t_power_usage *power_usage, float in_dens, float in_prob, float size, float period)