Skip to content

Commit 7ac212c

Browse files
committed
rsz: switch repair_design_outside_core test to read_def flow
Replace the initialize_floorplan + manual setLocation loop with a read_def -floorplan_initialize call, per Matt's review guidance that test cases should not invoke high-level commands (initialize_floorplan, placement, routing) when those steps are unrelated to the buggy point. Also reduce the load count from 10 to 6 (just over the max_fanout 5 threshold), keeping coverage of both the fanout buffer and wire repeater clamp paths while shrinking the script from ~95 to ~21 lines. The verification loop is removed in favor of relying on the .ok snapshot diff to detect regressions in clamp behavior. Signed-off-by: minjukim55 <mkim@precisioninno.com>
1 parent 9706a65 commit 7ac212c

4 files changed

Lines changed: 113 additions & 103 deletions

File tree

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
VERSION 5.8 ;
2+
DIVIDERCHAR "/" ;
3+
BUSBITCHARS "[]" ;
4+
DESIGN outside_core ;
5+
UNITS DISTANCE MICRONS 2000 ;
6+
DIEAREA ( 0 0 ) ( 400000 400000 ) ;
7+
ROW ROW_0 FreePDK45_38x28_10R_NP_162NW_34O 20140 22400 N DO 420 BY 1 STEP 380 0 ;
8+
ROW ROW_1 FreePDK45_38x28_10R_NP_162NW_34O 20140 25200 FS DO 420 BY 1 STEP 380 0 ;
9+
ROW ROW_2 FreePDK45_38x28_10R_NP_162NW_34O 20140 28000 N DO 420 BY 1 STEP 380 0 ;
10+
ROW ROW_3 FreePDK45_38x28_10R_NP_162NW_34O 20140 30800 FS DO 420 BY 1 STEP 380 0 ;
11+
ROW ROW_4 FreePDK45_38x28_10R_NP_162NW_34O 20140 33600 N DO 420 BY 1 STEP 380 0 ;
12+
ROW ROW_5 FreePDK45_38x28_10R_NP_162NW_34O 20140 36400 FS DO 420 BY 1 STEP 380 0 ;
13+
ROW ROW_6 FreePDK45_38x28_10R_NP_162NW_34O 20140 39200 N DO 420 BY 1 STEP 380 0 ;
14+
ROW ROW_7 FreePDK45_38x28_10R_NP_162NW_34O 20140 42000 FS DO 420 BY 1 STEP 380 0 ;
15+
ROW ROW_8 FreePDK45_38x28_10R_NP_162NW_34O 20140 44800 N DO 420 BY 1 STEP 380 0 ;
16+
ROW ROW_9 FreePDK45_38x28_10R_NP_162NW_34O 20140 47600 FS DO 420 BY 1 STEP 380 0 ;
17+
ROW ROW_10 FreePDK45_38x28_10R_NP_162NW_34O 20140 50400 N DO 420 BY 1 STEP 380 0 ;
18+
ROW ROW_11 FreePDK45_38x28_10R_NP_162NW_34O 20140 53200 FS DO 420 BY 1 STEP 380 0 ;
19+
ROW ROW_12 FreePDK45_38x28_10R_NP_162NW_34O 20140 56000 N DO 420 BY 1 STEP 380 0 ;
20+
ROW ROW_13 FreePDK45_38x28_10R_NP_162NW_34O 20140 58800 FS DO 420 BY 1 STEP 380 0 ;
21+
ROW ROW_14 FreePDK45_38x28_10R_NP_162NW_34O 20140 61600 N DO 420 BY 1 STEP 380 0 ;
22+
ROW ROW_15 FreePDK45_38x28_10R_NP_162NW_34O 20140 64400 FS DO 420 BY 1 STEP 380 0 ;
23+
ROW ROW_16 FreePDK45_38x28_10R_NP_162NW_34O 20140 67200 N DO 420 BY 1 STEP 380 0 ;
24+
ROW ROW_17 FreePDK45_38x28_10R_NP_162NW_34O 20140 70000 FS DO 420 BY 1 STEP 380 0 ;
25+
ROW ROW_18 FreePDK45_38x28_10R_NP_162NW_34O 20140 72800 N DO 420 BY 1 STEP 380 0 ;
26+
ROW ROW_19 FreePDK45_38x28_10R_NP_162NW_34O 20140 75600 FS DO 420 BY 1 STEP 380 0 ;
27+
ROW ROW_20 FreePDK45_38x28_10R_NP_162NW_34O 20140 78400 N DO 420 BY 1 STEP 380 0 ;
28+
ROW ROW_21 FreePDK45_38x28_10R_NP_162NW_34O 20140 81200 FS DO 420 BY 1 STEP 380 0 ;
29+
ROW ROW_22 FreePDK45_38x28_10R_NP_162NW_34O 20140 84000 N DO 420 BY 1 STEP 380 0 ;
30+
ROW ROW_23 FreePDK45_38x28_10R_NP_162NW_34O 20140 86800 FS DO 420 BY 1 STEP 380 0 ;
31+
ROW ROW_24 FreePDK45_38x28_10R_NP_162NW_34O 20140 89600 N DO 420 BY 1 STEP 380 0 ;
32+
ROW ROW_25 FreePDK45_38x28_10R_NP_162NW_34O 20140 92400 FS DO 420 BY 1 STEP 380 0 ;
33+
ROW ROW_26 FreePDK45_38x28_10R_NP_162NW_34O 20140 95200 N DO 420 BY 1 STEP 380 0 ;
34+
ROW ROW_27 FreePDK45_38x28_10R_NP_162NW_34O 20140 98000 FS DO 420 BY 1 STEP 380 0 ;
35+
ROW ROW_28 FreePDK45_38x28_10R_NP_162NW_34O 20140 100800 N DO 420 BY 1 STEP 380 0 ;
36+
ROW ROW_29 FreePDK45_38x28_10R_NP_162NW_34O 20140 103600 FS DO 420 BY 1 STEP 380 0 ;
37+
ROW ROW_30 FreePDK45_38x28_10R_NP_162NW_34O 20140 106400 N DO 420 BY 1 STEP 380 0 ;
38+
ROW ROW_31 FreePDK45_38x28_10R_NP_162NW_34O 20140 109200 FS DO 420 BY 1 STEP 380 0 ;
39+
ROW ROW_32 FreePDK45_38x28_10R_NP_162NW_34O 20140 112000 N DO 420 BY 1 STEP 380 0 ;
40+
ROW ROW_33 FreePDK45_38x28_10R_NP_162NW_34O 20140 114800 FS DO 420 BY 1 STEP 380 0 ;
41+
ROW ROW_34 FreePDK45_38x28_10R_NP_162NW_34O 20140 117600 N DO 420 BY 1 STEP 380 0 ;
42+
ROW ROW_35 FreePDK45_38x28_10R_NP_162NW_34O 20140 120400 FS DO 420 BY 1 STEP 380 0 ;
43+
ROW ROW_36 FreePDK45_38x28_10R_NP_162NW_34O 20140 123200 N DO 420 BY 1 STEP 380 0 ;
44+
ROW ROW_37 FreePDK45_38x28_10R_NP_162NW_34O 20140 126000 FS DO 420 BY 1 STEP 380 0 ;
45+
ROW ROW_38 FreePDK45_38x28_10R_NP_162NW_34O 20140 128800 N DO 420 BY 1 STEP 380 0 ;
46+
ROW ROW_39 FreePDK45_38x28_10R_NP_162NW_34O 20140 131600 FS DO 420 BY 1 STEP 380 0 ;
47+
ROW ROW_40 FreePDK45_38x28_10R_NP_162NW_34O 20140 134400 N DO 420 BY 1 STEP 380 0 ;
48+
ROW ROW_41 FreePDK45_38x28_10R_NP_162NW_34O 20140 137200 FS DO 420 BY 1 STEP 380 0 ;
49+
ROW ROW_42 FreePDK45_38x28_10R_NP_162NW_34O 20140 140000 N DO 420 BY 1 STEP 380 0 ;
50+
ROW ROW_43 FreePDK45_38x28_10R_NP_162NW_34O 20140 142800 FS DO 420 BY 1 STEP 380 0 ;
51+
ROW ROW_44 FreePDK45_38x28_10R_NP_162NW_34O 20140 145600 N DO 420 BY 1 STEP 380 0 ;
52+
ROW ROW_45 FreePDK45_38x28_10R_NP_162NW_34O 20140 148400 FS DO 420 BY 1 STEP 380 0 ;
53+
ROW ROW_46 FreePDK45_38x28_10R_NP_162NW_34O 20140 151200 N DO 420 BY 1 STEP 380 0 ;
54+
ROW ROW_47 FreePDK45_38x28_10R_NP_162NW_34O 20140 154000 FS DO 420 BY 1 STEP 380 0 ;
55+
ROW ROW_48 FreePDK45_38x28_10R_NP_162NW_34O 20140 156800 N DO 420 BY 1 STEP 380 0 ;
56+
ROW ROW_49 FreePDK45_38x28_10R_NP_162NW_34O 20140 159600 FS DO 420 BY 1 STEP 380 0 ;
57+
ROW ROW_50 FreePDK45_38x28_10R_NP_162NW_34O 20140 162400 N DO 420 BY 1 STEP 380 0 ;
58+
ROW ROW_51 FreePDK45_38x28_10R_NP_162NW_34O 20140 165200 FS DO 420 BY 1 STEP 380 0 ;
59+
ROW ROW_52 FreePDK45_38x28_10R_NP_162NW_34O 20140 168000 N DO 420 BY 1 STEP 380 0 ;
60+
ROW ROW_53 FreePDK45_38x28_10R_NP_162NW_34O 20140 170800 FS DO 420 BY 1 STEP 380 0 ;
61+
ROW ROW_54 FreePDK45_38x28_10R_NP_162NW_34O 20140 173600 N DO 420 BY 1 STEP 380 0 ;
62+
ROW ROW_55 FreePDK45_38x28_10R_NP_162NW_34O 20140 176400 FS DO 420 BY 1 STEP 380 0 ;
63+
COMPONENTS 7 ;
64+
- drvr DFF_X1 + PLACED ( 50000 50000 ) N ;
65+
- load0 DFF_X1 + PLACED ( 0 0 ) N ;
66+
- load1 DFF_X1 + PLACED ( 195000 0 ) N ;
67+
- load2 DFF_X1 + PLACED ( 0 195000 ) N ;
68+
- load3 DFF_X1 + PLACED ( 195000 195000 ) N ;
69+
- load4 DFF_X1 + PLACED ( 100000 0 ) N ;
70+
- load5 DFF_X1 + PLACED ( 0 100000 ) N ;
71+
END COMPONENTS
72+
PINS 8 ;
73+
- clk + NET clk + DIRECTION INPUT + USE SIGNAL ;
74+
- in1 + NET in1 + DIRECTION INPUT + USE SIGNAL ;
75+
- out0 + NET out0 + DIRECTION OUTPUT + USE SIGNAL ;
76+
- out1 + NET out1 + DIRECTION OUTPUT + USE SIGNAL ;
77+
- out2 + NET out2 + DIRECTION OUTPUT + USE SIGNAL ;
78+
- out3 + NET out3 + DIRECTION OUTPUT + USE SIGNAL ;
79+
- out4 + NET out4 + DIRECTION OUTPUT + USE SIGNAL ;
80+
- out5 + NET out5 + DIRECTION OUTPUT + USE SIGNAL ;
81+
END PINS
82+
NETS 9 ;
83+
- clk ( PIN clk ) ( load5 CK ) ( load4 CK ) ( load3 CK ) ( load2 CK ) ( load1 CK ) ( load0 CK )
84+
( drvr CK ) + USE SIGNAL ;
85+
- in1 ( PIN in1 ) ( drvr D ) + USE SIGNAL ;
86+
- net0 ( load5 D ) ( load4 D ) ( load3 D ) ( load2 D ) ( load1 D ) ( load0 D ) ( drvr Q ) + USE SIGNAL ;
87+
- out0 ( PIN out0 ) ( load0 Q ) + USE SIGNAL ;
88+
- out1 ( PIN out1 ) ( load1 Q ) + USE SIGNAL ;
89+
- out2 ( PIN out2 ) ( load2 Q ) + USE SIGNAL ;
90+
- out3 ( PIN out3 ) ( load3 Q ) + USE SIGNAL ;
91+
- out4 ( PIN out4 ) ( load4 Q ) + USE SIGNAL ;
92+
- out5 ( PIN out5 ) ( load5 Q ) + USE SIGNAL ;
93+
END NETS
94+
END DESIGN
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2-
[WARNING IFP-0028] Core area lower left (10.000, 10.000) snapped to (10.070, 11.200).
3-
[INFO IFP-0001] Added 56 rows of 420 site FreePDK45_38x28_10R_NP_162NW_34O.
4-
[INFO IFP-0100] Die BBox: ( 0.000 0.000 ) ( 200.000 200.000 ) um
5-
[INFO IFP-0101] Core BBox: ( 10.070 11.200 ) ( 89.870 89.600 ) um
6-
[INFO IFP-0102] Core area: 6256.320 um^2
7-
[INFO IFP-0103] Total instances area: 49.742 um^2
8-
[INFO IFP-0104] Effective utilization: 0.008
9-
[INFO IFP-0105] Number of instances: 11
2+
[INFO ODB-0128] Design: outside_core
3+
[INFO ODB-0252] Updated 8 pins.
4+
[INFO ODB-0253] Updated 7 components.
5+
[INFO ODB-0254] Updated 9 nets and 21 connections.
106
[WARNING RSZ-0065] max wire length less than 693u increases wire delays.
117
Iteration | Area | Resized | Buffers | Nets repaired | Remaining
128
---------------------------------------------------------------------
13-
0 | +0.0% | 0 | 0 | 0 | 24
14-
[DEBUG RSZ-buffer_clamp] fanout1 clamped to core (51780, 1230) -> (51780, 22400)
15-
[DEBUG RSZ-buffer_clamp] fanout2 clamped to core (1780, 101230) -> (20140, 101230)
16-
[DEBUG RSZ-buffer_clamp] wire3 clamped to core (1780, 191480) -> (20140, 176400)
17-
final | +7.5% | 0 | 4 | 1 | 0
9+
0 | +0.0% | 0 | 0 | 0 | 16
10+
[DEBUG RSZ-buffer_clamp] fanout1 clamped to core (101780, 1230) -> (101780, 22400)
11+
[DEBUG RSZ-buffer_clamp] wire2 clamped to core (101780, 1230) -> (101780, 22400)
12+
[DEBUG RSZ-buffer_clamp] wire3 clamped to core (192030, 1230) -> (178220, 22400)
13+
final | +9.2% | 0 | 3 | 1 | 0
1814
---------------------------------------------------------------------
1915
[INFO RSZ-0035] Found 1 fanout violations.
20-
[INFO RSZ-0038] Inserted 4 buffers in 1 nets.
21-
PASS: all inserted buffers are within core area.
16+
[INFO RSZ-0038] Inserted 3 buffers in 1 nets.
Lines changed: 5 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,21 @@
1-
# Test that buffers inserted by repair_design are clamped inside the core area.
2-
# A tight core with loads manually placed outside triggers wire repeaters
3-
# at Steiner points beyond the core boundary.
1+
# Buffers inserted by repair_design must be clamped inside the core area.
2+
# Tight core (10-90 um within a 200x200 die) plus loads at die corners forces
3+
# Steiner points outside the core, exercising clampLocToCore on both fanout
4+
# and wire repeater paths. .ok captures the per-buffer clamp debug log.
45
source "helpers.tcl"
56
source Nangate45/Nangate45.vars
67

