Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#5789 from gadfort/pad-rdl-err…
Browse files Browse the repository at this point in the history
…or-checking-ports

pad: add error checking to rdl_route to avoid segfault and allow for ports to be specified
  • Loading branch information
maliberty authored Sep 23, 2024
2 parents 529d237 + 02c5d66 commit e21fbdf
Show file tree
Hide file tree
Showing 7 changed files with 5,086 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/pad/src/pad.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,21 @@ proc rdl_route {args} {
keys {-layer -width -spacing -bump_via -pad_via -turn_penalty} \
flags {-allow45}

sta::parse_port_net_args $args sta_ports sta_nets
set nets []
foreach net [get_nets {*}$args] {
lappend nets [sta::sta_to_db_net $net]
foreach net $sta_nets {
lappend [sta::sta_to_db_net $net]
}
foreach port $sta_ports {
set bterm [sta::sta_to_db_port $port]
set net [$bterm getNet]
if { $net != "NULL" } {
lappend nets $net
}
}

if { [llength $nets] == 0 } {
utl::error PAD 42 "No nets found to route"
}

pad::assert_required rdl_route -layer
Expand Down
9 changes: 9 additions & 0 deletions src/pad/test/rdl_route_invalid.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0227] LEF file: Nangate45_io/dummy_pads.lef, created 25 library cells
[INFO ODB-0128] Design: soc_bsg_black_parrot
[INFO ODB-0130] Created 139 pins.
[INFO ODB-0131] Created 1452 components and 8011 component-terminals.
[INFO ODB-0132] Created 4 special nets and 4706 connections.
[INFO ODB-0133] Created 354 nets and 627 connections.
[ERROR PAD-0042] No nets found to route
PAD-0042
9 changes: 9 additions & 0 deletions src/pad/test/rdl_route_invalid.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Test for RDL router with invalid net list
source "helpers.tcl"
read_lef Nangate45/Nangate45.lef
read_lef Nangate45_io/dummy_pads.lef

read_def Nangate45_blackparrot/floorplan_flipchip.def

catch {rdl_route -layer metal10 -width 4 -spacing 4 ""} err
puts $err
5,031 changes: 5,031 additions & 0 deletions src/pad/test/rdl_route_ports.defok

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/pad/test/rdl_route_ports.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
[INFO ODB-0227] LEF file: Nangate45_io/dummy_pads.lef, created 25 library cells
[INFO ODB-0128] Design: soc_bsg_black_parrot
[INFO ODB-0130] Created 139 pins.
[INFO ODB-0131] Created 1452 components and 8011 component-terminals.
[INFO ODB-0132] Created 4 special nets and 4706 connections.
[INFO ODB-0133] Created 354 nets and 627 connections.
[INFO PAD-0005] Routing 139 nets
No differences found.
12 changes: 12 additions & 0 deletions src/pad/test/rdl_route_ports.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Test for RDL router without 45* using ports instead of nets
source "helpers.tcl"
read_lef Nangate45/Nangate45.lef
read_lef Nangate45_io/dummy_pads.lef

read_def Nangate45_blackparrot/floorplan_flipchip.def

rdl_route -layer metal10 -width 4 -spacing 4 [get_ports "VDD DVDD VSS DVSS p_*"]

set def_file [make_result_file "rdl_route_ports.def"]
write_def $def_file
diff_files $def_file "rdl_route_ports.defok"
2 changes: 2 additions & 0 deletions src/pad/test/regression_tests.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ record_tests {
connect_by_abutment_with_single_pinnet

rdl_route
rdl_route_ports
rdl_route_failed
rdl_route_assignments
rdl_route_45
rdl_route_45_cost
rdl_route_45_separate
rdl_route_via
rdl_route_bump_via
rdl_route_invalid

skywater130_overlapping_filler

Expand Down

0 comments on commit e21fbdf

Please sign in to comment.