Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#5400 from The-OpenROAD-Projec…
Browse files Browse the repository at this point in the history
…t-staging/secure-bufrem-p4

enable 100% setup fixing by default
  • Loading branch information
maliberty authored Jul 18, 2024
2 parents 417ee6e + 3ca94ab commit d48987e
Show file tree
Hide file tree
Showing 19 changed files with 263 additions and 224 deletions.
2 changes: 1 addition & 1 deletion src/rsz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ repair_timing
| `-skip_gate_cloning` | Flag to skip gate cloning. The default value is `False`, and the allowed values are bools. |
| `-skip_buffering` | Flag to skip rebuffering and load splitting. The default value is `False`, and the allowed values are bools. |
| `-enable_buffer_removal` | Flag to enable buffer removal during setup fixing. The default value is `False`, and the allowed values are bools. |
| `-repair_tns` | Percentage of violating endpoints to repair (0-100). When `tns_end_percent` is zero (the default), only the worst endpoint is repaired. When `tns_end_percent` is 100, all violating endpoints are repaired. |
| `-repair_tns` | Percentage of violating endpoints to repair (0-100). When `tns_end_percent` is zero, only the worst endpoint is repaired. When `tns_end_percent` is 100 (default), all violating endpoints are repaired. |
| `-max_utilization` | Defines the percentage of core area used. |
| `-max_buffer_percent` | Specify a maximum number of buffers to insert to repair hold violations as a percentage of the number of instances in the design. The default value is `20`, and the allowed values are integers `[0, 100]`. |
| `-verbose` | Enable verbose logging of the repair progress. |
Expand Down
6 changes: 6 additions & 0 deletions src/rsz/src/RepairSetup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ void RepairSetup::repairSetup(const float setup_slack_margin,
// Always repair the worst endpoint, even if tns percent is zero.
max_end_count = max(max_end_count, 1);
swap_pin_inst_set_.clear(); // Make sure we do not swap the same pin twice.
logger_->info(RSZ,
99,
"Repairing {} out of {} ({:0.2f}%) violating endpoints...",
max_end_count,
violating_ends.size(),
repair_tns_end_percent * 100.0);

// Ensure that max cap and max fanout violations don't get worse
sta_->checkCapacitanceLimitPreamble();
Expand Down
2 changes: 1 addition & 1 deletion src/rsz/src/Resizer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ proc repair_timing { args } {
}
set max_buffer_percent [expr $max_buffer_percent / 100.0]

set repair_tns_end_percent 0.0
set repair_tns_end_percent 1.0
if { [info exists keys(-repair_tns)] } {
set repair_tns_end_percent $keys(-repair_tns)
sta::check_percent "-repair_tns" $repair_tns_end_percent
Expand Down
400 changes: 200 additions & 200 deletions src/rsz/test/buffer_varying_lengths.defok

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions src/rsz/test/buffer_varying_lengths.ok
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
[INFO RSZ-0037] Found 118 long wires.
[INFO RSZ-0038] Inserted 162 buffers in 118 nets.
[INFO RSZ-0039] Resized 183 instances.
worst slack -0.27
worst slack -0.266
tns -28.587
[INFO RSZ-0094] Found 200 endpoints with setup violations.
[INFO RSZ-0041] Resized 2 instances.
[INFO RSZ-0099] Repairing 200 out of 200 (100.00%) violating endpoints...
[INFO RSZ-0041] Resized 895 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
[INFO RSZ-0033] No hold violations found.
worst slack -0.27
worst slack -0.266
tns -27.381
No differences found.
6 changes: 4 additions & 2 deletions src/rsz/test/buffer_varying_lengths.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ set_output_delay -clock clk 0.0 [all_outputs]
set_wire_rc -layer metal2
estimate_parasitics -placement
repair_design
report_worst_slack -max
report_worst_slack -max -digits 3
report_tns -digits 3
repair_timing
report_worst_slack -max
report_worst_slack -max -digits 3
report_tns -digits 3
set def_file [make_result_file buffer_varying_lengths.def]
write_def $def_file
diff_files buffer_varying_lengths.defok $def_file
1 change: 1 addition & 0 deletions src/rsz/test/repair_fanout6.ok
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Pin Limit Fanout Slack
fanout1/X 20 20 0 (MET)

[INFO RSZ-0094] Found 6400 endpoints with setup violations.
[INFO RSZ-0099] Repairing 1 out of 6400 (0.00%) violating endpoints...
[INFO RSZ-0045] Inserted 17 buffers, 1 to split loads.
[INFO RSZ-0041] Resized 150 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Expand Down
1 change: 1 addition & 0 deletions src/rsz/test/repair_fanout7.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ load DFF_X1 CK D 300000 metal3 1000
[INFO ODB-0133] Created 155 nets and 459 connections.
worst slack -23.63
[INFO RSZ-0094] Found 150 endpoints with setup violations.
[INFO RSZ-0099] Repairing 150 out of 150 (100.00%) violating endpoints...
Iteration | Removed | Resized | Inserted | Cloned Gates | Pin Swaps | WNS | TNS | Endpoint
| Buffers | | Buffers | | | | |
-------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/rsz/test/repair_fanout8.ok
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ load DFF_X1 CK D 300000 metal3 1000
[INFO ODB-0133] Created 155 nets and 459 connections.
worst slack -23.63
[INFO RSZ-0094] Found 150 endpoints with setup violations.
[INFO RSZ-0099] Repairing 150 out of 150 (100.00%) violating endpoints...
Iteration | Removed | Resized | Inserted | Cloned Gates | Pin Swaps | WNS | TNS | Endpoint
| Buffers | | Buffers | | | | |
-------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/rsz/test/repair_setup1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Path Type: max


[INFO RSZ-0094] Found 4 endpoints with setup violations.
[INFO RSZ-0099] Repairing 4 out of 4 (100.00%) violating endpoints...
[INFO RSZ-0040] Inserted 3 buffers.
[INFO RSZ-0041] Resized 18 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Expand Down
6 changes: 4 additions & 2 deletions src/rsz/test/repair_setup2.ok
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ worst slack -0.28
[INFO RSZ-0038] Inserted 3 buffers in 3 nets.
[INFO RSZ-0039] Resized 2 instances.
[INFO RSZ-0094] Found 2 endpoints with setup violations.
[INFO RSZ-0099] Repairing 2 out of 2 (100.00%) violating endpoints...
Iteration | Removed | Resized | Inserted | Cloned Gates | Pin Swaps | WNS | TNS | Endpoint
| Buffers | | Buffers | | | | |
-------------------------------------------------------------------------------------------------
0 | 0 | 0 | 0 | 0 | 0 | -0.117 | -0.194 | y2
5 | 0 | 0 | 0 | 0 | 2 | -0.117 | -0.194 | y2
final | 0 | 0 | 0 | 0 | 2 | -0.117 | -0.194 | y2
7 | 0 | 0 | 0 | 0 | 3 | -0.117 | -0.194 | y2
final | 0 | 0 | 0 | 0 | 3 | -0.117 | -0.194 | y2
-------------------------------------------------------------------------------------------------
[INFO RSZ-0043] Swapped pins on 2 instances.
[INFO RSZ-0043] Swapped pins on 3 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
worst slack -0.12
1 change: 1 addition & 0 deletions src/rsz/test/repair_setup3.ok
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[INFO ODB-0132] Created 2 special nets and 0 connections.
[INFO ODB-0133] Created 6 nets and 13 connections.
[INFO RSZ-0094] Found 2 endpoints with setup violations.
[INFO RSZ-0099] Repairing 2 out of 2 (100.00%) violating endpoints...
[INFO RSZ-0041] Resized 2 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
7 changes: 5 additions & 2 deletions src/rsz/test/repair_setup4.ok
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
[INFO ODB-0132] Created 2 special nets and 34 connections.
[INFO ODB-0133] Created 7 nets and 30 connections.
worst slack -1.95
tns -6.294
[INFO RSZ-0094] Found 6 endpoints with setup violations.
[INFO RSZ-0040] Inserted 2 buffers.
[INFO RSZ-0041] Resized 17 instances.
[INFO RSZ-0099] Repairing 6 out of 6 (100.00%) violating endpoints...
[INFO RSZ-0040] Inserted 3 buffers.
[INFO RSZ-0041] Resized 44 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
worst slack -0.65
tns -2.874
3 changes: 3 additions & 0 deletions src/rsz/test/repair_setup4.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ set_wire_rc -layer metal3
estimate_parasitics -placement

report_worst_slack -max
report_tns -digits 3
write_verilog_for_eqy repair_setup4 before "None"
repair_timing -setup
run_equivalence_test repair_setup4 ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max
report_tns -digits 3

33 changes: 22 additions & 11 deletions src/rsz/test/repair_setup4_verbose.ok
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,36 @@
[INFO ODB-0131] Created 17 components and 92 component-terminals.
[INFO ODB-0132] Created 2 special nets and 34 connections.
[INFO ODB-0133] Created 7 nets and 30 connections.
worst slack -1.95
worst slack -1.954
[INFO RSZ-0094] Found 6 endpoints with setup violations.
[INFO RSZ-0099] Repairing 6 out of 6 (100.00%) violating endpoints...
Iteration | Removed | Resized | Inserted | Cloned Gates | Pin Swaps | WNS | TNS | Endpoint
| Buffers | | Buffers | | | | |
-------------------------------------------------------------------------------------------------
0 | 0 | 0 | 0 | 0 | 0 | -1.954 | -6.294 | r2/D
10 | 0 | 8 | 3 | 0 | 0 | -0.865 | -3.085 | r2/D
19 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
20 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
20 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
21 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
22 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
23 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
24 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
25 | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
final | 0 | 17 | 3 | 0 | 0 | -0.654 | -2.908 | r2/D
30 | 0 | 25 | 7 | 0 | 0 | -0.663 | -2.800 | r2/D
35 | 0 | 26 | 7 | 0 | 0 | -0.652 | -2.874 | r2/D
40 | 0 | 29 | 9 | 0 | 0 | -0.652 | -2.959 | r2/D
46 | 0 | 32 | 9 | 0 | 0 | -0.652 | -2.874 | r2/D
50 | 0 | 35 | 9 | 0 | 0 | -0.663 | -2.600 | r2/D
57 | 0 | 38 | 11 | 0 | 0 | -0.652 | -2.874 | r2/D
60 | 0 | 40 | 11 | 0 | 0 | -0.663 | -2.610 | r2/D
68 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
69 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
70 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
70 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
71 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
72 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
73 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
74 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
75 | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
final | 0 | 44 | 13 | 0 | 0 | -0.652 | -2.874 | r2/D
-------------------------------------------------------------------------------------------------
[INFO RSZ-0040] Inserted 2 buffers.
[INFO RSZ-0041] Resized 17 instances.
[INFO RSZ-0040] Inserted 3 buffers.
[INFO RSZ-0041] Resized 44 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
worst slack -0.65
worst slack -0.652
5 changes: 3 additions & 2 deletions src/rsz/test/repair_setup4_verbose.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ source Nangate45/Nangate45.rc
set_wire_rc -layer metal3
estimate_parasitics -placement

report_worst_slack -max
report_worst_slack -max -digits 3
write_verilog_for_eqy repair_setup4_verbose before "None"
repair_timing -verbose -setup
run_equivalence_test repair_setup4_verbose ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max
report_worst_slack -max -digits 3

1 change: 1 addition & 0 deletions src/rsz/test/repair_setup5.ok
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[INFO ODB-0133] Created 6 nets and 10 connections.
worst slack -1.88
[INFO RSZ-0094] Found 1 endpoints with setup violations.
[INFO RSZ-0099] Repairing 1 out of 1 (100.00%) violating endpoints...
[INFO RSZ-0041] Resized 15 instances.
Repair timing output passed/skipped equivalence test
worst slack 0.09
1 change: 1 addition & 0 deletions src/rsz/test/repair_setup6.ok
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ delta HPWL 0 %

worst slack -0.39
[INFO RSZ-0094] Found 4 endpoints with setup violations.
[INFO RSZ-0099] Repairing 4 out of 4 (100.00%) violating endpoints...
[INFO RSZ-0040] Inserted 2 buffers.
[INFO RSZ-0041] Resized 18 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Expand Down
1 change: 1 addition & 0 deletions src/rsz/test/repair_setup7.ok
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
[INFO ODB-0133] Created 7 nets and 30 connections.
worst slack -1.95
[INFO RSZ-0094] Found 6 endpoints with setup violations.
[INFO RSZ-0099] Repairing 6 out of 6 (100.00%) violating endpoints...
[INFO RSZ-0059] Removed 4 buffers.
[INFO RSZ-0040] Inserted 2 buffers.
[INFO RSZ-0041] Resized 3 instances.
Expand Down

0 comments on commit d48987e

Please sign in to comment.