Skip to content

Commit dfa004d

Browse files
authored
Merge pull request The-OpenROAD-Project#7247 from The-OpenROAD-Project-staging/odb-def-dup-net
odb: handle a duplicate net in read_def
2 parents 8819055 + dda2707 commit dfa004d

File tree

6 files changed

+33
-0
lines changed

6 files changed

+33
-0
lines changed

src/odb/src/defin/definNet.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ void definNet::begin(const char* name)
7676

7777
if (_cur_net == nullptr) {
7878
_cur_net = dbNet::create(_block, name);
79+
} else if (!_skip_wires) {
80+
dbWire* wire = _cur_net->getWire();
81+
if (wire) {
82+
dbWire::destroy(wire);
83+
}
7984
}
8085

8186
_non_default_rule = nullptr;

src/odb/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ COMPULSORY_TESTS = [
2424
"bterm_hier_create",
2525
"check_routing_tracks",
2626
"create_sboxes",
27+
"def_dup_net",
2728
"def_parser",
2829
"design_is_routed1",
2930
"design_is_routed2",

src/odb/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ or_integration_tests(
55
bterm_hier_create
66
check_routing_tracks
77
create_sboxes
8+
def_dup_net
89
def_parser
910
design_is_routed1
1011
design_is_routed2

src/odb/test/def_dup_net.def

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
VERSION 5.8 ;
2+
DIVIDERCHAR "/" ;
3+
BUSBITCHARS "[]" ;
4+
DESIGN segfault ;
5+
NETS 2 ;
6+
- a
7+
+ ROUTED
8+
metal2
9+
( 0 0 ) ( 0 0 ) ;
10+
- a
11+
+ ROUTED
12+
metal2
13+
( 0 0 ) ( 0 0 ) ;
14+
END NETS
15+
END DESIGN

src/odb/test/def_dup_net.ok

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: segfault
3+
[INFO ODB-0133] Created 2 nets and 0 connections.
4+
pass

src/odb/test/def_dup_net.tcl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source "helpers.tcl"
2+
3+
read_lef "Nangate45/Nangate45.lef"
4+
read_def "def_dup_net.def"
5+
6+
puts "pass"
7+
exit 0

0 commit comments

Comments
 (0)