@@ -423,7 +423,9 @@ int NegotiationLegalizer::negotiationIter(std::vector<int>& activeCells,
423423 sortByNegotiationOrder (activeCells);
424424 }
425425
426- if (logger_->debugCheck (utl::DPL , " negotiation_runtime" , 1 )) {
426+ // Emit runtime profiling only on iterations that also print a table row
427+ // (first 10, then every 10th), to keep the two outputs aligned.
428+ if (print_row && logger_->debugCheck (utl::DPL , " negotiation_runtime" , 1 )) {
427429 const double total_ms = total_iter_timer.elapsed () * 1e3 ;
428430 auto pct = [total_ms](double ms_val) {
429431 return total_ms > 0 ? 100.0 * ms_val / total_ms : 0.0 ;
@@ -659,9 +661,13 @@ std::pair<int, int> NegotiationLegalizer::findBestLocation(int cell_idx,
659661 const std::vector<int > extended_search_rows = collectNearestValidRows (
660662 cell, cell.init_y , cell.init_x , row_search_window_, row_search_cap);
661663
662- static int neg_search_print_count = 0 ;
663- if (neg_search_print_count < 50 ) {
664- ++neg_search_print_count;
664+ // Print diagnostics for the first 2 cells of each distinct height, so we
665+ // get coverage across all row heights rather than just the first 50 cells
666+ // (which tend to share one height).
667+ static std::unordered_map<int , int > neg_search_print_count_by_height;
668+ int & height_print_count = neg_search_print_count_by_height[cell.height ];
669+ if (height_print_count < 2 ) {
670+ ++height_print_count;
665671 auto rail = [](NLPowerRailType r) {
666672 return r == NLPowerRailType::kVss ? " kVss" : " kVdd" ;
667673 };
@@ -726,7 +732,7 @@ std::pair<int, int> NegotiationLegalizer::findBestLocation(int cell_idx,
726732 const int win_xhi = cell.init_x + extended_site_window + 1 ;
727733
728734 logger_->report (
729- " [neg-search {}/50 ] {} master={} site={} "
735+ " [neg-search h={} {}/2 ] {} master={} site={} "
730736 " extended_search_rows.size={} seed_valid={} "
731737 " nearest_below_step={} nearest_above_step={} "
732738 " rej_oob={} rej_dead={} rej_site={} rej_rail={} "
@@ -736,7 +742,8 @@ std::pair<int, int> NegotiationLegalizer::findBestLocation(int cell_idx,
736742 " cell.height={} cell.width={} max_disp_y={} "
737743 " rail_type={} rail_type_flipped={} flippable={} "
738744 " fence_id={} init_y={} init_x={} cur_y={} cur_x={}" ,
739- neg_search_print_count,
745+ cell.height ,
746+ height_print_count,
740747 cell.db_inst ->getName (),
741748 master ? master->getName ().c_str () : " ?" ,
742749 site ? site->getName ().c_str () : " ?" ,
0 commit comments