Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#6119 from eder-matheus/grt_mi…
Browse files Browse the repository at this point in the history
…ssing_route

grt: don't use DRT APs when loading guides from odb
  • Loading branch information
eder-matheus authored Nov 7, 2024
2 parents 5d2d6ea + 3582fa5 commit 59bd6f6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/grt/include/grt/GlobalRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ class GlobalRouter : public ant::GlobalRouteSource
int macro_extension_;
bool initialized_;
int total_diodes_count_;
bool incremental_;
// TODO: remove this flag after support incremental updates on DRT PA
bool skip_drt_aps_{false};

// Region adjustment variables
std::vector<RegionAdjustment> region_adjustments_;
Expand Down
10 changes: 5 additions & 5 deletions src/grt/src/GlobalRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ GlobalRouter::GlobalRouter()
macro_extension_(0),
initialized_(false),
total_diodes_count_(0),
incremental_(false),
verbose_(false),
seed_(0),
caps_perturbation_percentage_(0),
Expand Down Expand Up @@ -286,15 +285,15 @@ void GlobalRouter::globalRoute(bool save_guides,
}
grouter_cbk_ = new GRouteDbCbk(this);
grouter_cbk_->addOwner(block_);
incremental_ = true;
skip_drt_aps_ = true;
} else {
try {
if (end_incremental) {
updateDirtyRoutes();
grouter_cbk_->removeOwner();
delete grouter_cbk_;
grouter_cbk_ = nullptr;
incremental_ = false;
skip_drt_aps_ = false;
} else {
clear();
block_ = db_->getChip()->getBlock();
Expand Down Expand Up @@ -913,9 +912,9 @@ std::vector<odb::Point> GlobalRouter::findOnGridPositions(

// temporarily ignore odb access points when incremental changes
// are made, in order to avoid getting invalid APs
// TODO: remove the !incremental_ flag and update APs incrementally in odb
// TODO: remove the !skip_drt_aps_ flag and update APs incrementally in odb
has_access_points
= findPinAccessPointPositions(pin, ap_positions) && !incremental_;
= findPinAccessPointPositions(pin, ap_positions) && !skip_drt_aps_;

std::vector<odb::Point> positions_on_grid;

Expand Down Expand Up @@ -2078,6 +2077,7 @@ void GlobalRouter::loadGuidesFromDB()
if (!routes_.empty()) {
return;
}
skip_drt_aps_ = true;
initGridAndNets();
for (odb::dbNet* net : block_->getNets()) {
for (odb::dbGuide* guide : net->getGuides()) {
Expand Down
13 changes: 10 additions & 3 deletions src/grt/src/MakeWireParasitics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ void MakeWireParasitics::estimateParasitcs(odb::dbNet* net,
= parasitics_->makeParasiticNetwork(sta_net, false, analysis_point);
makeRouteParasitics(
net, route, sta_net, corner, analysis_point, parasitic, node_map);
makeParasiticsToPins(pins, node_map, corner, analysis_point, parasitic);
makeParasiticsToPins(
pins, net, node_map, corner, analysis_point, parasitic);

if (spef_writer) {
spef_writer->writeNet(corner, sta_net, parasitic);
Expand Down Expand Up @@ -256,19 +257,21 @@ void MakeWireParasitics::makeRouteParasitics(

void MakeWireParasitics::makeParasiticsToPins(
std::vector<Pin>& pins,
odb::dbNet* net,
NodeRoutePtMap& node_map,
sta::Corner* corner,
sta::ParasiticAnalysisPt* analysis_point,
sta::Parasitic* parasitic)
{
for (Pin& pin : pins) {
makeParasiticsToPin(pin, node_map, corner, analysis_point, parasitic);
makeParasiticsToPin(pin, net, node_map, corner, analysis_point, parasitic);
}
}

// Make parasitics for the wire from the pin to the grid location of the pin.
void MakeWireParasitics::makeParasiticsToPin(
Pin& pin,
odb::dbNet* net,
NodeRoutePtMap& node_map,
sta::Corner* corner,
sta::ParasiticAnalysisPt* analysis_point,
Expand Down Expand Up @@ -342,7 +345,11 @@ void MakeWireParasitics::makeParasiticsToPin(
parasitic, resistor_id_++, res + via_res, pin_node, grid_node);
parasitics_->incrCap(grid_node, cap / 2.0);
} else {
logger_->warn(GRT, 26, "Missing route to pin {}.", pin.getName());
logger_->warn(GRT,
26,
"Missing route to pin {} in net {}.",
pin.getName(),
net->getName());
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/grt/src/MakeWireParasitics.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ class MakeWireParasitics : public AbstractMakeWireParasitics
sta::Parasitic* parasitic,
sta::Net* net) const;
void makeParasiticsToPins(std::vector<Pin>& pins,
odb::dbNet* net,
NodeRoutePtMap& node_map,
sta::Corner* corner,
sta::ParasiticAnalysisPt* analysis_point,
sta::Parasitic* parasitic);
void makeParasiticsToPin(Pin& pin,
odb::dbNet* net,
NodeRoutePtMap& node_map,
sta::Corner* corner,
sta::ParasiticAnalysisPt* analysis_point,
Expand Down

0 comments on commit 59bd6f6

Please sign in to comment.