Skip to content

Commit

Permalink
drt: grt conformance to new and better pin access orientation
Browse files Browse the repository at this point in the history
Signed-off-by: bernardo <[email protected]>
  • Loading branch information
bnmfw committed Dec 10, 2024
1 parent 583b2b2 commit ce82952
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/drt/src/db/obj/frInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class frInst : public frRef
return db_inst_->getTransform().getOffset();
}
odb::dbInst* getDBInst() const { return db_inst_; }
dbTransform getTransform() const { return db_inst_->getTransform(); }
dbTransform getTransform() const override { return db_inst_->getTransform(); }

/* from frPinFig
* hasPin
Expand Down
6 changes: 3 additions & 3 deletions src/drt/src/db/obj/frInstTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ frString frInstTerm::getName() const
frAccessPoint* frInstTerm::getAccessPoint(frCoord x, frCoord y, frLayerNum lNum)
{
auto inst = getInst();
dbTransform shiftXform;
inst->getTransform().invert(shiftXform);
dbTransform transform;
inst->getTransform().invert(transform);
Point pt(x, y);
shiftXform.apply(pt);
transform.apply(pt);
return term_->getAccessPoint(
pt.getX(), pt.getY(), lNum, inst->getPinAccessIdx());
}
Expand Down
4 changes: 2 additions & 2 deletions src/drt/src/db/obj/frRPin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Rect frRPin::getBBox()
switch (term->typeId()) {
case frcInstTerm: {
auto inst = static_cast<frInstTerm*>(term)->getInst();
dbTransform shiftXform = inst->getTransform();
dbTransform = inst->getTransform();

pt = accessPoint->getPoint();
shiftXform.apply(pt);
.apply(pt);
break;
}
case frcBTerm:
Expand Down
2 changes: 0 additions & 2 deletions src/drt/src/db/obj/frVia.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,9 @@ class frVia : public frRef
*/

dbOrientType getOrient() const override { return dbOrientType(); }
void setOrient(const dbOrientType& tmpOrient) { ; }
Point getOrigin() const override { return origin_; }
void setOrigin(const Point& tmpPoint) { origin_ = tmpPoint; }
dbTransform getTransform() const override { return origin_; }
void setTransform(const dbTransform& xformIn) {}

