@@ -824,26 +824,26 @@ static void power_usage_routing(t_power_usage* power_usage,
824
824
for (t_edge_size edge_idx = 0 ; edge_idx < node.num_edges (); edge_idx++) {
825
825
const auto & next_node_id = node.edge_sink_node (edge_idx);
826
826
if (next_node_id != OPEN) {
827
- auto next_node = device_ctx.rr_nodes [next_node_id];
828
827
t_rr_node_power* next_node_power = &rr_node_power[next_node_id];
829
828
830
829
switch (rr_graph.node_type (RRNodeId (next_node_id))) {
831
830
case CHANX:
832
831
case CHANY:
833
- case IPIN:
832
+ case IPIN: {
834
833
if (next_node_power->net_num == node_power->net_num ) {
835
834
next_node_power->selected_input = next_node_power->num_inputs ;
836
835
}
837
836
next_node_power->in_dens [next_node_power->num_inputs ] = clb_net_density (node_power->net_num );
838
837
next_node_power->in_prob [next_node_power->num_inputs ] = clb_net_prob (node_power->net_num );
839
838
next_node_power->num_inputs ++;
840
- if (next_node_power->num_inputs > next_node.fan_in ()) {
839
+ const t_edge_size next_node_fan_in = rr_graph.node_fan_in (RRNodeId (next_node_id));
840
+ if (next_node_power->num_inputs > next_node_fan_in) {
841
841
VTR_LOG (" %d %d\n " , next_node_power->num_inputs ,
842
- next_node. fan_in () );
842
+ next_node_fan_in );
843
843
fflush (nullptr );
844
844
VTR_ASSERT (0 );
845
845
}
846
- break ;
846
+ } break ;
847
847
default :
848
848
/* Do nothing */
849
849
break ;
@@ -865,6 +865,7 @@ static void power_usage_routing(t_power_usage* power_usage,
865
865
int switchbox_fanout;
866
866
// float C_per_seg_split;
867
867
int wire_length;
868
+ const t_edge_size node_fan_in = rr_graph.node_fan_in (RRNodeId (rr_node_idx));
868
869
869
870
switch (rr_graph.node_type (RRNodeId (rr_node_idx))) {
870
871
case SOURCE:
@@ -877,13 +878,13 @@ static void power_usage_routing(t_power_usage* power_usage,
877
878
* - Driver (accounted for at end of CHANX/Y - see below)
878
879
* - Multiplexor */
879
880
880
- if (node. fan_in () ) {
881
+ if (node_fan_in ) {
881
882
VTR_ASSERT (node_power->in_dens );
882
883
VTR_ASSERT (node_power->in_prob );
883
884
884
885
/* Multiplexor */
885
886
power_usage_mux_multilevel (&sub_power_usage,
886
- power_get_mux_arch (node. fan_in () ,
887
+ power_get_mux_arch (node_fan_in ,
887
888
power_ctx.arch ->mux_transistor_size ),
888
889
node_power->in_prob , node_power->in_dens ,
889
890
node_power->selected_input , true ,
@@ -912,11 +913,11 @@ static void power_usage_routing(t_power_usage* power_usage,
912
913
int seg_index = device_ctx.rr_indexed_data [node.cost_index ()].seg_index ;
913
914
C_wire = wire_length * device_ctx.rr_segments [seg_index].Cmetal ;
914
915
// (double)power_ctx.commonly_used->tile_length);
915
- VTR_ASSERT (node_power->selected_input < node. fan_in () );
916
+ VTR_ASSERT (node_power->selected_input < node_fan_in );
916
917
917
918
/* Multiplexor */
918
919
power_usage_mux_multilevel (&sub_power_usage,
919
- power_get_mux_arch (node. fan_in () ,
920
+ power_get_mux_arch (node_fan_in ,
920
921
power_ctx.arch ->mux_transistor_size ),
921
922
node_power->in_prob , node_power->in_dens ,
922
923
node_power->selected_input , true , power_ctx.solution_inf .T_crit );
@@ -1173,10 +1174,10 @@ void power_pb_pins_uninit() {
1173
1174
}
1174
1175
1175
1176
void power_routing_init (const t_det_routing_arch* routing_arch) {
1176
- int max_fanin;
1177
- int max_IPIN_fanin;
1178
- int max_seg_to_IPIN_fanout;
1179
- int max_seg_to_seg_fanout;
1177
+ t_edge_size max_fanin;
1178
+ t_edge_size max_IPIN_fanin;
1179
+ t_edge_size max_seg_to_IPIN_fanout;
1180
+ t_edge_size max_seg_to_seg_fanout;
1180
1181
auto & power_ctx = g_vpr_ctx.mutable_power ();
1181
1182
auto & device_ctx = g_vpr_ctx.device ();
1182
1183
const auto & rr_graph = device_ctx.rr_graph ;
@@ -1205,20 +1206,20 @@ void power_routing_init(const t_det_routing_arch* routing_arch) {
1205
1206
max_seg_to_seg_fanout = 0 ;
1206
1207
max_seg_to_IPIN_fanout = 0 ;
1207
1208
for (size_t rr_node_idx = 0 ; rr_node_idx < device_ctx.rr_nodes .size (); rr_node_idx++) {
1208
- int fanout_to_IPIN = 0 ;
1209
- int fanout_to_seg = 0 ;
1209
+ t_edge_size fanout_to_IPIN = 0 ;
1210
+ t_edge_size fanout_to_seg = 0 ;
1210
1211
auto node = device_ctx.rr_nodes [rr_node_idx];
1211
1212
t_rr_node_power* node_power = &rr_node_power[rr_node_idx];
1213
+ const t_edge_size node_fan_in = rr_graph.node_fan_in (RRNodeId (rr_node_idx));
1212
1214
1213
1215
switch (rr_graph.node_type (RRNodeId (rr_node_idx))) {
1214
1216
case IPIN:
1215
- max_IPIN_fanin = std::max (max_IPIN_fanin,
1216
- static_cast <int >(node.fan_in ()));
1217
- max_fanin = std::max (max_fanin, static_cast <int >(node.fan_in ()));
1217
+ max_IPIN_fanin = std::max (max_IPIN_fanin, node_fan_in);
1218
+ max_fanin = std::max (max_fanin, node_fan_in);
1218
1219
1219
- node_power->in_dens = (float *)vtr::calloc (node. fan_in () ,
1220
+ node_power->in_dens = (float *)vtr::calloc (node_fan_in ,
1220
1221
sizeof (float ));
1221
- node_power->in_prob = (float *)vtr::calloc (node. fan_in () ,
1222
+ node_power->in_prob = (float *)vtr::calloc (node_fan_in ,
1222
1223
sizeof (float ));
1223
1224
break ;
1224
1225
case CHANX:
@@ -1233,11 +1234,11 @@ void power_routing_init(const t_det_routing_arch* routing_arch) {
1233
1234
max_seg_to_IPIN_fanout = std::max (max_seg_to_IPIN_fanout,
1234
1235
fanout_to_IPIN);
1235
1236
max_seg_to_seg_fanout = std::max (max_seg_to_seg_fanout, fanout_to_seg);
1236
- max_fanin = std::max (max_fanin, static_cast < int >(node. fan_in ()) );
1237
+ max_fanin = std::max (max_fanin, node_fan_in );
1237
1238
1238
- node_power->in_dens = (float *)vtr::calloc (node. fan_in () ,
1239
+ node_power->in_dens = (float *)vtr::calloc (node_fan_in ,
1239
1240
sizeof (float ));
1240
- node_power->in_prob = (float *)vtr::calloc (node. fan_in () ,
1241
+ node_power->in_prob = (float *)vtr::calloc (node_fan_in ,
1241
1242
sizeof (float ));
1242
1243
break ;
1243
1244
default :
@@ -1361,14 +1362,13 @@ bool power_uninit() {
1361
1362
bool error = false ;
1362
1363
1363
1364
for (size_t rr_node_idx = 0 ; rr_node_idx < device_ctx.rr_nodes .size (); rr_node_idx++) {
1364
- auto node = device_ctx.rr_nodes [rr_node_idx];
1365
1365
t_rr_node_power* node_power = &rr_node_power[rr_node_idx];
1366
1366
1367
1367
switch (rr_graph.node_type (RRNodeId (rr_node_idx))) {
1368
1368
case CHANX:
1369
1369
case CHANY:
1370
1370
case IPIN:
1371
- if (node. fan_in ( )) {
1371
+ if (rr_graph. node_fan_in ( RRNodeId (rr_node_idx) )) {
1372
1372
free (node_power->in_dens );
1373
1373
free (node_power->in_prob );
1374
1374
}
0 commit comments