VPR-7.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
power_cmos_tech.h File Reference
#include "power.h"
+ Include dependency graph for power_cmos_tech.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void power_tech_init (char *cmos_tech_behavior_filepath)
 
boolean power_find_transistor_info (t_transistor_size_inf **lower, t_transistor_size_inf **upper, e_tx_type type, float size)
 
void power_find_mux_volt_inf (t_power_mux_volt_pair **lower, t_power_mux_volt_pair **upper, t_power_mux_volt_inf *volt_inf, float v_in)
 
void power_find_nmos_leakage (t_power_nmos_leakage_inf *nmos_leakage_info, t_power_nmos_leakage_pair **lower, t_power_nmos_leakage_pair **upper, float v_ds)
 
void power_find_buffer_strength_inf (t_power_buffer_strength_inf **lower, t_power_buffer_strength_inf **upper, t_power_buffer_size_inf *size_inf, float stage_gain)
 
void power_find_buffer_sc_levr (t_power_buffer_sc_levr_inf **lower, t_power_buffer_sc_levr_inf **upper, t_power_buffer_strength_inf *buffer_sc, int input_mux_size)
 

Function Documentation

void power_find_buffer_sc_levr ( t_power_buffer_sc_levr_inf **  lower,
t_power_buffer_sc_levr_inf **  upper,
t_power_buffer_strength_inf buffer_strength,
int  input_mux_size 
)

This function searches for short-circuit current information for a level-restoring buffer, based on the size of the multiplexer driving the input

  • lower: (Return value) The lower-bound matching record
  • upper: (Return value) The upper-bound matching record
  • buffer_strength: The set of records to search withing, which are for a specific buffer size/strength
  • input_mux_size: The input mux size to search for

Definition at line 656 of file power_cmos_tech.c.

