Skip to content

Commit

Permalink
drt: elimination of getNoRotationTransform
Browse files Browse the repository at this point in the history
Signed-off-by: bernardo <[email protected]>
  • Loading branch information
bnmfw committed Dec 8, 2024
1 parent f6a30a6 commit 07e8dc0
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 24 deletions.
7 changes: 0 additions & 7 deletions src/drt/src/db/obj/frInst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ Rect frInst::getBoundaryBBox() const
return box;
}

dbTransform frInst::getNoRotationTransform() const
{
dbTransform xfm = getTransform();
xfm.setOrient(dbOrientType(dbOrientType::R0));
return xfm;
}

frInstTerm* frInst::getInstTerm(const int index)
{
return instTerms_.at(index).get();
Expand Down
1 change: 0 additions & 1 deletion src/drt/src/db/obj/frInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class frInst : public frRef
void move(const dbTransform& xform) override { ; }
bool intersects(const Rect& box) const override { return false; }
// others
dbTransform getNoRotationTransform() const;
Rect getBoundaryBBox() const;

frInstTerm* getInstTerm(int index);
Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/db/obj/frRPin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Rect frRPin::getBBox()
switch (term->typeId()) {
case frcInstTerm: {
auto inst = static_cast<frInstTerm*>(term)->getInst();
dbTransform shiftXform = inst->getNoRotationTransform();
dbTransform shiftXform = inst->getDBTransform();

pt = accessPoint->getPoint();
shiftXform.apply(pt);
Expand Down
4 changes: 2 additions & 2 deletions src/drt/src/dr/FlexDR_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ void FlexDRWorker::initNet_term(const frDesign* design,
case frcInstTerm: {
auto instTerm = static_cast<frInstTerm*>(term);
frInst* inst = instTerm->getInst();
shiftXform = inst->getNoRotationTransform();
shiftXform = inst->getDBTransform();
instXform = inst->getDBTransform();
auto trueTerm = instTerm->getTerm();
const std::string name = inst->getName() + "/" + trueTerm->getName();
Expand Down Expand Up @@ -2898,7 +2898,7 @@ void FlexDRWorker::initMazeCost_terms(const std::set<frBlockObject*>& objs,
auto instTerm = static_cast<frInstTerm*>(obj);
auto inst = instTerm->getInst();
const dbTransform xform = inst->getDBTransform();
const dbTransform shiftXform = inst->getNoRotationTransform();
const dbTransform shiftXform = inst->getDBTransform();
const dbMasterType masterType = inst->getMaster()->getMasterType();
bool accessHorz = false;
bool accessVert = false;
Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/dr/FlexDR_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2779,7 +2779,7 @@ bool FlexDRWorker::addApPathSegs(const FlexMazeIdx& apIdx, drNet* net)
connecting = &end;
}
if (inst) {
dbTransform trans = inst->getNoRotationTransform();
dbTransform trans = inst->getDBTransform();
trans.apply(begin);
trans.apply(end);
if (end < begin) { // if rotation swapped order, correct it
Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/gr/FlexGR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ 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->getNoRotationTransform();
dbTransform shiftXform = inst->getDBTransform();
pt = rpin->getAccessPoint()->getPoint();
shiftXform.apply(pt);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/drt/src/io/GuideProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ std::vector<Point3D> getAccessPoints(const frBlockObject* pin)
std::vector<Point3D> result;
if (pin->typeId() == frcInstTerm) {
auto iterm = static_cast<const frInstTerm*>(pin);
auto transform = iterm->getInst()->getNoRotationTransform();
auto transform = iterm->getInst()->getDBTransform();
const int pin_access_idx = iterm->getInst()->getPinAccessIdx();
for (const auto& mpin : iterm->getTerm()->getPins()) {
if (!mpin->hasPinAccess()) {
Expand Down Expand Up @@ -1327,7 +1327,7 @@ void GuideProcessor::genGuides_addCoverGuide_helper(frInstTerm* iterm,
{
const frInst* inst = iterm->getInst();
const size_t num_pins = iterm->getTerm()->getPins().size();
dbTransform transform = inst->getNoRotationTransform();
dbTransform transform = inst->getDBTransform();
for (int pin_idx = 0; pin_idx < num_pins; pin_idx++) {
const frAccessPoint* pref_ap = getPrefAp(iterm, pin_idx);
if (pref_ap) {
Expand Down
16 changes: 9 additions & 7 deletions src/drt/src/pa/FlexPA_prep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1789,9 +1789,11 @@ void FlexPA::revertAccessPoints()
{
const auto& unique = unique_insts_.getUnique();
for (auto& inst : unique) {
const dbTransform xform = inst->getTransform();
const Point offset(xform.getOffset());
dbTransform revertXform(Point(-offset.getX(), -offset.getY()));
dbTransform revertXform;
inst->getDBTransform().invert(revertXform);
// const dbTransform xform = inst->getTransform();
// const Point offset(xform.getOffset());
// dbTransform revertXform(Point(-offset.getX(), -offset.getY()));

const auto pin_access_idx = unique_insts_.getPAIndex(inst);
for (auto& inst_term : inst->getInstTerms()) {
Expand Down Expand Up @@ -2092,7 +2094,7 @@ void FlexPA::addAccessPatternObj(
std::vector<std::unique_ptr<frVia>>& vias,
const bool isPrev)
{
const dbTransform xform = inst->getNoRotationTransform();
const dbTransform xform = inst->getDBTransform();
int access_point_idx = 0;
auto& access_points = access_pattern->getPattern();

Expand Down Expand Up @@ -2542,7 +2544,7 @@ int FlexPA::getEdgeCost(
has_vio = (vio_edges[edge_idx] == 1);
} else {
auto curr_unique_inst = unique_insts_.getUnique(curr_unique_inst_idx);
dbTransform xform = curr_unique_inst->getNoRotationTransform();
dbTransform xform = curr_unique_inst->getDBTransform();
// check DRC
std::vector<std::pair<frConnFig*, frBlockObject*>> objs;
const auto& [pin_1, inst_term_1] = pins[prev_pin_idx];
Expand Down Expand Up @@ -2715,7 +2717,7 @@ bool FlexPA::genPatterns_commit(
auto rvia = via.get();
temp_vias.push_back(std::move(via));

dbTransform xform = inst->getNoRotationTransform();
dbTransform xform = inst->getDBTransform();
Point pt(access_point->getPoint());
xform.apply(pt);
rvia->setOrigin(pt);
Expand Down Expand Up @@ -2808,7 +2810,7 @@ void FlexPA::genPatternsPrintDebug(
auto& [pin, inst_term] = pins[0];
if (inst_term) {
frInst* inst = inst_term->getInst();
xform = inst->getNoRotationTransform();
xform = inst->getDBTransform();
}

std::cout << "failed pattern:";
Expand Down
4 changes: 2 additions & 2 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->getNoRotationTransform();
dbTransform shiftXform = inst->getDBTransform();
frMTerm* mterm = iterm->getTerm();
int pinIdx = 0;
for (auto& pin : mterm->getPins()) {
Expand Down Expand Up @@ -258,7 +258,7 @@ void FlexTAWorker::initIroute_helper_generic_helper(frGuide* guide,
continue;
}
frInst* inst = iterm->getInst();
dbTransform shiftXform = inst->getNoRotationTransform();
dbTransform shiftXform = inst->getDBTransform();
frMTerm* mterm = iterm->getTerm();
int pinIdx = 0;
for (auto& pin : mterm->getPins()) {
Expand Down

0 comments on commit 07e8dc0

Please sign in to comment.