Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsz: add detailed_routing as parasitics source #6052

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rsz/include/rsz/Resizer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ enum class ParasiticsSrc
{
none,
placement,
global_routing
global_routing,
detailed_routing
};

struct ParasiticsResistance
Expand Down Expand Up @@ -413,6 +414,7 @@ class Resizer : public dbStaState

dbNetwork* getDbNetwork() { return db_network_; }
ParasiticsSrc getParasiticsSrc() { return parasitics_src_; }
void setParasiticsSrc(ParasiticsSrc src) { parasitics_src_ = src; }
dbBlock* getDbBlock() { return block_; };
double dbuToMeters(int dist) const;
int metersToDbu(double dist) const;
Expand Down
1 change: 1 addition & 0 deletions src/rsz/src/BufferedNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ BufferedNetPtr Resizer::makeBufferedNet(const Pin* drvr_pin,
case ParasiticsSrc::placement:
return makeBufferedNetSteiner(drvr_pin, corner);
case ParasiticsSrc::global_routing:
case ParasiticsSrc::detailed_routing:
return makeBufferedNetGroute(drvr_pin, corner);
case ParasiticsSrc::none:
return nullptr;
Expand Down
15 changes: 14 additions & 1 deletion src/rsz/src/EstimateWireParasitics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ void Resizer::estimateParasitics(ParasiticsSrc src,
global_router_->estimateRC(spef_writer.get());
parasitics_src_ = ParasiticsSrc::global_routing;
break;
case ParasiticsSrc::detailed_routing:
// TODO: call rcx to extract parasitics and load them to STA
parasitics_src_ = ParasiticsSrc::detailed_routing;
break;
case ParasiticsSrc::none:
break;
}
Expand All @@ -310,6 +314,8 @@ void Resizer::incrementalParasiticsBegin()
case ParasiticsSrc::placement:
break;
case ParasiticsSrc::global_routing:
case ParasiticsSrc::detailed_routing:
// TODO: add IncrementalDRoute
incr_groute_ = new IncrementalGRoute(global_router_, block_);
// Don't print verbose messages for incremental routing
global_router_->setVerbose(false);
Expand All @@ -326,6 +332,8 @@ void Resizer::incrementalParasiticsEnd()
case ParasiticsSrc::placement:
break;
case ParasiticsSrc::global_routing:
case ParasiticsSrc::detailed_routing:
// TODO: add IncrementalDRoute
delete incr_groute_;
incr_groute_ = nullptr;
break;
Expand All @@ -344,7 +352,9 @@ void Resizer::updateParasitics(bool save_guides)
}
parasitics_invalid_.clear();
break;
case ParasiticsSrc::global_routing: {
case ParasiticsSrc::global_routing:
case ParasiticsSrc::detailed_routing: {
// TODO: update detailed route for modified nets
incr_groute_->updateRoutes(save_guides);
for (const Net* net : parasitics_invalid_) {
global_router_->estimateRC(db_network_->staToDb(net));
Expand Down Expand Up @@ -391,6 +401,9 @@ void Resizer::ensureWireParasitic(const Pin* drvr_pin, const Net* net)
parasitics_invalid_.erase(net);
break;
}
case ParasiticsSrc::detailed_routing:
// TODO: call incremental drt for the modified net
break;
case ParasiticsSrc::none:
break;
}
Expand Down
18 changes: 12 additions & 6 deletions src/rsz/src/Resizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,8 @@ bool Resizer::replaceCell(Instance* inst,
designAreaIncr(area(replacement_master));

// Legalize the position of the instance in case it leaves the die
if (parasitics_src_ == ParasiticsSrc::global_routing) {
if (parasitics_src_ == ParasiticsSrc::global_routing
|| parasitics_src_ == ParasiticsSrc::detailed_routing) {
opendp_->legalCellPos(db_network_->staToDb(inst));
}
if (haveEstimatedParasitics()) {
Expand Down Expand Up @@ -2691,7 +2692,8 @@ void Resizer::repairDesign(double max_wire_length,
utl::SetAndRestore<bool> set_match_footprint(match_cell_footprint_,
match_cell_footprint);
resizePreamble();
if (parasitics_src_ == ParasiticsSrc::global_routing) {
if (parasitics_src_ == ParasiticsSrc::global_routing
|| parasitics_src_ == ParasiticsSrc::detailed_routing) {
opendp_->initMacrosAndGrid();
}
repair_design_->repairDesign(
Expand Down Expand Up @@ -2845,7 +2847,8 @@ void Resizer::repairSetup(double setup_margin,
utl::SetAndRestore<bool> set_match_footprint(match_cell_footprint_,
match_cell_footprint);
resizePreamble();
if (parasitics_src_ == ParasiticsSrc::global_routing) {
if (parasitics_src_ == ParasiticsSrc::global_routing
|| parasitics_src_ == ParasiticsSrc::detailed_routing) {
opendp_->initMacrosAndGrid();
}
repair_setup_->repairSetup(setup_margin,
Expand Down Expand Up @@ -2903,7 +2906,8 @@ void Resizer::repairHold(
LibertyCellSeq());

resizePreamble();
if (parasitics_src_ == ParasiticsSrc::global_routing) {
if (parasitics_src_ == ParasiticsSrc::global_routing
|| parasitics_src_ == ParasiticsSrc::detailed_routing) {
opendp_->initMacrosAndGrid();
}
repair_hold_->repairHold(setup_margin,
Expand Down Expand Up @@ -2948,7 +2952,8 @@ void Resizer::recoverPower(float recover_power_percent,
utl::SetAndRestore<bool> set_match_footprint(match_cell_footprint_,
match_cell_footprint);
resizePreamble();
if (parasitics_src_ == ParasiticsSrc::global_routing) {
if (parasitics_src_ == ParasiticsSrc::global_routing
|| parasitics_src_ == ParasiticsSrc::detailed_routing) {
opendp_->initMacrosAndGrid();
}
recover_power_->recoverPower(recover_power_percent);
Expand Down Expand Up @@ -3479,7 +3484,8 @@ Instance* Resizer::makeInstance(LibertyCell* cell,
db_inst->setSourceType(odb::dbSourceType::TIMING);
setLocation(db_inst, loc);
// Legalize the position of the instance in case it leaves the die
if (parasitics_src_ == ParasiticsSrc::global_routing) {
if (parasitics_src_ == ParasiticsSrc::global_routing
|| parasitics_src_ == ParasiticsSrc::detailed_routing) {
opendp_->legalCellPos(db_inst);
}
designAreaIncr(area(db_inst->getMaster()));
Expand Down
9 changes: 9 additions & 0 deletions src/rsz/src/Resizer.i
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ tclListNetworkSet(Tcl_Obj *const source,
$1 = ParasiticsSrc::placement;
else if (stringEq(arg, "global_routing"))
$1 = ParasiticsSrc::global_routing;
else if (stringEq(arg, "detailed_routing"))
$1 = ParasiticsSrc::detailed_routing;
else {
Tcl_SetResult(interp,const_cast<char*>("Error: parasitics source."), TCL_STATIC);
return TCL_ERROR;
Expand Down Expand Up @@ -816,6 +818,13 @@ set_worst_slack_nets_percent(float percent)
resizer->setWorstSlackNetsPercent(percent);
}

void
set_parasitics_src(ParasiticsSrc src)
{
Resizer *resizer = getResizer();
resizer->setParasiticsSrc(src);
}

} // namespace

%} // inline
3 changes: 3 additions & 0 deletions src/rsz/src/Resizer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ proc repair_timing { args } {
}

set match_cell_footprint [info exists flags(-match_cell_footprint)]
if { [design_is_routed] } {
rsz::set_parasitics_src "detailed_routing"
}

sta::check_argc_eq0 "repair_timing" $args
rsz::check_parasitics
Expand Down
Loading