Skip to content

Commit 940703b

Browse files
authored
Merge pull request #10236 from The-OpenROAD-Project-staging/secure-fix-repair-hold
rsz: Prevent hold repair from buffering internal output arcs
2 parents cede2ae + 9ed4780 commit 940703b

6 files changed

Lines changed: 157 additions & 9 deletions

File tree

src/rsz/src/RepairHold.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
#include "sta/Fuzzy.hh"
2323
#include "sta/Graph.hh"
2424
#include "sta/GraphClass.hh"
25-
#include "sta/GraphDelayCalc.hh"
26-
#include "sta/InputDrive.hh"
2725
#include "sta/Liberty.hh"
2826
#include "sta/LibertyClass.hh"
2927
#include "sta/MinMax.hh"
@@ -579,6 +577,13 @@ void RepairHold::repairEndHold(sta::Vertex* end_vertex,
579577
if (pred.searchTo(fanout, mode) && pred.searchThru(edge, mode)) {
580578
sta::Slack fanout_hold_slack = sta_->slack(fanout, min_);
581579
sta::Pin* load_pin = fanout->pin();
580+
if (load_pin == nullptr) {
581+
continue;
582+
}
583+
if (!network_->direction(load_pin)->isAnyInput()
584+
&& !network_->isTopLevelPort(load_pin)) {
585+
continue;
586+
}
582587
if (fanout_hold_slack < hold_margin) {
583588
load_pins.push_back(load_pin);
584589
Slacks fanout_slacks;
@@ -714,13 +719,7 @@ void RepairHold::makeHoldDelay(sta::Vertex* drvr,
714719

715720
// New insert buffer behavior
716721
sta::Pin* drvr_pin = drvr->pin();
717-
odb::dbObject* drvr_db_pin = db_network_->staToDb(drvr_pin);
718-
odb::dbNet* drvr_dbnet = nullptr;
719-
if (drvr_db_pin->getObjectType() == odb::dbObjectType::dbBTermObj) {
720-
drvr_dbnet = static_cast<odb::dbBTerm*>(drvr_db_pin)->getNet();
721-
} else {
722-
drvr_dbnet = static_cast<odb::dbITerm*>(drvr_db_pin)->getNet();
723-
}
722+
odb::dbNet* drvr_dbnet = db_network_->findFlatDbNet(drvr_pin);
724723

725724
sta::Net* drvr_net = db_network_->dbToSta(drvr_dbnet);
726725

@@ -734,6 +733,9 @@ void RepairHold::makeHoldDelay(sta::Vertex* drvr,
734733
load_pins_set.insert(const_cast<sta::Pin*>(load_pin));
735734
}
736735
}
736+
if (load_pins_set.empty()) {
737+
return;
738+
}
737739

738740
buffer = resizer_->insertBufferBeforeLoads(
739741
drvr_net, &load_pins_set, buffer_cell, &loc, "hold");

src/rsz/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ TESTS = [
100100
"repair_hold8",
101101
"repair_hold9",
102102
"repair_hold9_verbose",
103+
"repair_hold_multi_output_load",
103104
"repair_setup1",
104105
"repair_setup1_multi",
105106
"repair_setup2",

src/rsz/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ or_integration_tests(
8484
repair_hold13
8585
repair_hold14
8686
repair_hold15
87+
repair_hold_multi_output_load
8788
repair_setup_sizedown
8889
repair_setup_sizeup_match
8990
repair_setup1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
VERSION 5.8 ;
2+
DIVIDERCHAR "/" ;
3+
BUSBITCHARS "[]" ;
4+
DESIGN repair_hold_multi_output_load ;
5+
UNITS DISTANCE MICRONS 1000 ;
6+
DIEAREA ( 0 0 ) ( 20000 1000 ) ;
7+
ROW ROW_0 asap7sc7p5t 0 0 N DO 370 BY 1 STEP 54 0 ;
8+
COMPONENTS 4 ;
9+
- u_capture_con DFFHQNx1_ASAP7_75t_R + PLACED ( 7992 0 ) N ;
10+
- u_capture_sn DFFHQNx1_ASAP7_75t_R + PLACED ( 11988 0 ) N ;
11+
- u_fa FAx1_ASAP7_75t_R + PLACED ( 3996 0 ) N ;
12+
- u_launch DFFHQNx1_ASAP7_75t_R + PLACED ( 1026 0 ) N ;
13+
END COMPONENTS
14+
PINS 2 ;
15+
- clk + NET clk + DIRECTION INPUT + USE SIGNAL ;
16+
- d_in + NET d_in + DIRECTION INPUT + USE SIGNAL ;
17+
END PINS
18+
NETS 9 ;
19+
- capture_con_qn ( u_capture_con QN ) + USE SIGNAL ;
20+
- capture_sn_qn ( u_capture_sn QN ) + USE SIGNAL ;
21+
- clk ( PIN clk ) ( u_launch CLK ) ( u_capture_sn CLK ) ( u_capture_con CLK ) + USE SIGNAL ;
22+
- con_net ( u_fa CON ) ( u_capture_con D ) + USE SIGNAL ;
23+
- d_in ( PIN d_in ) ( u_launch D ) + USE SIGNAL ;
24+
- launch_qn ( u_launch QN ) ( u_fa A ) + USE SIGNAL ;
25+
- one_ ( u_fa B ) + USE POWER ;
26+
- sn_net ( u_fa SN ) ( u_capture_sn D ) + USE SIGNAL ;
27+
- zero_ ( u_fa CI ) + USE GROUND ;
28+
END NETS
29+
END DESIGN
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
[INFO ODB-0227] LEF file: asap7/asap7_tech_1x_201209.lef, created 30 layers, 9 vias
2+
[INFO ODB-0227] LEF file: asap7/asap7sc7p5t_28_R_1x_220121a.lef, created 212 library cells
3+
[INFO ODB-0128] Design: repair_hold_multi_output_load
4+
[INFO ODB-0130] Created 2 pins.
5+
[INFO ODB-0131] Created 4 components and 22 component-terminals.
6+
[INFO ODB-0133] Created 9 nets and 14 connections.
7+
Startpoint: u_launch (rising edge-triggered flip-flop clocked by clk)
8+
Endpoint: u_capture_con (rising edge-triggered flip-flop clocked by clk)
9+
Path Group: clk
10+
Path Type: min
11+
12+
Delay Time Description
13+
---------------------------------------------------------
14+
0.00 0.00 ^ u_launch/CLK (DFFHQNx1_ASAP7_75t_R)
15+
38.23 38.23 ^ u_launch/QN (DFFHQNx1_ASAP7_75t_R)
16+
18.85 57.08 v u_fa/CON (FAx1_ASAP7_75t_R)
17+
0.14 57.22 v u_capture_con/D (DFFHQNx1_ASAP7_75t_R)
18+
57.22 data arrival time
19+
20+
80.00 80.00 min_delay
21+
0.00 80.00 clock reconvergence pessimism
22+
5.89 85.89 library hold time
23+
85.89 data required time
24+
---------------------------------------------------------
25+
85.89 data required time
26+
-57.22 data arrival time
27+
---------------------------------------------------------
28+
-28.67 slack (VIOLATED)
29+
30+
31+
Startpoint: u_launch (rising edge-triggered flip-flop clocked by clk)
32+
Endpoint: u_capture_sn (rising edge-triggered flip-flop clocked by clk)
33+
Path Group: clk
34+
Path Type: min
35+
36+
Delay Time Description
37+
---------------------------------------------------------
38+
0.00 0.00 ^ u_launch/CLK (DFFHQNx1_ASAP7_75t_R)
39+
37.06 37.06 v u_launch/QN (DFFHQNx1_ASAP7_75t_R)
40+
24.47 61.53 ^ u_fa/CON (FAx1_ASAP7_75t_R)
41+
20.68 82.21 v u_fa/SN (FAx1_ASAP7_75t_R)
42+
0.35 82.56 v u_capture_sn/D (DFFHQNx1_ASAP7_75t_R)
43+
82.56 data arrival time
44+
45+
80.00 80.00 min_delay
46+
0.00 80.00 clock reconvergence pessimism
47+
5.71 85.71 library hold time
48+
85.71 data required time
49+
---------------------------------------------------------
50+
85.71 data required time
51+
-82.56 data arrival time
52+
---------------------------------------------------------
53+
-3.16 slack (VIOLATED)
54+
55+
56+
[INFO RSZ-0046] Found 2 endpoints with hold violations.
57+
Iteration | Resized | Buffers | Cloned Gates | Area | WNS | TNS | Endpoint
58+
--------------------------------------------------------------------------------------
59+
0 | 0 | 0 | 0 | +0.0% | -28.672 | -31.828 | u_capture_con/D
60+
final | 0 | 2 | 0 | +18.9% | 16.822 | 0.000 | u_capture_con/D
61+
--------------------------------------------------------------------------------------
62+
[INFO RSZ-0032] Inserted 2 hold buffers.
63+
Startpoint: u_launch (rising edge-triggered flip-flop clocked by clk)
64+
Endpoint: u_capture_con (rising edge-triggered flip-flop clocked by clk)
65+
Path Group: clk
66+
Path Type: min
67+
68+
Delay Time Description
69+
---------------------------------------------------------
70+
0.00 0.00 ^ u_launch/CLK (DFFHQNx1_ASAP7_75t_R)
71+
38.23 38.23 ^ u_launch/QN (DFFHQNx1_ASAP7_75t_R)
72+
17.19 55.42 v u_fa/CON (FAx1_ASAP7_75t_R)
73+
49.11 104.53 v hold1/Y (HB4xp67_ASAP7_75t_R)
74+
0.06 104.59 v u_capture_con/D (DFFHQNx1_ASAP7_75t_R)
75+
104.59 data arrival time
76+
77+
80.00 80.00 min_delay
78+
0.00 80.00 clock reconvergence pessimism
79+
7.77 87.77 library hold time
80+
87.77 data required time
81+
---------------------------------------------------------
82+
87.77 data required time
83+
-104.59 data arrival time
84+
---------------------------------------------------------
85+
16.82 slack (MET)
86+
87+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Targeted regression for issue #10213. The placed DEF contains one
2+
# FAx1_ASAP7_75t_R whose CON output drives the repaired endpoint and whose SN
3+
# output is on a different net. The launch net is marked dont_touch so
4+
# repair_timing -hold must attempt repair on the FA CON net itself.
5+
source "helpers.tcl"
6+
source asap7/asap7.vars
7+
8+
read_liberty asap7/asap7sc7p5t_INVBUF_RVT_FF_nldm_220122.lib.gz
9+
read_liberty asap7/asap7sc7p5t_SIMPLE_RVT_FF_nldm_211120.lib.gz
10+
read_liberty asap7/asap7sc7p5t_SEQ_RVT_FF_nldm_220123.lib
11+
read_lef asap7/asap7_tech_1x_201209.lef
12+
read_lef asap7/asap7sc7p5t_28_R_1x_220121a.lef
13+
read_def repair_hold_multi_output_load.def
14+
15+
create_clock -name clk -period 10 [get_ports clk]
16+
set_min_delay 80 -from [get_clocks clk] -to [get_clocks clk]
17+
18+
source asap7/setRC.tcl
19+
estimate_parasitics -placement
20+
21+
set_dont_touch launch_qn
22+
23+
report_checks -path_delay min -to [get_pins u_capture_con/D]
24+
report_checks -path_delay min -to [get_pins u_capture_sn/D]
25+
26+
repair_timing -hold -allow_setup_violations
27+
28+
report_checks -path_delay min -to [get_pins u_capture_con/D]

0 commit comments

Comments
 (0)