78
read_liberty Nangate45/Nangate45_typ.lib
89
read_lef Nangate45/Nangate45.lef
910
read_verilog repair_design_outside_core.v
1011
link_design outside_core
11-
12-
# Tight core: (10, 10) to (90, 90) microns within a 200x200 die.
13-
initialize_floorplan -site $site \
14-
-die_area {0 0 200 200} \
15-
-core_area {10 10 90 90}
16-
17-
# Place driver inside core, loads far outside core to create long wires
18-
# whose Steiner points land outside core.
19-
set block [ord::get_db_block]
20-
foreach inst [$block getInsts] {
21-
set name [$inst getName]
22-
if { $name eq "drvr" } {
23-
$inst setLocation 50000 50000
24-
$inst setPlacementStatus PLACED
25-
} elseif { $name eq "load0" } {
26-
$inst setLocation 0 0
27-
$inst setPlacementStatus PLACED
28-
} elseif { $name eq "load1" } {
29-
$inst setLocation 195000 0
30-
$inst setPlacementStatus PLACED
31-
} elseif { $name eq "load2" } {
32-
$inst setLocation 0 195000
33-
$inst setPlacementStatus PLACED
34-
} elseif { $name eq "load3" } {
35-
$inst setLocation 195000 195000
36-
$inst setPlacementStatus PLACED
37-
} elseif { $name eq "load4" } {
38-
$inst setLocation 100000 0
39-
$inst setPlacementStatus PLACED
40-
} elseif { $name eq "load5" } {
41-
$inst setLocation 0 100000
42-
$inst setPlacementStatus PLACED
43-
} elseif { $name eq "load6" } {
44-
$inst setLocation 195000 100000
45-
$inst setPlacementStatus PLACED
46-
} elseif { $name eq "load7" } {
47-
$inst setLocation 100000 195000
48-
$inst setPlacementStatus PLACED
49-
} elseif { $name eq "load8" } {
50-
$inst setLocation 150000 0
51-
$inst setPlacementStatus PLACED
52-
} elseif { $name eq "load9" } {
53-
$inst setLocation 50000 0
54-
$inst setPlacementStatus PLACED
55-
}
56-
}
12+
read_def -floorplan_initialize repair_design_outside_core.def
5713

