@@ -355,12 +355,8 @@ void Design::setUnitCosts()
355355odb::dbTechVia* Design::chooseViaForPair (odb::dbTechLayer* lower_tl,
356356 odb::dbTechLayer* upper_tl) const
357357{
358- // Select the via whose footprint best approximates what drt will place.
359- // odb::dbBlock::getDefaultVias fabricates a default from the first via in db
360- // order when no OR_DEFAULT is set, which is arbitrary; instead rank all vias
361- // connecting the pair. drt's initDefaultVias always takes the single-cut
362- // group first, so order by: OR_DEFAULT, then fewest cuts, then the
363- // LEF-default flag, then the smallest metal enclosure.
358+ // Rank vias connecting the pair by a drt-like priority: OR_DEFAULT, then
359+ // fewest cuts, then LEF-default, then smallest enclosure.
364360 odb::dbTechLayer* cut_tl = lower_tl->getUpperLayer ();
365361 odb::dbTechVia* best = nullptr ;
366362 std::tuple<bool , int , bool , int64_t > best_key;
@@ -393,8 +389,7 @@ odb::dbTechVia* Design::chooseViaForPair(odb::dbTechLayer* lower_tl,
393389void Design::computeViaDemandLengths ()
394390{
395391 const int num_layers = getNumLayers ();
396- // Legacy proxy: min-area stub length inflated by the flat via_multiplier.
397- // Used as the fallback when the tech has no default via for a layer pair.
392+ // Fallback proxy (min-area stub x via_multiplier) for pairs with no via.
398393 via_demand_length_lower_.assign (num_layers, 0.0 );
399394 via_demand_length_upper_.assign (num_layers, 0.0 );
400395
@@ -412,8 +407,7 @@ void Design::computeViaDemandLengths()
412407
413408 double num_lower = lower.getMinLength () * constants_.via_multiplier ;
414409 double num_upper = upper.getMinLength () * constants_.via_multiplier ;
415- // Union all boxes on each routing layer: a via may have several rects on a
416- // layer, and the footprint is their combined extent, not the last one.
410+ // Union the boxes on each layer; a via may have several rects per layer.
417411 odb::Rect lo_box, up_box;
418412 lo_box.mergeInit ();
419413 up_box.mergeInit ();
@@ -436,8 +430,7 @@ void Design::computeViaDemandLengths()
436430 via_demand_length_upper_[i] = num_upper;
437431
438432 if (debug) {
439- // Enclosure sizes are the via pad extents (x*y DBU); demand is the
440- // per-via fraction of one track for a uniform gcell.
433+ // Report enclosures, lengths, and per-track demand for each pair.
441434 const int gcell = default_gridline_spacing_;
442435 const std::string via_src
443436 = via != nullptr ? via->getName () : std::string (" min_area-fallback" );
@@ -475,15 +468,13 @@ double Design::viaDemandLength(const MetalLayer& layer,
475468 const int dy) const
476469{
477470 const int pitch = layer.getPitch ();
478- // getSpacing() is 0 on techs that give spacing only via a parallel table;
479- // fall back to the table-derived default so the spacing term is not lost.
471+ // getSpacing() is 0 on parallel-table-only techs; use default spacing then.
480472 const int spacing
481473 = layer.getSpacing () > 0 ? layer.getSpacing () : layer.getDefaultSpacing ();
482474 // Split the pad into extent along the routing direction and across tracks.
483475 const int along = (layer.getDirection () == MetalLayer::H) ? dx : dy;
484476 const int perp = (layer.getDirection () == MetalLayer::H) ? dy : dx;
485- // A via blocks whole tracks perpendicular to the routing direction; round the
486- // keep-out (via metal + spacing on both sides) up to an integer track count.
477+ // A via blocks whole tracks; ceil the keep-out to an integer track count.
487478 const double tracks_blocked
488479 = pitch > 0 ? std::ceil (static_cast <double >(perp + 2 * spacing) / pitch)
489480 : 1.0 ;
0 commit comments