Skip to content

Commit ac3821f

Browse files
committed
repair_tie_fanout on output port
1 parent f385fd8 commit ac3821f

File tree

10 files changed

+106
-36
lines changed

10 files changed

+106
-36
lines changed

src/resizer/src/Resizer.cc

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,37 +1031,39 @@ Point
10311031
Resizer::tieLocation(Pin *load,
10321032
int separation)
10331033
{
1034-
dbInst *db_inst = db_network_->staToDb(network_->instance(load));
1035-
dbBox *bbox = db_inst->getBBox();
10361034
Point load_loc = db_network_->location(load);
10371035
int load_x = load_loc.getX();
10381036
int load_y = load_loc.getY();
1039-
int left_dist = abs(load_x - bbox->xMin());
1040-
int right_dist = abs(load_x - bbox->xMax());
1041-
int bot_dist = abs(load_y - bbox->yMin());
1042-
int top_dist = abs(load_y - bbox->yMax());
10431037
int tie_x = load_x;
10441038
int tie_y = load_y;
1045-
if (left_dist < right_dist
1046-
&& left_dist < bot_dist
1047-
&& left_dist < top_dist)
1048-
// left
1049-
tie_x -= separation;
1050-
if (right_dist < left_dist
1051-
&& right_dist < bot_dist
1052-
&& right_dist < top_dist)
1053-
// right
1054-
tie_x += separation;
1055-
if (bot_dist < left_dist
1056-
&& bot_dist < right_dist
1057-
&& bot_dist < top_dist)
1058-
// bot
1059-
tie_y -= separation;
1060-
if (top_dist < left_dist
1061-
&& top_dist < right_dist
1062-
&& top_dist < bot_dist)
1063-
// top
1064-
tie_y += separation;
1039+
if (!network_->isTopLevelPort(load)) {
1040+
dbInst *db_inst = db_network_->staToDb(network_->instance(load));
1041+
dbBox *bbox = db_inst->getBBox();
1042+
int left_dist = abs(load_x - bbox->xMin());
1043+
int right_dist = abs(load_x - bbox->xMax());
1044+
int bot_dist = abs(load_y - bbox->yMin());
1045+
int top_dist = abs(load_y - bbox->yMax());
1046+
if (left_dist < right_dist
1047+
&& left_dist < bot_dist
1048+
&& left_dist < top_dist)
1049+
// left
1050+
tie_x -= separation;
1051+
if (right_dist < left_dist
1052+
&& right_dist < bot_dist
1053+
&& right_dist < top_dist)
1054+
// right
1055+
tie_x += separation;
1056+
if (bot_dist < left_dist
1057+
&& bot_dist < right_dist
1058+
&& bot_dist < top_dist)
1059+
// bot
1060+
tie_y -= separation;
1061+
if (top_dist < left_dist
1062+
&& top_dist < right_dist
1063+
&& top_dist < bot_dist)
1064+
// top
1065+
tie_y += separation;
1066+
}
10651067
if (core_exists_)
10661068
return closestPtInRect(core_, tie_x, tie_y);
10671069
else

src/resizer/test/regression_tests.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ record_tests {
2727
repair_tie3
2828
repair_tie4
2929
repair_tie5
30+
repair_tie6
3031
repair_wire1
3132
repair_wire2
3233
repair_wire3

src/resizer/test/repair_tie1.def

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
VERSION 5.8 ;
2+
NAMESCASESENSITIVE ON ;
3+
DIVIDERCHAR "/" ;
4+
BUSBITCHARS "[]" ;
5+
DESIGN top ;
6+
UNITS DISTANCE MICRONS 1000 ;
7+
8+
DIEAREA ( 0 0 ) ( 40000 40000 ) ;
9+
10+
COMPONENTS 6 ;
11+
- t1 LOGIC1_X1 ;
12+
- u0 BUF_X1 + PLACED ( 10000 10000 ) N ;
13+
- u1 BUF_X1 + PLACED ( 20000 10000 ) N ;
14+
- u2 BUF_X1 + PLACED ( 10000 20000 ) N ;
15+
- u3 BUF_X1 + PLACED ( 20000 20000 ) N ;
16+
- u4 BUF_X1 + PLACED ( 10000 30000 ) N ;
17+
END COMPONENTS
18+
NETS 1 ;
19+
- n1 ( t1 Z ) ( u0 A )
20+
( u1 A ) ( u2 A ) ( u3 A ) ( u4 A ) + USE SIGNAL ;
21+
END NETS
22+
END DESIGN

src/resizer/test/repair_tie1.ok

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Notice 0: Created 27 technology vias
44
Notice 0: Created 134 library cells
55
Notice 0: Finished LEF file: Nangate45/Nangate45.lef
66
Notice 0:
7-
Reading DEF file: ./results/tie_fanout1.def
7+
Reading DEF file: repair_tie1.def
88
Notice 0: Design: top
99
Notice 0: Created 6 components and 23 component-terminals.
1010
Notice 0: Created 1 nets and 6 connections.
11-
Notice 0: Finished DEF file: ./results/tie_fanout1.def
11+
Notice 0: Finished DEF file: repair_tie1.def
1212
Inserted 5 tie LOGIC1_X1 instances.
1313
t1_1 10.1 10.6
1414
t1_2 20.1 10.6

src/resizer/test/repair_tie1.tcl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# repair high fanout tie hi/low net
1+
# repair tie hi/low net
22
source "helpers.tcl"
33
source "resizer_helpers.tcl"
4-
source "tie_fanout.tcl"
54
read_liberty Nangate45/Nangate45_typ.lib
65
read_lef Nangate45/Nangate45.lef
7-
8-
set def_filename [file join $result_dir "tie_fanout1.def"]
9-
write_tie_hi_fanout_def $def_filename LOGIC1_X1/Z BUF_X1/A 5
10-
read_def $def_filename
6+
read_def repair_tie1.def
117

128
repair_tie_fanout LOGIC1_X1/Z
139
check_ties LOGIC1_X1

src/resizer/test/repair_tie6.def

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
VERSION 5.8 ;
2+
NAMESCASESENSITIVE ON ;
3+
DIVIDERCHAR "/" ;
4+
BUSBITCHARS "[]" ;
5+
DESIGN top ;
6+
UNITS DISTANCE MICRONS 1000 ;
7+
8+
DIEAREA ( 0 0 ) ( 40000 40000 ) ;
9+
10+
COMPONENTS 6 ;
11+
- t1 LOGIC1_X1 + PLACED ( 10000 20000 ) N ;
12+
- u0 BUF_X1 + PLACED ( 10000 10000 ) N ;
13+
END COMPONENTS
14+
15+
PINS 1 ;
16+
- tie1 + NET n1 + DIRECTION OUTPUT + USE SIGNAL + SPECIAL
17+
+ LAYER metal1 ( 100 0 ) ( 100 100 ) + FIXED ( 1000 1000 ) N ;
18+
END PINS
19+
20+
NETS 1 ;
21+
- n1 ( t1 Z ) ( u0 A ) ( PIN tie1 ) + USE SIGNAL ;
22+
END NETS
23+
END DESIGN

src/resizer/test/repair_tie6.ok

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Notice 0: Reading LEF file: Nangate45/Nangate45.lef
2+
Notice 0: Created 22 technology layers
3+
Notice 0: Created 27 technology vias
4+
Notice 0: Created 134 library cells
5+
Notice 0: Finished LEF file: Nangate45/Nangate45.lef
6+
Notice 0:
7+
Reading DEF file: repair_tie6.def
8+
Notice 0: Design: top
9+
Notice 0: Created 1 pins.
10+
Notice 0: Created 2 components and 7 component-terminals.
11+
Notice 0: Created 1 nets and 2 connections.
12+
Notice 0: Finished DEF file: repair_tie6.def
13+
Inserted 2 tie LOGIC1_X1 instances.
14+
t1_1 10.1 10.6
15+
t1_2 1.1 1.1

src/resizer/test/repair_tie6.tcl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# repair_tie_fanout tie hi output port
2+
source "helpers.tcl"
3+
source "resizer_helpers.tcl"
4+
read_liberty Nangate45/Nangate45_typ.lib
5+
read_lef Nangate45/Nangate45.lef
6+
read_def repair_tie6.def
7+
8+
repair_tie_fanout LOGIC1_X1/Z
9+
check_ties LOGIC1_X1
10+
report_ties LOGIC1_X1
11+
check_in_core

src/resizer/test/resizer_helpers.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ proc check_ties { tie_cell_name } {
1515
set tie_pin [get_pins -of $tie_inst -filter "direction == output"]
1616
set net [get_nets -of $tie_inst]
1717
set pins [get_pins -of $net]
18-
if { [llength $pins] != 2 } {
18+
set ports [get_ports -of $net]
19+
if { [expr [llength $pins] + [llength $ports]] != 2 } {
1920
puts "Warning: tie inst [get_full_name $tie_inst] has [llength $pins] connections."
2021
}
2122
}

test/flow.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ set_wire_rc -layer $wire_rc_layer
3434
estimate_parasitics -placement
3535
set_dont_use $dont_use
3636

37-
buffer_ports -buffer_cell $resize_buffer_cell
3837
repair_design -max_wire_length $max_wire_length \
3938
-buffer_cell $resize_buffer_cell
4039
resize

0 commit comments

Comments
 (0)