5814
create_clock -period 10 clk
59-
6015
source Nangate45/Nangate45.rc
6116
set_wire_rc -layer metal3
6217
estimate_parasitics -placement
6318

64-
# Enable debug log so we can verify per-buffer clamp messages
6519
set_debug_level RSZ buffer_clamp 1
66-
67-
# Force fanout and wire length violations to trigger buffer insertion
6820
set_max_fanout 5 [current_design]
6921
repair_design -max_wire_length 100
70-
71-
# Verify: all instances must be within core area
72-
set core [ord::get_db_core]
73-
set core_xmin [$core xMin]
74-
set core_ymin [$core yMin]
75-
set core_xmax [$core xMax]
76-
set core_ymax [$core yMax]
77-
78-
set outside_core 0
79-
foreach inst [$block getInsts] {
80-
set bbox [$inst getBBox]
81-
if {
82-
[$bbox xMin] < $core_xmin || [$bbox yMin] < $core_ymin
83-
|| [$bbox xMax] > $core_xmax || [$bbox yMax] > $core_ymax
84-
} {
85-
# Only check newly inserted buffers (source type TIMING), not original loads
86-
if { [$inst getSourceType] eq "TIMING" } {
87-
puts "FAIL: [$inst getName] outside core\
88-
([$bbox xMin] [$bbox yMin]) ([$bbox xMax] [$bbox yMax])"
89-
set outside_core 1
90-
}
91-
}
92-
}
93-
if { !$outside_core } {
94-
puts "PASS: all inserted buffers are within core area."
95-
}
Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Test design for buffer clamping to core area.
2-
// High fanout net with long wires to trigger wire repeater insertion.
3-
module outside_core (clk, in1, out0, out1, out2, out3, out4,
4-
out5, out6, out7, out8, out9);
2+
// 6 loads (just over max_fanout 5) at die corners forces both a fanout
3+
// buffer and a wire repeater whose Steiner points land outside the core.
4+
module outside_core (clk, in1, out0, out1, out2, out3, out4, out5);
55
input clk, in1;
6-
output out0, out1, out2, out3, out4, out5, out6, out7, out8, out9;
6+
output out0, out1, out2, out3, out4, out5;
77

8-
wire d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
98
wire net0;
109

1110
DFF_X1 drvr (.D(in1), .CK(clk), .Q(net0), .QN());
@@ -15,8 +14,4 @@ module outside_core (clk, in1, out0, out1, out2, out3, out4,
1514
DFF_X1 load3 (.D(net0), .CK(clk), .Q(out3), .QN());
1615
DFF_X1 load4 (.D(net0), .CK(clk), .Q(out4), .QN());
1716
DFF_X1 load5 (.D(net0), .CK(clk), .Q(out5), .QN());
18-
DFF_X1 load6 (.D(net0), .CK(clk), .Q(out6), .QN());
19-
DFF_X1 load7 (.D(net0), .CK(clk), .Q(out7), .QN());
20-
DFF_X1 load8 (.D(net0), .CK(clk), .Q(out8), .QN());
21-
DFF_X1 load9 (.D(net0), .CK(clk), .Q(out9), .QN());
2217
endmodule

0 commit comments

Comments
 (0)