diff --git a/src/rsz/include/rsz/Resizer.hh b/src/rsz/include/rsz/Resizer.hh index c0dba8182f9..2e1285d796f 100644 --- a/src/rsz/include/rsz/Resizer.hh +++ b/src/rsz/include/rsz/Resizer.hh @@ -152,7 +152,8 @@ enum class ParasiticsSrc { none, placement, - global_routing + global_routing, + detailed_routing }; struct ParasiticsResistance @@ -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; diff --git a/src/rsz/src/BufferedNet.cc b/src/rsz/src/BufferedNet.cc index db68d439d4c..31f3761b447 100644 --- a/src/rsz/src/BufferedNet.cc +++ b/src/rsz/src/BufferedNet.cc @@ -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; diff --git a/src/rsz/src/EstimateWireParasitics.cc b/src/rsz/src/EstimateWireParasitics.cc index 94754f98219..872ac6cebdf 100644 --- a/src/rsz/src/EstimateWireParasitics.cc +++ b/src/rsz/src/EstimateWireParasitics.cc @@ -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; } @@ -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); @@ -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; @@ -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)); @@ -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; } diff --git a/src/rsz/src/Resizer.cc b/src/rsz/src/Resizer.cc index 9f4668116ce..3267004e456 100644 --- a/src/rsz/src/Resizer.cc +++ b/src/rsz/src/Resizer.cc @@ -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()) { @@ -2691,7 +2692,8 @@ void Resizer::repairDesign(double max_wire_length, utl::SetAndRestore 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( @@ -2845,7 +2847,8 @@ void Resizer::repairSetup(double setup_margin, utl::SetAndRestore 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, @@ -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, @@ -2948,7 +2952,8 @@ void Resizer::recoverPower(float recover_power_percent, utl::SetAndRestore 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); @@ -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())); diff --git a/src/rsz/src/Resizer.i b/src/rsz/src/Resizer.i index 5240fcc06e3..73415807ade 100644 --- a/src/rsz/src/Resizer.i +++ b/src/rsz/src/Resizer.i @@ -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("Error: parasitics source."), TCL_STATIC); return TCL_ERROR; @@ -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 diff --git a/src/rsz/src/Resizer.tcl b/src/rsz/src/Resizer.tcl index 19b765a95f9..e8871e8aadb 100644 --- a/src/rsz/src/Resizer.tcl +++ b/src/rsz/src/Resizer.tcl @@ -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