Skip to content

Commit 2d75180

Browse files
committed
avoid updating move statistics if block type is not specified
1 parent 1fac38b commit 2d75180

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

vpr/src/place/place.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,8 +1613,9 @@ static e_move_result try_swap(const t_annealing_state* state,
16131613
/* Update clb data structures since we kept the move. */
16141614
commit_move_blocks(blocks_affected);
16151615

1616-
++move_type_stat.accepted_moves[(move_blk_type.index * (placer_opts.place_static_move_prob.size())) + (int)move_type];
1617-
1616+
if (move_blk_type.index != -1) { //if the agent proposed the block type, then collect the block type stat
1617+
++move_type_stat.accepted_moves[(move_blk_type.index * (placer_opts.place_static_move_prob.size())) + (int)move_type];
1618+
}
16181619
if (noc_opts.noc) {
16191620
commit_noc_costs(number_of_affected_noc_traffic_flows);
16201621

@@ -1670,8 +1671,9 @@ static e_move_result try_swap(const t_annealing_state* state,
16701671
revert_td_cost(blocks_affected);
16711672
}
16721673

1673-
++move_type_stat.rejected_moves[(move_blk_type.index * (placer_opts.place_static_move_prob.size())) + (int)move_type];
1674-
1674+
if (move_blk_type.index != -1) { //if the agent proposed the block type, then collect the block type stat
1675+
++move_type_stat.rejected_moves[(move_blk_type.index * (placer_opts.place_static_move_prob.size())) + (int)move_type];
1676+
}
16751677
/* Revert the traffic flow routes within the NoC*/
16761678
if (noc_opts.noc) {
16771679
revert_noc_traffic_flow_routes(blocks_affected);

0 commit comments

Comments
 (0)