/* from frPinFig
* hasPin
Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/dr/FlexDR.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ class FlexDRWorker
frInst* inst,
drNet* dNet,
const std::string& name,
const dbTransform& shiftXform);
const dbTransform&);
bool isRestrictedRouting(frLayerNum lNum);
void initNet_addNet(std::unique_ptr<drNet> in);
void getTrackLocs(bool isHorzTracks,
Expand Down
12 changes: 6 additions & 6 deletions src/drt/src/dr/FlexDR_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,23 +1177,23 @@ void FlexDRWorker::initNet_term(const frDesign* design,
{
for (auto term : terms) {
// ap
dbTransform shiftXform;
dbTransform transform;
switch (term->typeId()) {
case frcInstTerm: {
auto instTerm = static_cast<frInstTerm*>(term);
frInst* inst = instTerm->getInst();
shiftXform = inst->getTransform();
transform = inst->getTransform();
auto trueTerm = instTerm->getTerm();
const std::string name = inst->getName() + "/" + trueTerm->getName();
initNet_term_helper(
design, trueTerm, term, inst, dNet, name, shiftXform);
design, trueTerm, term, inst, dNet, name, transform);
break;
}
case frcBTerm: {
auto trueTerm = static_cast<frBTerm*>(term);
const std::string name = "PIN/" + trueTerm->getName();
initNet_term_helper(
design, trueTerm, term, nullptr, dNet, name, shiftXform);
design, trueTerm, term, nullptr, dNet, name, transform);
break;
}
default:
Expand All @@ -1210,7 +1210,7 @@ void FlexDRWorker::initNet_term_helper(const frDesign* design,
frInst* inst,
drNet* dNet,
const std::string& name,
const dbTransform& shiftXform)
const dbTransform& transform)
{
auto dPin = std::make_unique<drPin>();
dPin->setFrTerm(term);
Expand All @@ -1228,7 +1228,7 @@ void FlexDRWorker::initNet_term_helper(const frDesign* design,
for (auto& ap : pin->getPinAccess(pinAccessIdx)->getAccessPoints()) {
Point bp = ap->getPoint();
const auto bNum = ap->getLayerNum();
shiftXform.apply(bp);
transform.apply(bp);

auto dAp = std::make_unique<drAccessPattern>();
dAp->setPoint(bp);
Expand Down
4 changes: 2 additions & 2 deletions src/drt/src/gr/FlexGR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1642,9 +1642,9 @@ void FlexGR::initGR_genTopology_net(frNet* net)
Point pt;
if (rpin->getFrTerm()->typeId() == frcInstTerm) {
auto inst = static_cast<frInstTerm*>(rpin->getFrTerm())->getInst();
dbTransform shiftXform = inst->getTransform();
dbTransform = inst->getTransform();
pt = rpin->getAccessPoint()->getPoint();
shiftXform.apply(pt);
.apply(pt);
} else {
pt = rpin->getAccessPoint()->getPoint();
}
Expand Down
10 changes: 5 additions & 5 deletions src/drt/src/pa/FlexPA_prep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,8 @@ void FlexPA::revertAccessPoints()
{
const auto& unique = unique_insts_.getUnique();
for (auto& inst : unique) {
dbTransform revertXform;
inst->getTransform().invert(revertXform);
dbTransform revert_transform;
inst->getTransform().invert(revert_transform);

const auto pin_access_idx = unique_insts_.getPAIndex(inst);
for (auto& inst_term : inst->getInstTerms()) {
Expand All @@ -1802,13 +1802,13 @@ void FlexPA::revertAccessPoints()
auto pin_access = pin->getPinAccess(pin_access_idx);
for (auto& access_point : pin_access->getAccessPoints()) {
Point unique_AP_point(access_point->getPoint());
revertXform.apply(unique_AP_point);
revert_transform.apply(unique_AP_point);
access_point->setPoint(unique_AP_point);
for (auto& ps : access_point->getPathSegs()) {
Point begin = ps.getBeginPoint();
Point end = ps.getEndPoint();
revertXform.apply(begin);
revertXform.apply(end);
revert_transform.apply(begin);
revert_transform.apply(end);
if (end < begin) {
Point tmp = begin;
begin = end;
Expand Down
8 changes: 4 additions & 4 deletions src/drt/src/ta/FlexTA_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ bool FlexTAWorker::initIroute_helper_pin(frGuide* guide,
continue;
}
frInst* inst = iterm->getInst();
dbTransform shiftXform = inst->getTransform();
dbTransform = inst->getTransform();
frMTerm* mterm = iterm->getTerm();
int pinIdx = 0;
for (auto& pin : mterm->getPins()) {
Expand All @@ -153,7 +153,7 @@ bool FlexTAWorker::initIroute_helper_pin(frGuide* guide,
}
Point bp = ap->getPoint();
auto bNum = ap->getLayerNum();
shiftXform.apply(bp);
.apply(bp);
if (layerNum == bNum && getRouteBox().intersects(bp)) {
pinCoord = isH ? bp.y() : bp.x();
maxBegin = isH ? bp.x() : bp.y();
Expand Down Expand Up @@ -258,7 +258,7 @@ void FlexTAWorker::initIroute_helper_generic_helper(frGuide* guide,
continue;
}
frInst* inst = iterm->getInst();
dbTransform shiftXform = inst->getTransform();
dbTransform = inst->getTransform();
frMTerm* mterm = iterm->getTerm();
int pinIdx = 0;
for (auto& pin : mterm->getPins()) {
Expand All @@ -285,7 +285,7 @@ void FlexTAWorker::initIroute_helper_generic_helper(frGuide* guide,
}
}
Point bp = ap->getPoint();
shiftXform.apply(bp);
.apply(bp);
if (getRouteBox().intersects(bp)) {
pinCoord = isH ? bp.y() : bp.x();
return;
Expand Down
6 changes: 1 addition & 5 deletions src/grt/src/GlobalRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,11 +904,7 @@ bool GlobalRouter::findPinAccessPointPositions(
for (const odb::dbAccessPoint* ap : access_points) {
odb::Point ap_position = ap->getPoint();
if (!pin.isPort()) {
odb::dbTransform xform;
int x, y;
pin.getITerm()->getInst()->getLocation(x, y);
xform.setOffset({x, y});
xform.setOrient(odb::dbOrientType(odb::dbOrientType::R0));
odb::dbTransform xform = pin.getITerm()->getInst()->getTransform();
xform.apply(ap_position);
}

Expand Down

0 comments on commit ce82952

Please sign in to comment.