Skip to content

Commit

Permalink
rsz: Add multi-repair tests
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Bieganski <[email protected]>
  • Loading branch information
kbieganski committed Jan 8, 2025
1 parent 8cc138c commit ad42b1e
Show file tree
Hide file tree
Showing 30 changed files with 1,055 additions and 13 deletions.
9 changes: 9 additions & 0 deletions src/rsz/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ or_integration_tests(
set_dont_touch1
set_dont_use1
split_load_hier
repair_fanout6_multi
repair_fanout7_multi
repair_fanout8_multi
repair_setup1_multi
repair_setup2_multi
repair_setup3_multi
repair_setup4_multi
repair_setup6_multi
repair_setup7_multi
PASSFAIL_TESTS
cpp_tests
)
Expand Down
3 changes: 2 additions & 1 deletion src/rsz/test/repair_fanout6.tcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# fanout 8000 max_fanout 20 stress test
# modified to use large default max_transition, max_capacitance
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
read_liberty repair_fanout6.lib
read_lef sky130hd/sky130hd.tlef
read_lef sky130hd/sky130hd_std_cell.lef
Expand All @@ -27,5 +28,5 @@ report_check_types -max_fanout
# but there is no point in inserting extra buffers to fix non critical
# paths. What matters is repair_timning's ability to optimize the timing
# when it matters.
repair_timing -setup -repair_tns 0 -skip_gate_cloning
repair_timing -setup -repair_tns 0 -skip_gate_cloning {*}$repair_args
report_worst_slack -max
22 changes: 22 additions & 0 deletions src/rsz/test/repair_fanout6_multi.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[INFO ODB-0227] LEF file: sky130hd/sky130hd.tlef, created 13 layers, 25 vias
[INFO ODB-0227] LEF file: sky130hd/sky130hd_std_cell.lef, created 437 library cells
[INFO ODB-0128] Design: test
[INFO ODB-0130] Created 8002 pins.
[INFO ODB-0131] Created 8001 components and 40005 component-terminals.
[INFO ODB-0133] Created 8003 nets and 24003 connections.
[INFO RSZ-0035] Found 1 fanout violations.
[INFO RSZ-0038] Inserted 508 buffers in 1 nets.
[INFO RSZ-0039] Resized 509 instances.
worst slack -8.67
max fanout

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 14 buffers, 1 to split loads.
[INFO RSZ-0041] Resized 175 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
worst slack -3.09
2 changes: 2 additions & 0 deletions src/rsz/test/repair_fanout6_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set repair_args [list -max_repairs_per_iter 10]
source "repair_fanout6.tcl"
7 changes: 5 additions & 2 deletions src/rsz/test/repair_fanout7.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
source "helpers.tcl"
source "hi_fanout.tcl"

set def_filename [make_result_file "repair_fanout7.def"]
if {[expr {![info exists def_filename]}]} {
set def_filename [make_result_file "repair_fanout7.def"]
}
if {[expr {![info exists repair_args]}]} { set repair_args {} }
# Gates we want to eventually NAND2_X4, NAND3_X4, NAND4_X4

write_clone_test_def $def_filename NAND2_X4 150
Expand Down Expand Up @@ -33,6 +36,6 @@ estimate_parasitics -placement
# Repair the high fanout net hopefully with gate cloning code.
report_worst_slack -max
write_verilog_for_eqy repair_fanout7 before "None"
repair_timing -setup -repair_tns 100 -verbose
repair_timing -setup -repair_tns 100 -verbose {*}$repair_args
run_equivalence_test repair_fanout7 ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max
437 changes: 437 additions & 0 deletions src/rsz/test/repair_fanout7_multi.ok

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/rsz/test/repair_fanout7_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "helpers.tcl"
set def_filename [make_result_file "repair_fanout7_multi.def"]
set repair_args [list -max_repairs_per_iter 10]
source "repair_fanout7.tcl"
7 changes: 5 additions & 2 deletions src/rsz/test/repair_fanout8.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
source "helpers.tcl"
source "hi_fanout.tcl"

set def_filename [make_result_file "repair_fanout8.def"]
if {[expr {![info exists def_filename]}]} {
set def_filename [make_result_file "repair_fanout8.def"]
}
if {[expr {![info exists repair_args]}]} { set repair_args {} }
# Gates we want to eventually NAND2_X4, NAND3_X4, NAND4_X4

