Skip to content
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
6 changes: 6 additions & 0 deletions src/est/src/EstimateParasitics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ void EstimateParasitics::updateParasitics(bool save_guides)
"updateParasitics() called with incremental parasitics disabled");
}

// Call clearNetDrvrPinMap only without full blown ConcreteNetwork::clear()
// This is because netlist changes may invalidate cached net driver pin data
sta::LibertyLibrary* default_lib = network_->defaultLibertyLibrary();
network_->Network::clear();
network_->setDefaultLibertyLibrary(default_lib);

switch (parasitics_src_) {
case ParasiticsSrc::placement:
for (const Net* net : parasitics_invalid_) {
Expand Down
9 changes: 5 additions & 4 deletions src/rsz/src/ConcreteSwapArithModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void ConcreteSwapArithModules::init()
init_ = true;
}

void ConcreteSwapArithModules::replaceArithModules(const int path_count,
bool ConcreteSwapArithModules::replaceArithModules(const int path_count,
const std::string& target,
const float slack_threshold)
{
Expand All @@ -70,11 +70,11 @@ void ConcreteSwapArithModules::replaceArithModules(const int path_count,
std::set<dbModInst*> arithInsts;
findCriticalInstances(path_count, target, slack_threshold, arithInsts);
if (arithInsts.empty()) {
return;
return false;
}

// Replace arithmetic instances to improve target QoR
doSwapInstances(arithInsts, target);
return doSwapInstances(arithInsts, target);
}

void ConcreteSwapArithModules::findCriticalInstances(
Expand Down Expand Up @@ -232,7 +232,7 @@ bool ConcreteSwapArithModules::hasArithOperatorProperty(
return false;
}

void ConcreteSwapArithModules::doSwapInstances(
bool ConcreteSwapArithModules::doSwapInstances(
const std::set<dbModInst*>& insts,
const std::string& target)
{
Expand Down Expand Up @@ -278,6 +278,7 @@ void ConcreteSwapArithModules::doSwapInstances(
"{} arithmetic instances have swapped to improve '{}' target",
swapped_count,
target);
return (swapped_count > 0);
}

void ConcreteSwapArithModules::produceNewModuleName(const std::string& old_name,
Expand Down
4 changes: 2 additions & 2 deletions src/rsz/src/ConcreteSwapArithModules.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ConcreteSwapArithModules : public SwapArithModules
explicit ConcreteSwapArithModules(Resizer* resizer);
~ConcreteSwapArithModules() override = default;

void replaceArithModules(int path_count,
bool replaceArithModules(int path_count,
const std::string& target,
float slack_threshold) override;
void collectArithInstsOnPath(const Path* path,
Expand All @@ -26,7 +26,7 @@ class ConcreteSwapArithModules : public SwapArithModules
const std::string& target,
float slack_threshold,
std::set<dbModInst*>& insts) override;
void doSwapInstances(const std::set<dbModInst*>& insts,
bool doSwapInstances(const std::set<dbModInst*>& insts,
const std::string& target) override;

protected:
Expand Down
7 changes: 6 additions & 1 deletion src/rsz/src/Resizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4492,7 +4492,12 @@ void Resizer::swapArithModules(int path_count,
== est::ParasiticsSrc::detailed_routing) {
opendp_->initMacrosAndGrid();
}
swap_arith_modules_->replaceArithModules(path_count, target, slack_margin);
est::IncrementalParasiticsGuard guard(estimate_parasitics_);
if (swap_arith_modules_->replaceArithModules(
path_count, target, slack_margin)) {
estimate_parasitics_->updateParasitics();
sta_->findRequireds();
}
}
////////////////////////////////////////////////////////////////
// Journal to roll back changes
Expand Down
4 changes: 2 additions & 2 deletions src/rsz/src/SwapArithModules.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class SwapArithModules : public sta::dbStaState
explicit SwapArithModules(Resizer* resizer) : resizer_(resizer) {}
~SwapArithModules() override = default;

virtual void replaceArithModules(int path_count,
virtual bool replaceArithModules(int path_count,
const std::string& target,
float slack_threshold)
= 0;
Expand All @@ -60,7 +60,7 @@ class SwapArithModules : public sta::dbStaState
float slack_threshold,
std::set<dbModInst*>& insts)
= 0;
virtual void doSwapInstances(const std::set<dbModInst*>& insts,
virtual bool doSwapInstances(const std::set<dbModInst*>& insts,
const std::string& target)
= 0;

Expand Down
4 changes: 2 additions & 2 deletions src/rsz/test/repair_setup9_hier.ok
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ tns max -3.964
| Buffers | Gates | Buffers | Gates | Swaps | | | | Endpts | Endpt
--------------------------------------------------------------------------------------------------------------
0 | 0 | 0 | 0 | 0 | 0 | +0.0% | -0.425 | -4.0 | 19 | u_mid2/u_leaf3/dff2/D
final | 0 | 13 | 3 | 0 | 0 | +7.5% | -0.401 | -4.4 | 19 | u_mid2/u_leaf3/dff2/D
final | 0 | 13 | 2 | 0 | 0 | +5.9% | -0.401 | -4.1 | 19 | u_mid2/u_leaf3/dff2/D
--------------------------------------------------------------------------------------------------------------
[INFO RSZ-0045] Inserted 3 buffers, 1 to split loads.
[INFO RSZ-0045] Inserted 2 buffers, 1 to split loads.
[INFO RSZ-0051] Resized 13 instances: 13 up, 0 up match, 0 down, 0 VT
[WARNING RSZ-0062] Unable to repair all setup violations.
No differences found.
Expand Down
9 changes: 4 additions & 5 deletions src/rsz/test/repair_setup9_hier_out.defok
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ ROW ROW_853 FreePDK45_38x28_10R_NP_162NW_34O 0 2388400 FS DO 210 BY 1 STEP 380 0
ROW ROW_854 FreePDK45_38x28_10R_NP_162NW_34O 0 2391200 N DO 210 BY 1 STEP 380 0 ;
ROW ROW_855 FreePDK45_38x28_10R_NP_162NW_34O 0 2394000 FS DO 210 BY 1 STEP 380 0 ;
ROW ROW_856 FreePDK45_38x28_10R_NP_162NW_34O 0 2396800 N DO 210 BY 1 STEP 380 0 ;
COMPONENTS 37 ;
COMPONENTS 36 ;
- buf1 BUF_X2 + PLACED ( 1520 0 ) N ;
- buf2 BUF_X2 + PLACED ( 380 0 ) N ;
- dff_out1 DFF_X1 + PLACED ( 15580 2800 ) FS ;
Expand All @@ -888,7 +888,6 @@ COMPONENTS 37 ;
- u_mid1/u_leaf2/dff2 DFF_X1 + PLACED ( 15580 5600 ) N ;
- u_mid1/u_leaf2/dff3 DFF_X1 + PLACED ( 1520 16800 ) N ;
- u_mid1/u_leaf2/rebuffer1 BUF_X4 + SOURCE TIMING + PLACED ( 21850 6990 ) N ;
- u_mid1/u_leaf2/rebuffer9 BUF_X4 + SOURCE TIMING + PLACED ( 23530 9568 ) N ;
- u_mid1/u_leaf2/split2 BUF_X4 + SOURCE TIMING + PLACED ( 23530 8343 ) N ;
- u_mid2/buf1 BUF_X2 + PLACED ( 1520 5600 ) N ;
- u_mid2/dff_out1 DFF_X1 + PLACED ( 22040 0 ) N ;
Expand All @@ -909,7 +908,7 @@ PINS 7 ;
- out1 + NET out1 + DIRECTION OUTPUT + USE SIGNAL ;
- out2 + NET out2 + DIRECTION OUTPUT + USE SIGNAL ;
END PINS
NETS 32 ;
NETS 31 ;
- clk ( PIN clk ) ( dff_out1 CK ) ( dff_out2 CK ) ( u_mid1/dff_load1 CK ) ( u_mid1/dff_load10 CK ) ( u_mid1/dff_load2 CK ) ( u_mid1/dff_load3 CK )
( u_mid1/dff_load4 CK ) ( u_mid1/dff_load5 CK ) ( u_mid1/dff_load6 CK ) ( u_mid1/dff_load7 CK ) ( u_mid1/dff_load8 CK ) ( u_mid1/dff_load9 CK ) ( u_mid1/dff_out1 CK ) ( u_mid1/dff_out2 CK )
( u_mid1/u_leaf1/dff1 CK ) ( u_mid1/u_leaf1/dff2 CK ) ( u_mid1/u_leaf2/dff1 CK ) ( u_mid1/u_leaf2/dff2 CK ) ( u_mid1/u_leaf2/dff3 CK ) ( u_mid2/dff_out1 CK ) ( u_mid2/u_leaf3/dff1 CK ) ( u_mid2/u_leaf3/dff2 CK )
Expand All @@ -934,9 +933,9 @@ NETS 32 ;
- u_mid1/u_leaf2/n1 ( u_mid1/u_leaf2/buf1 A ) ( u_mid1/u_leaf2/buf2 A ) ( u_mid1/u_leaf2/dff1 Q ) + USE SIGNAL ;
- u_mid1/u_leaf2/n2 ( u_mid1/u_leaf2/buf1 Z ) ( u_mid1/u_leaf2/dff2 D ) + USE SIGNAL ;
- u_mid1/u_leaf2/n3 ( u_mid1/u_leaf2/buf2 Z ) ( u_mid1/u_leaf2/dff3 D ) + USE SIGNAL ;
- u_mid1/u_leaf2/net1 ( u_mid1/u_leaf2/rebuffer9 A ) ( u_mid1/u_leaf2/split2 A ) ( u_mid1/u_leaf2/rebuffer1 Z ) + USE SIGNAL ;
- u_mid1/u_leaf2/net1 ( u_mid1/dff_load2 D ) ( u_mid1/dff_load10 D ) ( u_mid1/dff_load1 D ) ( u_mid1/dff_load4 D ) ( u_mid1/dff_load6 D ) ( u_mid1/dff_load9 D ) ( u_mid1/u_leaf2/split2 A )
( u_mid1/u_leaf2/rebuffer1 Z ) + USE SIGNAL ;
- u_mid1/u_leaf2/net2 ( u_mid1/dff_load8 D ) ( u_mid1/u_leaf2/split2 Z ) ( u_mid1/dff_load7 D ) ( u_mid1/dff_load5 D ) ( u_mid1/dff_load3 D ) ( u_mid1/dff_out2 D ) + USE SIGNAL ;
- u_mid1/u_leaf2/net9 ( u_mid1/dff_load9 D ) ( u_mid1/u_leaf2/rebuffer9 Z ) ( u_mid1/dff_load6 D ) ( u_mid1/dff_load4 D ) ( u_mid1/dff_load1 D ) ( u_mid1/dff_load10 D ) ( u_mid1/dff_load2 D ) + USE SIGNAL ;
- u_mid2/l3_out ( u_mid2/buf1 A ) ( u_mid2/u_leaf3/dff2 Q ) + USE SIGNAL ;
- u_mid2/l4_out ( u_mid2/u_leaf4/dff1 Q ) + USE SIGNAL ;
- u_mid2/n1 ( u_mid2/buf1 Z ) ( u_mid2/dff_out1 D ) + USE SIGNAL ;
Expand Down
22 changes: 8 additions & 14 deletions src/rsz/test/repair_setup9_hier_out.vok
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,31 @@ module mid1 (clk,
output out1;
output out2;

wire net_o_3;
wire net_o_1;
wire net_o;
wire l2_out2;
wire l2_out1;
wire l1_out;

DFF_X1 dff_load1 (.D(net_o_3),
DFF_X1 dff_load1 (.D(net_o),
.CK(clk));
DFF_X1 dff_load10 (.D(net_o_3),
DFF_X1 dff_load10 (.D(net_o),
.CK(clk));
DFF_X1 dff_load2 (.D(net_o_3),
DFF_X1 dff_load2 (.D(net_o),
.CK(clk));
DFF_X1 dff_load3 (.D(net_o_1),
.CK(clk));
DFF_X1 dff_load4 (.D(net_o_3),
DFF_X1 dff_load4 (.D(net_o),
.CK(clk));
DFF_X1 dff_load5 (.D(net_o_1),
.CK(clk));
DFF_X1 dff_load6 (.D(net_o_3),
DFF_X1 dff_load6 (.D(net_o),
.CK(clk));
DFF_X1 dff_load7 (.D(net_o_1),
.CK(clk));
DFF_X1 dff_load8 (.D(net_o_1),
.CK(clk));
DFF_X1 dff_load9 (.D(net_o_3),
DFF_X1 dff_load9 (.D(net_o),
.CK(clk));
DFF_X1 dff_out1 (.D(l1_out),
.CK(clk),
Expand All @@ -86,8 +85,7 @@ module mid1 (clk,
leaf1 u_leaf1 (.clk(clk),
.in1(in1),
.out1(l1_out));
leaf2 u_leaf2 (.net_o_3(net_o_3),
.net_o_1(net_o_1),
leaf2 u_leaf2 (.net_o_1(net_o_1),
.net_o(net_o),
.clk(clk),
.in1(in2),
Expand Down Expand Up @@ -116,14 +114,12 @@ module leaf1 (clk,
.CK(clk),
.Q(out1));
endmodule
module leaf2 (net_o_3,
net_o_1,
module leaf2 (net_o_1,
net_o,
clk,
in1,
out1,
out2);
output net_o_3;
output net_o_1;
output net_o;
input clk;
Expand All @@ -135,8 +131,6 @@ module leaf2 (net_o_3,
wire n2;
wire n3;

BUF_X4 rebuffer9 (.A(net_o),
.Z(net_o_3));
BUF_X4 split2 (.A(net_o),
.Z(net_o_1));
BUF_X4 rebuffer1 (.A(out1),
Expand Down
Loading