@@ -78,17 +78,17 @@ void GraphicsImpl::debugForNesterovPlace(
7878
7979 if (enabled ()) {
8080 // Setup the chart
81- chart_ = gui::Gui::get ()-> addChart (
82- " GPL" , " Iteration" , {" HPWL (μm)" , " Overflow" });
83- chart_ ->setXAxisFormat (" %d" );
84- chart_ ->setYAxisFormats ({" %.2e" , " %.2f" });
85- chart_ ->setYAxisMin ({std::nullopt , 0 });
86-
87- // Useful for debugging multiple NesterovBase : Density penalty and PhiCoef
88- if (logger_->debugCheck (utl::GPL, " penaltyPlot " , 1 )) {
81+ gui::Gui* gui = gui::Gui::get ();
82+ main_chart_ = gui-> addChart ( " GPL" , " Iteration" , {" HPWL (μm)" , " Overflow" });
83+ main_chart_ ->setXAxisFormat (" %d" );
84+ main_chart_ ->setYAxisFormats ({" %.2e" , " %.2f" });
85+ main_chart_ ->setYAxisMin ({std::nullopt , 0 });
86+
87+ // Useful for debugging : Density penalty and PhiCoef
88+ if (logger_->debugCheck (utl::GPL, " debugPlot " , 1 )) {
8989 if (!nbVec_.empty ()) {
90- std::vector<std::string> series_names ;
91- series_names .reserve (nbVec_.size ());
90+ std::vector<std::string> region_names ;
91+ region_names .reserve (nbVec_.size ());
9292 for (size_t i = 0 ; i < nbVec_.size (); ++i) {
9393 std::string name;
9494 if (nbVec_[i] && nbVec_[i]->getPb () && nbVec_[i]->getPb ()->group ()) {
@@ -97,24 +97,23 @@ void GraphicsImpl::debugForNesterovPlace(
9797 } else {
9898 name = fmt::format (" nb[{}]" , i);
9999 }
100- series_names .push_back (name);
100+ region_names .push_back (name);
101101 }
102- density_chart_ = gui::Gui::get () ->addChart (
103- " GPL Density Penalty" , " Iteration" , series_names );
102+ density_chart_ = gui->addChart (
103+ " GPL Density Penalty" , " Iteration" , { " DensityPenalty " , " phiCoef " } );
104104 density_chart_->setXAxisFormat (" %d" );
105- std::vector<std::string> y_formats (nbVec_. size () , " %.3f " );
106- density_chart_->setYAxisFormats (y_formats );
107- std::vector<std::optional< double >> y_mins (nbVec_. size (), 0.0 );
108- density_chart_-> setYAxisMin (y_mins);
109-
110- phi_chart_ = gui::Gui::get ()-> addChart (
111- " GPL PhiCoef " , " Iteration " , series_names );
112- phi_chart_ ->setXAxisFormat (" %d" );
113- phi_chart_ ->setYAxisFormats (y_formats );
114- phi_chart_ ->setYAxisMin (y_mins );
105+ density_chart_-> setYAxisFormats ({ " %.2e " , " %.2f " } );
106+ density_chart_->setYAxisMin ({ 0.0 , nbc_-> getNbVars (). minPhiCoef } );
107+
108+ stepLength_chart_ = gui-> addChart (
109+ " GPL StepLength " ,
110+ " Iteration " ,
111+ { " StepLength " , " CoordiDistance " , " GradDistance " , " Std area " } );
112+ stepLength_chart_ ->setXAxisFormat (" %d" );
113+ stepLength_chart_ ->setYAxisFormats ({ " %.2e " , " %.2f " , " %.2f " } );
114+ stepLength_chart_ ->setYAxisMin ({ 0.0 , 0.0 , 0.0 } );
115115 }
116116 }
117-
118117 initHeatmap ();
119118 if (inst) {
120119 for (size_t idx = 0 ; idx < nbc_->getGCells ().size (); ++idx) {
@@ -285,10 +284,19 @@ void GraphicsImpl::drawSingleGCell(const GCell* gCell,
285284 // Highlight modified instances (overrides base color, unless selected)
286285 switch (gCell ->changeType ()) {
287286 case GCell::GCellChange::kRoutability :
288- color = {255 , 255 , 255 , 100 }; // White
287+ color = gui::Painter::kWhite ;
288+ break ;
289+ case GCell::GCellChange::kNewInstance :
290+ color = gui::Painter::kDarkRed ;
291+ break ;
292+ case GCell::GCellChange::kDownsize :
293+ color = gui::Painter::kDarkBlue ;
289294 break ;
290- case GCell::GCellChange::kTimingDriven :
291- color = {180 , 150 , 255 , 100 }; // Light purple
295+ case GCell::GCellChange::kUpsize :
296+ color = gui::Painter::kOrange ;
297+ break ;
298+ case GCell::GCellChange::kResizeNoChange :
299+ color = gui::Painter::kDarkYellow ;
292300 break ;
293301 default :
294302 if (gCell ->isInstance ()) {
@@ -538,48 +546,57 @@ void GraphicsImpl::reportSelected()
538546void GraphicsImpl::addIter (const int iter, const double overflow)
539547{
540548 odb::dbBlock* block = pbc_->db ()->getChip ()->getBlock ();
541- chart_ ->addPoint (iter, {block->dbuToMicrons (nbc_->getHpwl ()), overflow});
549+ main_chart_ ->addPoint (iter, {block->dbuToMicrons (nbc_->getHpwl ()), overflow});
542550
543- // Add density penalties snapshot for each NesterovBase
544- if (logger_->debugCheck (utl::GPL, " penaltyPlot" , 1 )) {
551+ if (logger_->debugCheck (utl::GPL, " debugPlot" , 1 )) {
545552 if (density_chart_) {
546- std::vector<double > penalties;
547- penalties.reserve (nbVec_.size ());
548- for (const auto & nb : nbVec_) {
549- double penalty
550- = nb ? static_cast <double >(nb->getDensityPenalty ()) : 0.0 ;
551- penalties.push_back (penalty);
553+ std::vector<double > values;
554+ if (!nbVec_.empty () && nbVec_[0 ]) {
555+ values.push_back ((static_cast <double >(nbVec_[0 ]->getDensityPenalty ())));
556+ values.push_back (static_cast <double >(nbVec_[0 ]->getStoredPhiCoef ()));
557+ } else {
558+ values.push_back (0.0 );
559+ values.push_back (0.0 );
552560 }
553- density_chart_->addPoint (iter, penalties );
561+ density_chart_->addPoint (iter, values );
554562 }
555563
556- if (phi_chart_) {
557- std::vector<double > coefs;
558- coefs.reserve (nbVec_.size ());
559- for (const auto & nb : nbVec_) {
560- double coef = nb ? static_cast <double >(nb->getStoredPhiCoef ()) : 0.0 ;
561- coefs.push_back (coef);
564+ if (stepLength_chart_) {
565+ std::vector<double > values;
566+ if (!nbVec_.empty () && nbVec_[0 ]) {
567+ values.push_back (static_cast <double >(nbVec_[0 ]->getStoredStepLength ()));
568+ values.push_back (
569+ static_cast <double >(nbVec_[0 ]->getStoredCoordiDistance ()));
570+ values.push_back (
571+ static_cast <double >(nbVec_[0 ]->getStoredGradDistance ()));
572+ values.push_back (
573+ static_cast <double >(nbVec_[0 ]->getNesterovInstsArea ()));
574+ } else {
575+ values.push_back (0.0 );
576+ values.push_back (0.0 );
577+ values.push_back (0.0 );
578+ values.push_back (0.0 );
562579 }
563- phi_chart_ ->addPoint (iter, coefs );
580+ stepLength_chart_ ->addPoint (iter, values );
564581 }
565582 }
566583}
567584
568585void GraphicsImpl::addTimingDrivenIter (const int iter)
569586{
570- chart_ ->addVerticalMarker (iter, gui::Painter::kTurquoise );
587+ main_chart_ ->addVerticalMarker (iter, gui::Painter::kTurquoise );
571588}
572589
573590void GraphicsImpl::addRoutabilitySnapshot (int iter)
574591{
575- chart_ ->addVerticalMarker (iter, gui::Painter::kYellow );
592+ main_chart_ ->addVerticalMarker (iter, gui::Painter::kYellow );
576593}
577594
578595void GraphicsImpl::addRoutabilityIter (const int iter, const bool revert)
579596{
580597 gui::Painter::Color color
581598 = revert ? gui::Painter::kRed : gui::Painter::kGreen ;
582- chart_ ->addVerticalMarker (iter, color);
599+ main_chart_ ->addVerticalMarker (iter, color);
583600}
584601
585602void GraphicsImpl::cellPlotImpl (bool pause)
0 commit comments