write_clone_test_def $def_filename NAND2_X4 150
Expand Down Expand Up @@ -32,7 +35,7 @@ estimate_parasitics -placement

report_worst_slack -max
write_verilog_for_eqy repair_fanout8 before "None"
repair_timing -setup -repair_tns 100 -skip_gate_cloning -verbose
repair_timing -setup -repair_tns 100 -skip_gate_cloning -verbose {*}$repair_args
run_equivalence_test repair_fanout8 ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max

360 changes: 360 additions & 0 deletions src/rsz/test/repair_fanout8_multi.ok

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/rsz/test/repair_fanout8_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "helpers.tcl"
set def_filename [make_result_file "repair_fanout8_multi.def"]
set repair_args [list -max_repairs_per_iter 10]
source "repair_fanout8.tcl"
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup1.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# repair_timing -setup r1/Q 5 loads
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
read_liberty Nangate45/Nangate45_typ.lib
read_lef Nangate45/Nangate45.lef
read_def repair_setup1.def
Expand All @@ -11,6 +12,6 @@ estimate_parasitics -placement
report_checks -fields input -digits 3

write_verilog_for_eqy repair_setup1 before "None"
repair_timing -setup
repair_timing -setup {*}$repair_args
run_equivalence_test repair_setup1 ./Nangate45/work_around_yosys/ "None"
report_checks -fields input -digits 3
75 changes: 75 additions & 0 deletions src/rsz/test/repair_setup1_multi.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0128] Design: reg1
[INFO ODB-0130] Created 1 pins.
[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.
Startpoint: r1 (rising edge-triggered flip-flop clocked by clk)
Endpoint: r2 (rising edge-triggered flip-flop clocked by clk)
Path Group: clk
Path Type: max

Delay Time Description
-----------------------------------------------------------
0.000 0.000 clock clk (rise edge)
0.000 0.000 clock network delay (ideal)
0.000 0.000 ^ r1/CK (DFF_X1)
0.206 0.206 ^ r1/Q (DFF_X1)
0.029 0.235 ^ u1/A (BUF_X1)
0.052 0.287 ^ u1/Z (BUF_X1)
0.002 0.289 ^ u2/A (BUF_X1)
0.042 0.331 ^ u2/Z (BUF_X1)
0.002 0.333 ^ u3/A (BUF_X1)
0.042 0.375 ^ u3/Z (BUF_X1)
0.002 0.377 ^ u4/A (BUF_X1)
0.042 0.419 ^ u4/Z (BUF_X1)
0.002 0.420 ^ u5/A (BUF_X1)
0.116 0.536 ^ u5/Z (BUF_X1)
0.049 0.585 ^ r2/D (DFF_X1)
0.585 data arrival time

0.300 0.300 clock clk (rise edge)
0.000 0.300 clock network delay (ideal)
0.000 0.300 clock reconvergence pessimism
0.300 ^ r2/CK (DFF_X1)
-0.048 0.252 library setup time
0.252 data required time
-----------------------------------------------------------
0.252 data required time
-0.585 data arrival time
-----------------------------------------------------------
-0.333 slack (VIOLATED)


[INFO RSZ-0094] Found 4 endpoints with setup violations.
[INFO RSZ-0099] Repairing 4 out of 4 (100.00%) violating endpoints...
[INFO RSZ-0059] Removed 5 buffers.
[INFO RSZ-0041] Resized 1 instances.
Repair timing output passed/skipped equivalence test
Startpoint: r1 (rising edge-triggered flip-flop clocked by clk)
Endpoint: r7 (rising edge-triggered flip-flop clocked by clk)
Path Group: clk
Path Type: max

Delay Time Description
-----------------------------------------------------------
0.000 0.000 clock clk (rise edge)
0.000 0.000 clock network delay (ideal)
0.000 0.000 ^ r1/CK (DFF_X2)
0.158 0.158 ^ r1/Q (DFF_X2)
0.083 0.241 ^ r7/D (DFF_X1)
0.241 data arrival time

0.300 0.300 clock clk (rise edge)
0.000 0.300 clock network delay (ideal)
0.000 0.300 clock reconvergence pessimism
0.300 ^ r7/CK (DFF_X1)
-0.049 0.251 library setup time
0.251 data required time
-----------------------------------------------------------
0.251 data required time
-0.241 data arrival time
-----------------------------------------------------------
0.010 slack (MET)


3 changes: 3 additions & 0 deletions src/rsz/test/repair_setup1_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "helpers.tcl"
set repair_args [list -max_repairs_per_iter 10]
source "repair_setup1.tcl"
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup2.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# repair_timing -setup combinational path
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
read_liberty Nangate45/Nangate45_typ.lib
read_lef Nangate45/Nangate45.lef
read_def repair_setup2.def
Expand All @@ -13,6 +14,6 @@ estimate_parasitics -placement
report_worst_slack
write_verilog_for_eqy repair_setup2 before "None"
repair_design
repair_timing -setup -verbose
repair_timing -setup -verbose {*}$repair_args
run_equivalence_test repair_setup2 ./Nangate45/work_around_yosys/ "None"
report_worst_slack
24 changes: 24 additions & 0 deletions src/rsz/test/repair_setup2_multi.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0128] Design: td1
[INFO ODB-0130] Created 6 pins.
[INFO ODB-0131] Created 3 components and 15 component-terminals.
[INFO ODB-0132] Created 2 special nets and 0 connections.
[INFO ODB-0133] Created 7 nets and 9 connections.
worst slack -0.28
[INFO RSZ-0058] Using max wire length 693um.
[INFO RSZ-0037] Found 3 long wires.
[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...
Iter | Removed | Resized | Inserted | Cloned | Pin | WNS | TNS | Viol | Worst
| Buffers | Gates | Buffers | Gates | Swaps | | | Endpts | Endpt
---------------------------------------------------------------------------------------------------
0 | 0 | 0 | 0 | 0 | 0 | -0.117 | -0.2 | 2 | y2
3 | 0 | 0 | 0 | 0 | 0 | -0.117 | -0.2 | 2 | y2
6 | 0 | 0 | 0 | 0 | 0 | -0.117 | -0.2 | 2 | y2
final | 0 | 0 | 0 | 0 | 0 | -0.117 | -0.2 | 2 | y2
---------------------------------------------------------------------------------------------------
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
worst slack -0.12
2 changes: 2 additions & 0 deletions src/rsz/test/repair_setup2_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set repair_args [list -max_repairs_per_iter 10]
source "repair_setup2.tcl"
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup3.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# repair_timing -setup thru latch
source helpers.tcl
if {[expr {![info exists repair_args]}]} { set repair_args {} }
read_liberty sky130hd/sky130hd_tt.lib
read_lef sky130hd/sky130hd.tlef
read_lef sky130hd/sky130hd_std_cell.lef
Expand All @@ -14,5 +15,5 @@ estimate_parasitics -placement
set_load 1.0 l2q

write_verilog_for_eqy repair_setup3 before "None"
repair_timing -setup -verbose
repair_timing -setup -verbose {*}$repair_args
run_equivalence_test repair_setup3 ./sky130hd/work_around_yosys/ "None"
22 changes: 22 additions & 0 deletions src/rsz/test/repair_setup3_multi.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[INFO ODB-0227] LEF file: sky130hd/sky130hd.tlef, created 13 layers, 25 vias
[INFO ODB-0227] LEF file: sky130hd/sky130hd_std_cell.lef, created 437 library cells
[INFO ODB-0128] Design: reg1
[INFO ODB-0130] Created 1 pins.
[INFO ODB-0131] Created 6 components and 29 component-terminals.
[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...
Iter | Removed | Resized | Inserted | Cloned | Pin | WNS | TNS | Viol | Worst
| Buffers | Gates | Buffers | Gates | Swaps | | | Endpts | Endpt
---------------------------------------------------------------------------------------------------
0 | 0 | 0 | 0 | 0 | 0 | -6.365 | -6.4 | 2 | r3/D
3 | 0 | 2 | 0 | 0 | 0 | -1.790 | -1.9 | 2 | r3/D
5 | 0 | 2 | 0 | 0 | 0 | -1.790 | -1.9 | 2 | r3/D
6* | 0 | 2 | 0 | 0 | 0 | -1.790 | -1.9 | 2 | r3/D
7* | 0 | 2 | 0 | 0 | 0 | -1.790 | -1.9 | 2 | r3/D
final | 0 | 2 | 0 | 0 | 0 | -1.790 | -1.9 | 2 | r3/D
---------------------------------------------------------------------------------------------------
[INFO RSZ-0041] Resized 2 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
2 changes: 2 additions & 0 deletions src/rsz/test/repair_setup3_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set repair_args [list -max_repairs_per_iter 10]
source "repair_setup3.tcl"
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup4.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# repair_timing -setup 2 corners
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
define_corners fast slow
read_liberty -corner slow Nangate45/Nangate45_slow.lib
read_liberty -corner fast Nangate45/Nangate45_fast.lib
Expand All @@ -14,7 +15,7 @@ estimate_parasitics -placement
report_worst_slack -max
report_tns -digits 3
write_verilog_for_eqy repair_setup4 before "None"
repair_timing -setup
repair_timing -setup {*}$repair_args
run_equivalence_test repair_setup4 ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max
report_tns -digits 3
Expand Down
16 changes: 16 additions & 0 deletions src/rsz/test/repair_setup4_multi.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0128] Design: reg1
[INFO ODB-0130] Created 1 pins.
[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
tns -6.294
[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-0041] Resized 2 instances.
[WARNING RSZ-0062] Unable to repair all setup violations.
Repair timing output passed/skipped equivalence test
worst slack -0.67
tns -3.475
2 changes: 2 additions & 0 deletions src/rsz/test/repair_setup4_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set repair_args [list -max_repairs_per_iter 10]
source "repair_setup4.tcl"
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup5.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# buffer chain with set_max_delay
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
read_liberty sky130hd/sky130hd_tt.lib
read_lef sky130hd/sky130hd.tlef
read_lef sky130hd/sky130hd_std_cell.lef
Expand All @@ -14,6 +15,6 @@ report_worst_slack -max

# Get information so we can setup the test outputs correctly
write_verilog_for_eqy repair_setup5 before "None"
repair_timing -setup -repair_tns 100
repair_timing -setup -repair_tns 100 {*}$repair_args
run_equivalence_test repair_setup5 ./sky130hd/work_around_yosys/ "None"
report_worst_slack -max
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup6.tcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# repair_timing -setup with global route parasitics
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
read_liberty Nangate45/Nangate45_typ.lib
read_lef Nangate45/Nangate45.lef
read_def repair_setup1.def
Expand All @@ -26,7 +27,7 @@ estimate_parasitics -global_routing

report_worst_slack -max
write_verilog_for_eqy repair_setup6 before "None"
repair_timing -setup
repair_timing -setup {*}$repair_args
run_equivalence_test repair_setup6 ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max

Expand Down
24 changes: 24 additions & 0 deletions src/rsz/test/repair_setup6_multi.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0128] Design: reg1
[INFO ODB-0130] Created 1 pins.
[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.
[INFO IFP-0001] Added 857 rows of 210 site FreePDK45_38x28_10R_NP_162NW_34O.
Placement Analysis
---------------------------------
total displacement 6.8 u
average displacement 0.4 u
max displacement 0.7 u
original HPWL 2531.1 u
legalized HPWL 2533.0 u
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-0059] Removed 4 buffers.
[INFO RSZ-0041] Resized 2 instances.
Repair timing output passed/skipped equivalence test
worst slack 0.09
worst slack 0.01
2 changes: 2 additions & 0 deletions src/rsz/test/repair_setup6_multi.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
set repair_args [list -max_repairs_per_iter 10]
source "repair_setup6.tcl"
3 changes: 2 additions & 1 deletion src/rsz/test/repair_setup7.tcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Test for -skip_buffer_removal
# repair_timing -setup 2 corners
source "helpers.tcl"
if {[expr {![info exists repair_args]}]} { set repair_args {} }
define_corners fast slow
read_liberty -corner slow Nangate45/Nangate45_slow.lib
read_liberty -corner fast Nangate45/Nangate45_fast.lib
Expand All @@ -14,6 +15,6 @@ estimate_parasitics -placement

report_worst_slack -max
write_verilog_for_eqy repair_setup4 before "None"
repair_timing -setup -skip_buffer_removal
repair_timing -setup -skip_buffer_removal {*}$repair_args
run_equivalence_test repair_setup4 ./Nangate45/work_around_yosys/ "None"
report_worst_slack -max
Loading

0 comments on commit ad42b1e

Please sign in to comment.