40 float transistor_size);
48 float transistor_size);
56 boolean pin_is_an_input);
62 int * fanout,
float * wirelength);
71 double transistor_cnt = 0.;
83 buffer_size =
max(1.0F, buffer_size);
88 transistor_cnt += CLB_inputs
93 return transistor_cnt;
105 double transistor_cnt = 0.;
112 for (stage_idx = 0; stage_idx < stages; stage_idx++) {
114 stage_size *= effort;
117 return transistor_cnt;
125 double transistor_cnt = 0.;
131 for (lvl_idx = 0; lvl_idx < mux_arch->
levels; lvl_idx++) {
132 max_inputs[lvl_idx] = 0.;
136 for (lvl_idx = 0; lvl_idx < mux_arch->
levels; lvl_idx++) {
138 transistor_cnt += ceil(log(max_inputs[lvl_idx]) / log((
double) 2.0))
158 return transistor_cnt;
166 float * max_inputs) {
168 max_inputs[mux_node->
level] =
max(max_inputs[mux_node->
level],
171 if (mux_node->
level != 0) {
174 for (child_idx = 0; child_idx < mux_node->
num_inputs; child_idx++) {
185 float transistor_size) {
187 double transistor_cnt = 0.;
190 for (input_idx = 0; input_idx < mux_node->
num_inputs; input_idx++) {
192 transistor_cnt +=
power_MTAs(transistor_size);
195 if (mux_node->
level != 0) {
197 &mux_node->
children[input_idx], transistor_size);
202 return transistor_cnt;
209 double transistor_cnt = 0.;
211 switch (interc->
type) {
234 return transistor_cnt;
238 float transistors_per_tile;
265 double transistor_cnt = 0.;
273 return transistor_cnt;
291 double tc_children_max = 0;
292 double tc_interc_max = 0;
293 boolean ignore_interc =
FALSE;
304 for (mode_idx = 0; mode_idx < pb_type->
num_modes; mode_idx++) {
306 double tc_children = 0;
307 double tc_interc = 0;
316 ignore_interc =
TRUE;
320 if (!ignore_interc) {
326 tc_interc_max =
max(tc_interc_max, tc_interc);
332 for (pb_idx = 0; pb_idx < child_type->
num_pb; pb_idx++) {
339 tc_children_max =
max(tc_children_max, tc_children);
346 return (tc_interc_max + tc_children_max);
353 double transistor_cnt = 0.;
354 double transistors_per_buf_mux = 0.;
367 for (seg_idx = 0; seg_idx < arch->
num_segments; seg_idx++) {
376 transistor_cnt += transistors_per_buf_mux * 2 * freq_frac
381 return transistor_cnt;
388 double transistor_cnt;
390 if (strcmp(pb_type->
blif_model,
".names") == 0) {
394 }
else if (strcmp(pb_type->
blif_model,
".latch") == 0) {
401 sprintf(msg,
"No transistor counter function for BLIF model: %s",
407 return transistor_cnt;
418 double transistor_cnt = 0.;
424 transistor_cnt += 1.0;
429 return transistor_cnt;
436 float transistor_size) {
437 double transistor_cnt = 0.;
441 transistor_cnt += (double) LUT_inputs
448 for (level_idx = 0; level_idx < LUT_inputs; level_idx++) {
451 transistor_cnt += (1 << (LUT_inputs - level_idx))
459 if (((level_idx % 2 == 1) && (level_idx != LUT_inputs - 2))
460 || (level_idx == LUT_inputs - 1)) {
465 return transistor_cnt;
469 double transistor_cnt = 0.;
474 return transistor_cnt;
478 double transistor_cnt = 0.;
486 return transistor_cnt;
493 double transistor_cnt = 0.;
501 return transistor_cnt;
519 for (type_idx = 0; type_idx <
num_types; type_idx++) {
527 int port_idx, pin_idx;
528 int mode_idx, type_idx, pb_idx;
529 boolean size_buffers_and_wires =
TRUE;
548 for (pb_idx = 0; pb_idx < num_pb; pb_idx++) {
564 size_buffers_and_wires =
FALSE;
569 size_buffers_and_wires =
FALSE;
573 if (size_buffers_and_wires) {
603 int * fanout,
float * wirelength) {
605 float this_interc_sidelength;
608 switch (interc->
type) {
617 this_interc_sidelength = sqrt(
633 *wirelength = this_interc_sidelength;
645 boolean pin_is_an_input) {
653 float this_pb_length;
656 float wirelength_out = 0;
657 float wirelength_in = 0;
660 float wirelength_tmp;
662 float this_pb_interc_sidelength = 0;
663 float parent_pb_interc_sidelength = 0;
664 boolean top_level_pb;
673 this_pb_interc_sidelength = sqrt(
678 parent_pb_interc_sidelength = 0.;
680 top_level_pb =
FALSE;
681 parent_pb_interc_sidelength =
707 for (i = 0; i < list_cnt; i++) {
726 if (pin_is_an_input) {
730 int * fanout_per_mode;
731 float * wirelength_out_per_mode;
738 for (i = 0; i < list_cnt; i++) {
744 fanout_per_mode[mode_idx] += fanout_tmp;
745 wirelength_out_per_mode[mode_idx] += wirelength_tmp;
752 for (i = 0; i < this_pb_type->
num_modes; i++) {
753 fanout =
max(fanout, fanout_per_mode[i]);
754 wirelength_out =
max(wirelength_out, wirelength_out_per_mode[i]);
756 if (wirelength_out != 0) {
758 * this_pb_interc_sidelength;
761 free(fanout_per_mode);
762 free(wirelength_out_per_mode);
767 * parent_pb_interc_sidelength;
779 assert(list_cnt == 0);
784 for (i = 0; i < list_cnt; i++) {
787 fanout += fanout_tmp;
788 wirelength_out += wirelength_tmp;
790 if (wirelength_out != 0) {
792 * parent_pb_interc_sidelength;
797 * this_pb_interc_sidelength;
816 this_pb_length = sqrt(
825 * (wirelength_in + wirelength_out);
t_interconnect * interconnect
t_pb_graph_pin ** clock_pins
t_power_tech * g_power_tech
enum e_pb_type_class class_type
t_power_arch * g_power_arch
t_port_power * port_power
struct s_pb_type * pb_type_children
union s_port_power::@5 wire
struct s_pb_graph_node * parent_pb_graph_node
e_power_estimation_method estimation_method
static double power_count_transistors_mux_node(t_mux_node *mux_node, float transistor_size)
static void power_size_pb_rec(t_pb_graph_node *pb_node)
float logical_effort_factor
float power_buffer_size_from_logical_effort(float C_load)
struct s_pb_graph_edge ** output_edges
t_power_commonly_used * g_power_commonly_used
float transistor_cnt_buffers
static double power_transistors_per_tile(t_arch *arch)
t_pb_graph_node_power * pb_node_power
void * my_calloc(size_t nelem, size_t size)
t_pb_type_power * pb_type_power
int power_calc_buffer_num_stages(float final_stage_size, float desired_stage_effort)
static double power_MTAs(float size)
float transistor_cnt_pb_children
void power_sizing_init(t_arch *arch)
double power_transistor_area(double num_MTAs)
t_pb_graph_pin ** output_pins
float transistors_per_SRAM_bit
t_interconnect * interconnect
t_solution_inf g_solution_inf
float local_interc_factor
t_mux_arch * power_get_mux_arch(int num_mux_inputs, float transistor_size)
int max_seg_to_IPIN_fanout
boolean power_method_is_transistor_level(e_power_estimation_method estimation_method)
static double power_count_transistors_mux(t_mux_arch *mux_arch)
double power_count_transistors_buffer(float buffer_size)
float transistor_cnt_interc
#define MAX_CHANNEL_WIDTH
static double power_count_transistors_FF(float size)
struct s_pb_graph_node * parent_node
static double power_count_transistors_pb_node(t_pb_graph_node *pb_node)
struct s_pb_graph_node *** child_pb_graph_nodes
static double power_count_transistors_switchbox(t_arch *arch)
static double power_count_transistors_levr()
float LUT_transistor_size
struct s_pb_type * pb_type
static void power_size_pin_to_interconnect(t_interconnect *interc, int *fanout, float *wirelength)
static double power_count_transistor_SRAM_bit(void)
static void power_size_pin_buffers_and_wires(t_pb_graph_pin *pin, boolean pin_is_an_input)
static void power_size_pb(void)
static void * my_realloc(void *memblk, int ibytes)
e_power_buffer_type buffer_type
static double power_count_transistors_interc(t_interconnect *interc)
static double power_transistors_for_pb_node(t_pb_graph_node *pb_node)
static double power_count_transistors_LUT(int LUT_inputs, float transistor_size)
t_pb_graph_node * pb_graph_head
struct s_type_descriptor * type_descriptors
e_power_wire_type wire_type
static double power_count_transistors_inv(float size)
t_mux_node * mux_graph_head
float mux_transistor_size
static void power_mux_node_max_inputs(t_mux_node *mux_node, float *max_inputs)
t_interconnect_power * interconnect_power
static double power_MTAs_L(float L_size)
static double power_count_transistors_trans_gate(float size)
t_pb_graph_pin_power * pin_power
static double power_count_transistors_primitive(t_pb_type *pb_type)
t_pb_graph_pin ** input_pins
float calc_buffer_stage_effort(int N, float final_stage_size)
void power_log_msg(e_power_log_type log_type, char *msg)
static double power_count_transistors_connectionbox(void)