Skip to content

Commit

Permalink
drt: better detailed documentation and minor adjusments
Browse files Browse the repository at this point in the history
Signed-off-by: bernardo <bernardoborgessandoval@gmail.com>
  • Loading branch information
bnmfw committed Sep 26, 2024
1 parent 625c965 commit bc67868
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/drt/src/pa/FlexPA.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ class FlexPA
*
* @return if the initialization was sucessful
*/
template <typename T>

/**
* @brief initializes the accesses of a given pin but only considered
Expand All @@ -478,6 +477,7 @@ class FlexPA
*
* @return if the initialization was sucessful
*/
template <typename T>
bool initPinAccessCostBounded(
std::vector<std::unique_ptr<frAccessPoint>>& aps,
std::set<std::pair<Point, frLayerNum>>& apset,
Expand Down
8 changes: 4 additions & 4 deletions src/drt/src/pa/FlexPA_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<frCoord> via_layer_PS1;
gtl::polygon_90_set_data<frCoord> via_layer_ps1;

for (auto& fig : via_def->getLayer1Figs()) {
const Rect bbox = fig->getBBox();
gtl::rectangle_data<frCoord> 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<frCoord> 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
Expand Down Expand Up @@ -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,
Expand Down
20 changes: 13 additions & 7 deletions src/drt/src/pa/FlexPA_prep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ FlexPA::mergePinShapes(T* pin, frInstTerm* inst_term, const bool is_shrink)
if (shape->typeId() == frcRect) {
auto obj = static_cast<frRect*>(shape.get());
auto layer_num = obj->getLayerNum();
if (tech->getLayer(layer_num)->getType() != dbTechLayerType::ROUTING) {
frLayer layer = tech->getLayer(layer_num);
dbTechLayerDir dir = layer->getDir();
if (layer->getType() != dbTechLayerType::ROUTING) {
continue;
}
Rect box = obj->getBBox();
xform.apply(box);
gtl::rectangle_data<frCoord> 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);
}
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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<frCoord, frAccessPointEnum>& coords,
Expand Down Expand Up @@ -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<std::unique_ptr<frAccessPoint>>& aps,
Expand Down

0 comments on commit bc67868

Please sign in to comment.