From f2523871cd1be304b74ca60332c0b99d15866726 Mon Sep 17 00:00:00 2001 From: bernardo Date: Thu, 26 Sep 2024 14:32:20 +0000 Subject: [PATCH] drt: better detailed documentation and minor adjusments Signed-off-by: bernardo --- src/drt/src/pa/FlexPA.h | 2 +- src/drt/src/pa/FlexPA_init.cpp | 8 ++++---- src/drt/src/pa/FlexPA_prep.cpp | 20 +++++++++++++------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/drt/src/pa/FlexPA.h b/src/drt/src/pa/FlexPA.h index 89e1de958f0..b9b3e1f990a 100644 --- a/src/drt/src/pa/FlexPA.h +++ b/src/drt/src/pa/FlexPA.h @@ -462,7 +462,6 @@ class FlexPA * * @return if the initialization was sucessful */ - template /** * @brief initializes the accesses of a given pin but only considered @@ -478,6 +477,7 @@ class FlexPA * * @return if the initialization was sucessful */ + template bool initPinAccessCostBounded( std::vector>& aps, std::set>& apset, diff --git a/src/drt/src/pa/FlexPA_init.cpp b/src/drt/src/pa/FlexPA_init.cpp index 3c2ff543a4a..c8cdf5ae964 100644 --- a/src/drt/src/pa/FlexPA_init.cpp +++ b/src/drt/src/pa/FlexPA_init.cpp @@ -57,17 +57,17 @@ void FlexPA::initViaRawPriority() ViaRawPriorityTuple FlexPA::getViaRawPriority(frViaDef* via_def) { const bool is_not_default_via = !(via_def->getDefault()); - gtl::polygon_90_set_data via_layer_PS1; + gtl::polygon_90_set_data via_layer_ps1; for (auto& fig : via_def->getLayer1Figs()) { const Rect bbox = fig->getBBox(); gtl::rectangle_data bbox_rect( bbox.xMin(), bbox.yMin(), bbox.xMax(), bbox.yMax()); using boost::polygon::operators::operator+=; - via_layer_PS1 += bbox_rect; + via_layer_ps1 += bbox_rect; } gtl::rectangle_data layer1_rect; - gtl::extents(layer1_rect, via_layer_PS1); + gtl::extents(layer1_rect, via_layer_ps1); const bool is_layer1_horz = (gtl::xh(layer1_rect) - gtl::xl(layer1_rect)) > (gtl::yh(layer1_rect) - gtl::yl(layer1_rect)); const frCoord layer1_width @@ -104,7 +104,7 @@ ViaRawPriorityTuple FlexPA::getViaRawPriority(frViaDef* via_def) = (is_layer2_horz && (dir2 == dbTechLayerDir::VERTICAL)) || (!is_layer2_horz && (dir2 == dbTechLayerDir::HORIZONTAL)); - const frCoord layer1_area = gtl::area(via_layer_PS1); + const frCoord layer1_area = gtl::area(via_layer_ps1); const frCoord layer2_area = gtl::area(via_layer_PS2); return std::make_tuple(is_not_default_via, diff --git a/src/drt/src/pa/FlexPA_prep.cpp b/src/drt/src/pa/FlexPA_prep.cpp index cd7acd6a739..ec3fe2b1f82 100644 --- a/src/drt/src/pa/FlexPA_prep.cpp +++ b/src/drt/src/pa/FlexPA_prep.cpp @@ -80,7 +80,9 @@ FlexPA::mergePinShapes(T* pin, frInstTerm* inst_term, const bool is_shrink) if (shape->typeId() == frcRect) { auto obj = static_cast(shape.get()); auto layer_num = obj->getLayerNum(); - if (tech->getLayer(layer_num)->getType() != dbTechLayerType::ROUTING) { + auto layer = tech->getLayer(layer_num); + dbTechLayerDir dir = layer->getDir(); + if (layer->getType() != dbTechLayerType::ROUTING) { continue; } Rect box = obj->getBBox(); @@ -88,10 +90,9 @@ FlexPA::mergePinShapes(T* pin, frInstTerm* inst_term, const bool is_shrink) gtl::rectangle_data rect( box.xMin(), box.yMin(), box.xMax(), box.yMax()); if (is_shrink) { - if (tech->getLayer(layer_num)->getDir() == dbTechLayerDir::HORIZONTAL) { + if (dir == dbTechLayerDir::HORIZONTAL) { gtl::shrink(rect, gtl::VERTICAL, layer_widths[layer_num] / 2); - } else if (tech->getLayer(layer_num)->getDir() - == dbTechLayerDir::VERTICAL) { + } else if (dir == dbTechLayerDir::VERTICAL) { gtl::shrink(rect, gtl::HORIZONTAL, layer_widths[layer_num] / 2); } } @@ -121,7 +122,10 @@ FlexPA::mergePinShapes(T* pin, frInstTerm* inst_term, const bool is_shrink) * * @details This follows the Tao of PAO paper cost structure. * On track and half track are the preffered access points, - * this function is responsible for generating them + * this function is responsible for generating them. + * It iterates over every track coord in the range [low, high] + * and inserts one of its coordinates on the coords map. + * if use_nearby_grid is true it changes the access point cost to it. * * TODO: * This function doesn't seem to be getting the best access point. @@ -154,7 +158,9 @@ void FlexPA::genAPOnTrack( // will not generate center for wider edge /** * @details This follows the Tao of PAO paper cost structure. - * Centered Access points are on the center of their pin shape (low, high) + * First it iterates through the range [low, high] to check if there are + * at least 3 possible OnTrack access points as those take priority. + * If false it created and access points in the middle point between [low, high] */ void FlexPA::genAPCentered(std::map& coords, @@ -451,7 +457,7 @@ bool FlexPA::enclosesOnTrackPlanarAccess( } /** - * @details Generates all necessary access points from an rectangle shape + * @details Generates all necessary access points from a rectangle shape * In this case a rectangle is one of the pin shapes of the pin */ void FlexPA::genAPsFromRect(std::vector>& aps,