@@ -497,9 +497,23 @@ std::set<t_pl_loc> determine_locations_emptied_by_move(t_pl_blocks_to_be_moved&
497
497
return empty_locs;
498
498
}
499
499
500
+ #ifndef VTR_ENABLE_DEBUG_LOGGING
500
501
void enable_placer_debug (const t_placer_opts& placer_opts,
501
- int blk_id_num,
502
- const std::vector<size_t >& net_id_nums) {
502
+ ClusterBlockId blk_id) {
503
+ if (!blk_id.is_valid ()) {
504
+ return ;
505
+ }
506
+
507
+ int blk_id_num = (int ) size_t (blk_id);
508
+ // Get the nets connected to the block
509
+ const auto & cluster_ctx = g_vpr_ctx.clustering ();
510
+ const auto & cluster_blk_pb_type = cluster_ctx.clb_nlist .block_type (blk_id)->pb_type ;
511
+ int block_num_pins = cluster_blk_pb_type ? cluster_blk_pb_type->num_pins : 0 ;
512
+ std::vector<ClusterNetId> block_nets (block_num_pins, ClusterNetId::INVALID ());
513
+ for (int ipin = 0 ; ipin < block_num_pins; ipin++) {
514
+ block_nets[ipin] = cluster_ctx.clb_nlist .block_net (blk_id, ipin);
515
+ }
516
+
503
517
bool & f_placer_debug = g_vpr_ctx.mutable_placement ().f_placer_debug ;
504
518
505
519
bool active_blk_debug = (placer_opts.placer_debug_block >= -1 );
@@ -517,21 +531,22 @@ void enable_placer_debug(const t_placer_opts& placer_opts,
517
531
if (placer_opts.placer_debug_net == -1 ) {
518
532
match_net = true ;
519
533
} else {
520
- for (size_t net_id_num : net_id_nums) {
521
- if ((int )net_id_num != OPEN && placer_opts.placer_debug_net == (int )net_id_num) {
522
- match_net = true ;
523
- break ;
534
+ for (const auto & net_id : block_nets) {
535
+ if (net_id.is_valid ()) {
536
+ int net_id_num = (int ) size_t (net_id);
537
+ if (placer_opts.placer_debug_net == net_id_num) {
538
+ match_net = true ;
539
+ break ;
540
+ }
524
541
}
525
542
}
526
543
}
527
544
528
545
if (active_blk_debug) f_placer_debug &= match_blk;
529
546
if (active_net_debug) f_placer_debug &= match_net;
530
547
531
- #ifndef VTR_ENABLE_DEBUG_LOGGING
532
- VTR_LOGV_WARN (f_placer_debug, " Limited placer debug output provided since compiled without VTR_ENABLE_DEBUG_LOGGING defined\n " );
533
- #endif
534
548
}
549
+ #endif
535
550
536
551
ClusterBlockId propose_block_to_move (const t_placer_opts& placer_opts,
537
552
int & logical_blk_type_index,
@@ -559,16 +574,9 @@ ClusterBlockId propose_block_to_move(const t_placer_opts& placer_opts,
559
574
b_from = pick_from_block (logical_blk_type_index);
560
575
}
561
576
}
562
-
563
- if (b_from) {
564
- const auto & cluster_blk_pb_type = cluster_ctx.clb_nlist .block_type (b_from)->pb_type ;
565
- int block_num_pins = cluster_blk_pb_type ? cluster_blk_pb_type->num_pins : 0 ;
566
- std::vector<size_t > block_nets (block_num_pins, OPEN);
567
- for (int ipin = 0 ; ipin < block_num_pins; ipin++) {
568
- block_nets[ipin] = (size_t )cluster_ctx.clb_nlist .block_net (b_from, ipin);
569
- }
570
- enable_placer_debug (placer_opts, size_t (b_from), block_nets);
571
- }
577
+ #ifndef VTR_ENABLE_DEBUG_LOGGING
578
+ enable_placer_debug (placer_opts, b_from);
579
+ #endif
572
580
573
581
return b_from;
574
582
}
0 commit comments