658  {
661  char msg[1024];
662  int max_size;
663 
664  assert(input_mux_size >= 1);
665 
666  key.mux_size = input_mux_size;
667 
668  g_buffer_strength_last_searched = buffer_strength;
669  found = (t_power_buffer_sc_levr_inf*) bsearch(&key,
670  buffer_strength->sc_levr_inf, buffer_strength->num_levr_entries,
672 
673  max_size = buffer_strength->sc_levr_inf[buffer_strength->num_levr_entries
674  - 1].mux_size;
675  if (input_mux_size > max_size) {
676  /* Input mux too large */
677  assert(
678  found
679  == &buffer_strength->sc_levr_inf[buffer_strength->num_levr_entries
680  - 1]);
681  sprintf(msg,
682  "Using buffer driven by mux of size '%d', which is larger than the largest modeled size (%d) in the technology behavior file.",
683  input_mux_size, max_size);
685  *lower = found;
686  *upper = NULL;
687  } else {
688  *lower = found;
689  *upper = found + 1;
690  }
691 }
static int power_compare_buffer_sc_levr(const void *key_void, const void *elem_void)
t_power_buffer_sc_levr_inf * sc_levr_inf
Definition: power.h:181
static t_power_buffer_strength_inf * g_buffer_strength_last_searched
void power_log_msg(e_power_log_type log_type, char *msg)
Definition: power_util.c:67

+ Here is the call graph for this function:

void power_find_buffer_strength_inf ( t_power_buffer_strength_inf **  lower,
t_power_buffer_strength_inf **  upper,
t_power_buffer_size_inf size_inf,
float  stage_gain 
)

This function searches for the information for a given buffer strength.

  • lower: (Return value) The lower-bound matching record
  • upper: (Return value) The upper-bound matching record
  • stage_gain: The buffer strength to search for

Definition at line 619 of file power_cmos_tech.c.

621  {
624 
625  float min_size;
626  float max_size;
627 
628  min_size = size_inf->strength_inf[0].stage_gain;
629  max_size = size_inf->strength_inf[size_inf->num_strengths - 1].stage_gain;
630 
631  assert(stage_gain >= min_size && stage_gain <= max_size);
632 
633  key.stage_gain = stage_gain;
634 
635  found = (t_power_buffer_strength_inf*) bsearch(&key, size_inf->strength_inf,
636  size_inf->num_strengths, sizeof(t_power_buffer_strength_inf),
638 
639  if (stage_gain == max_size) {
640  *lower = found;
641  *upper = NULL;
642  } else {
643  *lower = found;
644  *upper = found + 1;
645  }
646 }
static int power_compare_buffer_strength(const void *key_void, const void *elem_void)
t_power_buffer_strength_inf * strength_inf
Definition: power.h:156

+ Here is the call graph for this function:

void power_find_mux_volt_inf ( t_power_mux_volt_pair **  lower,
t_power_mux_volt_pair **  upper,
t_power_mux_volt_inf volt_inf,
float  v_in 
)

This function searches for multiplexer output voltage information, based on input voltage

  • lower: (Return value) The lower-bound matching record
  • upper: (Return value) The upper-bound matching record
  • volt_inf: The set of records to search within, which are for a specific mux size
  • v_in: The input voltage to search for

Definition at line 735 of file power_cmos_tech.c.

737  {
739  t_power_mux_volt_pair * found;
740 
741  key.v_in = v_in;
742 
743  g_mux_volt_last_searched = volt_inf;
744  found = (t_power_mux_volt_pair*) bsearch(&key, volt_inf->mux_voltage_pairs,
745  volt_inf->num_voltage_pairs, sizeof(t_power_mux_volt_pair),
747  assert(found);
748 
749  if (found
750  == &volt_inf->mux_voltage_pairs[volt_inf->num_voltage_pairs - 1]) {
751  *lower = found;
752  *upper = NULL;
753  } else {
754  *lower = found;
755  *upper = found + 1;
756  }
757 }
static t_power_mux_volt_inf * g_mux_volt_last_searched
static int power_compare_voltage_pair(const void *key_void, const void *elem_void)
t_power_mux_volt_pair * mux_voltage_pairs
Definition: power.h:162

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void power_find_nmos_leakage ( t_power_nmos_leakage_inf nmos_leakage_info,
t_power_nmos_leakage_pair **  lower,
t_power_nmos_leakage_pair **  upper,
float  v_ds 
)

Definition at line 585 of file power_cmos_tech.c.

587  {
590 
591  key.v_ds = v_ds;
592 
593  g_power_searching_nmos_leakage_info = nmos_leakage_info;
594 
595  found = (t_power_nmos_leakage_pair*) bsearch(&key,
596  nmos_leakage_info->leakage_pairs,
597  nmos_leakage_info->num_leakage_pairs,
599  assert(found);
600 
601  if (found
602  == &nmos_leakage_info->leakage_pairs[nmos_leakage_info->num_leakage_pairs
603  - 1]) {
604  /* The results equal to the max voltage (Vdd) */
605  *lower = found;
606  *upper = NULL;
607  } else {
608  *lower = found;
609  *upper = found + 1;
610  }
611 }
t_power_nmos_leakage_pair * leakage_pairs
Definition: power.h:126
t_power_nmos_leakage_inf * g_power_searching_nmos_leakage_info
static int power_compare_leakage_pair(const void *key_void, const void *elem_void)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

boolean power_find_transistor_info ( t_transistor_size_inf **  lower,
t_transistor_size_inf **  upper,
e_tx_type  type,
float  size 
)

This function searches for a transistor by size

  • lower: (Return value) The lower-bound matching transistor
  • upper: (Return value) The upper-bound matching transistor
  • type: The transistor type to search for
  • size: The transistor size to search for (size = W/L)

Definition at line 509 of file power_cmos_tech.c.

510  {
511  char msg[1024];
513  t_transistor_size_inf * found;
514  t_transistor_inf * trans_info;
515  float min_size, max_size;
516  boolean error = FALSE;
517 
518  key.size = size;
519 
520  /* Find the appropriate global transistor records */
521  trans_info = NULL;
522  if (type == NMOS) {
523  trans_info = &g_power_tech->NMOS_inf;
524  } else if (type == PMOS) {
525  trans_info = &g_power_tech->PMOS_inf;
526  } else {
527  assert(0);
528  }
529 
530  /* No transistor data exists */
531  if (trans_info->size_inf == NULL) {
533  "No transistor information exists. Cannot determine transistor properties.");
534  error = TRUE;
535  return error;
536  }
537 
538  /* Make note of the transistor record we are searching in, and the bounds */
539  g_transistor_last_searched = trans_info;
540  min_size = trans_info->size_inf[0].size;
541  max_size = trans_info->size_inf[trans_info->num_size_entries - 1].size;
542 
543  found = (t_transistor_size_inf*) bsearch(&key, trans_info->size_inf,
544  trans_info->num_size_entries, sizeof(t_transistor_size_inf),
546  assert(found);
547 
548  if (size < min_size) {
549  /* Too small */
550  assert(found == &trans_info->size_inf[0]);
551  sprintf(msg,
552  "Using %s transistor of size '%f', which is smaller than the smallest modeled transistor (%f) in the technology behavior file.",
553  transistor_type_name(type), size, min_size);
555  *lower = NULL;
556  *upper = found;
557  } else if (size > max_size) {
558  /* Too large */
559  assert(
560  found
561  == &trans_info->size_inf[trans_info->num_size_entries
562  - 1]);
563  sprintf(msg,
564  "Using %s transistor of size '%f', which is larger than the largest modeled transistor (%f) in the technology behavior file.",
565  transistor_type_name(type), size, max_size);
567  *lower = found;
568  *upper = NULL;
569  } else {
570  *lower = found;
571  *upper = found + 1;
572  }
573 
574  return error;
575 }
t_power_tech * g_power_tech
Definition: power.c:67
Definition: power.h:89
t_transistor_size_inf * size_inf
Definition: power.h:113
static t_transistor_inf * g_transistor_last_searched
t_transistor_inf PMOS_inf
Definition: power.h:138
static int power_compare_transistor_size(const void *key_void, const void *elem_void)
Definition: util.h:12
Definition: power.h:89
int num_size_entries
Definition: power.h:112
t_transistor_inf NMOS_inf
Definition: power.h:137
char * transistor_type_name(e_tx_type type)
Definition: power_util.c:71
Definition: util.h:12
void power_log_msg(e_power_log_type log_type, char *msg)
Definition: power_util.c:67

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void power_tech_init ( char *  cmos_tech_behavior_filepath)

This file provides functions relating to the cmos technology. It includes functions to read the transistor characteristics from the xml file into data structures, and functions to search within these data structures.

Definition at line 68 of file power_cmos_tech.c.

68  {
69  power_tech_load_xml_file(cmos_tech_behavior_filepath);
70 }
static void power_tech_load_xml_file(char *cmos_tech_behavior_filepath)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: