@@ -79,24 +79,28 @@ static double power_count_transistors_connectionbox() {
79
79
auto & power_ctx = g_vpr_ctx.power ();
80
80
81
81
auto type = find_most_common_block_type (device_ctx.grid );
82
- VTR_ASSERT (type->pb_graph_head ->num_input_ports == 1 );
83
- inputs = type->pb_graph_head ->num_input_pins [0 ];
84
-
85
- /* Buffers from Tracks */
86
- buffer_size = power_ctx.commonly_used ->max_seg_to_IPIN_fanout
87
- * (power_ctx.commonly_used ->NMOS_1X_C_d
88
- / power_ctx.commonly_used ->INV_1X_C_in )
89
- / power_ctx.arch ->logical_effort_factor ;
90
- buffer_size = std::max (1 .0F , buffer_size);
91
- transistor_cnt += power_ctx.solution_inf .channel_width
92
- * power_count_transistors_buffer (buffer_size);
93
-
94
- /* Muxes to IPINs */
95
- transistor_cnt += inputs
96
- * power_count_transistors_mux (
97
- power_get_mux_arch (power_ctx.commonly_used ->max_IPIN_fanin ,
98
- power_ctx.arch ->mux_transistor_size ));
99
82
83
+ // For each port on the most common block, look at the number of
84
+ // input pins this port has and estimate the transistor count based
85
+ // on the size muxes that drive these input pins.
86
+ for (int i=0 ; i < type->pb_graph_head ->num_input_ports ; i++) {
87
+ inputs = type->pb_graph_head ->num_input_pins [i];
88
+
89
+ /* Buffers from Tracks */
90
+ buffer_size = power_ctx.commonly_used ->max_seg_to_IPIN_fanout
91
+ * (power_ctx.commonly_used ->NMOS_1X_C_d
92
+ / power_ctx.commonly_used ->INV_1X_C_in )
93
+ / power_ctx.arch ->logical_effort_factor ;
94
+ buffer_size = std::max (1 .0F , buffer_size);
95
+ transistor_cnt += power_ctx.solution_inf .channel_width
96
+ * power_count_transistors_buffer (buffer_size);
97
+
98
+ /* Muxes to IPINs */
99
+ transistor_cnt += inputs
100
+ * power_count_transistors_mux (
101
+ power_get_mux_arch (power_ctx.commonly_used ->max_IPIN_fanin ,
102
+ power_ctx.arch ->mux_transistor_size ));
103
+ }
100
104
return transistor_cnt;
101
105
}
102
106
0 commit comments