Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsz: handle a dont-touch fanout in repair_tie_fanout #6375

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/odb/src/db/dbITerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,17 +543,20 @@ void dbITerm::disconnect()
inst->getLogger()->error(
utl::ODB,
370,
"Attempt to disconnect iterm of dont_touch instance {}",
"Attempt to disconnect term {} of dont_touch instance {}",
getMTerm()->getName(),
inst->_name);
}
_dbBlock* block = (_dbBlock*) iterm->getOwner();
_dbNet* net = block->_net_tbl->getPtr(iterm->_net);

if (net->_flags._dont_touch) {
inst->getLogger()->error(utl::ODB,
372,
"Attempt to disconnect iterm of dont_touch net {}",
net->_name);
inst->getLogger()->error(
utl::ODB,
372,
"Attempt to disconnect iterm {} of dont_touch net {}",
getName(),
net->_name);
}

for (auto callback : block->_callbacks) {
Expand Down
4 changes: 2 additions & 2 deletions src/odb/test/dont_touch.ok
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
[ERROR ODB-0374] Attempt to destroy bterm on dont_touch net inp0
[ERROR ODB-0376] Attempt to create bterm on dont_touch net inp0
[ERROR ODB-0373] Attempt to connect iterm to dont_touch net inp0
[ERROR ODB-0372] Attempt to disconnect iterm of dont_touch net inp0
[ERROR ODB-0372] Attempt to disconnect iterm _g2_/A of dont_touch net inp0
[ERROR ODB-0362] Attempt to destroy dont_touch instance _g2_
[ERROR ODB-0370] Attempt to disconnect iterm of dont_touch instance _g2_
[ERROR ODB-0370] Attempt to disconnect term A of dont_touch instance _g2_
[ERROR ODB-0368] Attempt to change master of dont_touch instance _g2_
pass
13 changes: 10 additions & 3 deletions src/rsz/src/Resizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ bool Resizer::dontTouch(const Instance* inst)
if (!db_inst) {
return false;
}
return db_inst->isDoNotTouch() || db_inst->isPad();
return db_inst->isDoNotTouch();
}

void Resizer::setDontTouch(const Net* net, bool dont_touch)
Expand Down Expand Up @@ -2138,12 +2138,15 @@ void Resizer::repairTieFanout(LibertyPort* tie_port,
if (net && !dontTouch(net)) {
NetConnectedPinIterator* pin_iter
= network_->connectedPinIterator(net);
bool keep_tie = false;
while (pin_iter->hasNext()) {
const Pin* load = pin_iter->next();
if (load != drvr_pin) {
Instance* load_inst = network_->instance(load);
if (dontTouch(load_inst)) {
keep_tie = true;
} else if (load != drvr_pin) {
// Make tie inst.
Point tie_loc = tieLocation(load, separation_dbu);
Instance* load_inst = network_->instance(load);
const char* inst_name = network_->name(load_inst);
string tie_name = makeUniqueInstName(inst_name, true);
Instance* tie
Expand Down Expand Up @@ -2174,6 +2177,10 @@ void Resizer::repairTieFanout(LibertyPort* tie_port,
}
delete pin_iter;

if (keep_tie) {
continue;
}

// Delete inst output net.
Pin* tie_pin = network_->findPin(inst, tie_port);
Net* tie_net = network_->net(tie_pin);
Expand Down
1 change: 1 addition & 0 deletions src/rsz/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ or_integration_tests(
repair_tie6
repair_tie7
repair_tie8
repair_tie9
repair_wire1
repair_wire2
repair_wire3
Expand Down
17 changes: 17 additions & 0 deletions src/rsz/test/repair_tie9.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
VERSION 5.8 ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN top ;
UNITS DISTANCE MICRONS 1000 ;

DIEAREA ( 0 0 ) ( 40000 40000 ) ;

COMPONENTS 6 ;
- t1 sky130_fd_sc_hd__conb_1 ;
- u0 sky130_fd_sc_hd__buf_4 ;
- u1 sky130_fd_sc_hd__buf_4 ;
END COMPONENTS
NETS 1 ;
- n1 ( t1 HI ) ( u0 A ) ( u1 A ) + USE SIGNAL ;
END NETS
END DESIGN
17 changes: 17 additions & 0 deletions src/rsz/test/repair_tie9.defok
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
VERSION 5.8 ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN top ;
UNITS DISTANCE MICRONS 1000 ;
DIEAREA ( 0 0 ) ( 40000 40000 ) ;
COMPONENTS 4 ;
- t1 sky130_fd_sc_hd__conb_1 ;
- u0 sky130_fd_sc_hd__buf_4 ;
- u0_1 sky130_fd_sc_hd__conb_1 + SOURCE TIMING + PLACED ( 280 1195 ) N ;
- u1 sky130_fd_sc_hd__buf_4 ;
END COMPONENTS
NETS 2 ;
- n1 ( t1 HI ) ( u1 A ) + USE SIGNAL ;
- net1 ( u0 A ) ( u0_1 HI ) + USE SIGNAL ;
END NETS
END DESIGN
7 changes: 7 additions & 0 deletions src/rsz/test/repair_tie9.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[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: top
[INFO ODB-0131] Created 3 components and 12 component-terminals.
[INFO ODB-0133] Created 1 nets and 3 connections.
[INFO RSZ-0042] Inserted 1 tie sky130_fd_sc_hd__conb_1 instances.
No differences found.
19 changes: 19 additions & 0 deletions src/rsz/test/repair_tie9.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# repair tie hi/low net with a dont-touch instance
source "helpers.tcl"
source "resizer_helpers.tcl"
read_liberty sky130hd/sky130_fd_sc_hd__tt_025C_1v80.lib
read_lef sky130hd/sky130hd.tlef
read_lef sky130hd/sky130hd_std_cell.lef
read_def repair_tie9.def

set_dont_touch u1

repair_tie_fanout sky130_fd_sc_hd__conb_1/LO
repair_tie_fanout sky130_fd_sc_hd__conb_1/HI
check_ties LOGIC1_X1
report_ties LOGIC1_X1

set def_file [make_result_file repair_tie9.def]
write_def $def_file
diff_files repair_tie9.defok $def_file

Loading