@@ -1862,10 +1862,6 @@ void NesterovBase::initFillerGCells()
18621862 / static_cast <float >(whiteSpaceArea_);
18631863 uniformTargetDensity_ = ceilf (uniformTargetDensity_ * 100 ) / 100 ;
18641864
1865- log_->report (" TargetDensity: {:.4f} (UniformTargetDensity: {:.4f})" ,
1866- targetDensity_,
1867- uniformTargetDensity_);
1868-
18691865 if (totalFillerArea_ < 0 ) {
18701866 log_->warn (GPL,
18711867 302 ,
@@ -2031,6 +2027,65 @@ void NesterovBase::setTargetDensity(float density)
20312027 bg_.updateBinsNonPlaceArea ();
20322028}
20332029
2030+ void NesterovBase::checkConsistency ()
2031+ {
2032+ if (!log_->debugCheck (GPL, " checkConsistency" , 1 )) {
2033+ return ;
2034+ }
2035+ auto block = pb_->db ()->getChip ()->getBlock ();
2036+ const int64_t tolerance = 10000 ;
2037+
2038+ int64_t expected_white_space
2039+ = pb_->getDie ().coreArea () - pb_->nonPlaceInstsArea ();
2040+ if (std::abs (whiteSpaceArea_ - expected_white_space) > tolerance) {
2041+ log_->warn (utl::GPL, 319 , " Inconsistent white space area" );
2042+ log_->report (
2043+ " whiteSpaceArea_: {} (expected:{}) | coreArea: {}, "
2044+ " nonPlaceInstsArea: {}" ,
2045+ block->dbuAreaToMicrons (whiteSpaceArea_),
2046+ block->dbuAreaToMicrons (expected_white_space),
2047+ block->dbuAreaToMicrons (pb_->getDie ().coreArea ()),
2048+ block->dbuAreaToMicrons (pb_->nonPlaceInstsArea ()));
2049+ }
2050+
2051+ int64_t expected_movable_area = whiteSpaceArea_ * targetDensity_;
2052+ if (std::abs (movableArea_ - expected_movable_area) > tolerance) {
2053+ log_->warn (utl::GPL, 320 , " Inconsistent movable area 1" );
2054+ log_->report (
2055+ " movableArea_: {} (expected:{}) | whiteSpaceArea_: {}, "
2056+ " targetDensity_: {}" ,
2057+ block->dbuAreaToMicrons (movableArea_),
2058+ block->dbuAreaToMicrons (expected_movable_area),
2059+ block->dbuAreaToMicrons (whiteSpaceArea_),
2060+ targetDensity_);
2061+ }
2062+
2063+ int64_t expected_filler_area = movableArea_ - getNesterovInstsArea ();
2064+ if (std::abs (totalFillerArea_ - expected_filler_area) > tolerance) {
2065+ log_->warn (utl::GPL, 321 , " Inconsistent filler area" );
2066+ log_->report (
2067+ " totalFillerArea_: {} (expected:{}) | movableArea_: {}, "
2068+ " getNesterovInstsArea_: {}" ,
2069+ block->dbuAreaToMicrons (totalFillerArea_),
2070+ block->dbuAreaToMicrons (expected_filler_area),
2071+ block->dbuAreaToMicrons (movableArea_),
2072+ block->dbuAreaToMicrons (getNesterovInstsArea ()));
2073+ }
2074+
2075+ float expected_density = movableArea_ * 1.0 / whiteSpaceArea_;
2076+ float density_diff = std::abs (targetDensity_ - expected_density);
2077+ if (density_diff > 1e-6 ) {
2078+ log_->warn (utl::GPL, 322 , " Inconsistent target density" );
2079+ log_->report (
2080+ " targetDensity_: {} (expected:{}) | movableArea_: {}, "
2081+ " whiteSpaceArea_: {}" ,
2082+ targetDensity_,
2083+ expected_density,
2084+ block->dbuAreaToMicrons (movableArea_),
2085+ block->dbuAreaToMicrons (whiteSpaceArea_));
2086+ }
2087+ }
2088+
20342089int NesterovBase::getBinCntX () const
20352090{
20362091 return bg_.getBinCntX ();
0 commit comments