Skip to content

Commit 8f65df6

Browse files
committed
pdn: add checks for layers existing for connections
Signed-off-by: Peter Gadfort <[email protected]>
1 parent f66c022 commit 8f65df6

File tree

6 files changed

+65
-3
lines changed

6 files changed

+65
-3
lines changed

src/pdn/src/grid.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,16 @@ void Grid::checkSetup() const
702702
}
703703
}
704704

705-
// add bterms
705+
// add bterms and exisiting routing
706706
for (auto* net : nets) {
707+
for (auto* swire : net->getSWires()) {
708+
for (auto* box : swire->getWires()) {
709+
auto* layer = box->getTechLayer();
710+
if (layer) {
711+
check_layers.insert(layer);
712+
}
713+
}
714+
}
707715
for (auto* bterm : net->getBTerms()) {
708716
for (auto* bpin : bterm->getBPins()) {
709717
if (!bpin->getPlacementStatus().isFixed()) {
@@ -731,7 +739,7 @@ void Grid::checkSetup() const
731739
getLogger()->error(utl::PDN,
732740
113,
733741
"Cannot find shapes to connect to on {}",
734-
connect->getLowerLayer()->getName());
742+
connect->getUpperLayer()->getName());
735743
}
736744
}
737745
}

src/pdn/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ COMPULSORY_TESTS = [
2525
"core_grid_auto_domain_multiple_nets",
2626
"core_grid_bad_metal_specs",
2727
"core_grid_check_connect_layers",
28+
"core_grid_check_connect_layers_at_setup",
2829
"core_grid_cut_pitch",
2930
"core_grid_dual_followpins",
3031
"core_grid_dual_followpins_error",

src/pdn/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ or_integration_tests(
2424
core_grid_auto_domain_multiple_nets
2525
core_grid_bad_metal_specs
2626
core_grid_check_connect_layers
27+
core_grid_check_connect_layers_at_setup
2728
core_grid_cut_pitch
2829
core_grid_dual_followpins
2930
core_grid_dual_followpins_error
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0128] Design: gcd
3+
[INFO ODB-0130] Created 54 pins.
4+
[INFO ODB-0131] Created 482 components and 2074 component-terminals.
5+
[INFO ODB-0133] Created 385 nets and 1110 connections.
6+
[ERROR PDN-0111] Pin layer metal6 is not a valid shape in Core
7+
PDN-0111
8+
[ERROR PDN-0113] Cannot find shapes to connect to on metal5
9+
PDN-0113
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# test for rejesting incorrect layers at runtime
2+
source "helpers.tcl"
3+
4+
read_lef Nangate45/Nangate45.lef
5+
read_def nangate_gcd/floorplan.def
6+
7+
add_global_connection -net VDD -pin_pattern VDD -power
8+
add_global_connection -net VSS -pin_pattern VSS -ground
9+
10+
set_voltage_domain -power VDD -ground VSS
11+
12+
define_pdn_grid -name "Core" -pins metal6
13+
add_pdn_stripe -followpins -layer metal1
14+
add_pdn_stripe -followpins -layer metal2
15+
16+
add_pdn_stripe -layer metal4 -width 0.48 -pitch 15.0 -offset 2.0
17+
add_pdn_stripe -layer metal7 -width 1.40 -pitch 20.0 -offset 2.0
18+
19+
add_pdn_connect -layers {metal1 metal2}
20+
add_pdn_connect -layers {metal2 metal4}
21+
add_pdn_connect -layers {metal4 metal7}
22+
23+
# Check pin layer
24+
catch {pdngen} err
25+
puts $err
26+
27+
pdngen -reset
28+
29+
set_voltage_domain -power VDD -ground VSS
30+
31+
define_pdn_grid -name "Core" -pins metal7
32+
add_pdn_stripe -followpins -layer metal1
33+
add_pdn_stripe -followpins -layer metal2
34+
35+
add_pdn_stripe -layer metal4 -width 0.48 -pitch 15.0 -offset 2.0
36+
add_pdn_stripe -layer metal7 -width 1.40 -pitch 20.0 -offset 2.0
37+
38+
add_pdn_connect -layers {metal1 metal2}
39+
add_pdn_connect -layers {metal2 metal5}
40+
add_pdn_connect -layers {metal4 metal7}
41+
42+
# Check connect layer metal5 invalid
43+
catch {pdngen} err
44+
puts $err

src/pdn/test/power_switch.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
pdn_aux.add_pdn_stripe(design, layer="met5", width=1.600, pitch=27.200, offset=13.600)
4545

4646
pdn_aux.add_pdn_connect(design, layers=["met1", "met4"])
47-
pdn_aux.add_pdn_connect(design, layers=["met2", "met4"])
4847
pdn_aux.add_pdn_connect(design, layers=["met4", "met5"])
4948

5049
design.getPdnGen().report()

0 commit comments

Comments
 (0)