Skip to content

Commit 5e4e7f0

Browse files
authored
Merge pull request #8446 from gadfort/pdn-check-macros
pdn: add check in macro grid setup
2 parents f061eab + c0beb12 commit 5e4e7f0

File tree

10 files changed

+104
-8
lines changed

10 files changed

+104
-8
lines changed

src/pdn/src/pdn.tcl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,11 @@ proc define_pdn_grid_macro { args } {
10241024
utl::error PDN 1030 "Unable to find instance: $inst_pattern"
10251025
}
10261026
foreach inst $sub_insts {
1027+
if { ![$inst isFixed] } {
1028+
utl::warn PDN 1050 \
1029+
"Ignoring non-fixed instance for grid (${keys(-name)}): [$inst getName]"
1030+
continue
1031+
}
10271032
lappend insts $inst
10281033
}
10291034
}
@@ -1049,9 +1054,16 @@ proc define_pdn_grid_macro { args } {
10491054
} else {
10501055
set cells {}
10511056
foreach cell_pattern $keys(-cells) {
1052-
foreach cell [get_masters $cell_pattern] {
1057+
set sub_cells [get_masters $cell_pattern]
1058+
if { [llength $sub_cells] == 0 } {
1059+
utl::warn PDN 1031 "Unable to find cells: $cell_pattern"
1060+
}
1061+
foreach cell $sub_cells {
10531062
# only add blocks
10541063
if { ![$cell isBlock] } {
1064+
if { !$default_grid } {
1065+
utl::warn PDN 1041 "Ignoring non-block cell for grid (${keys(-name)}): [$cell getName]"
1066+
}
10551067
continue
10561068
}
10571069
lappend cells $cell

src/pdn/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ COMPULSORY_TESTS = [
7979
"macros_cells_overlapping_ports",
8080
"macros_cells_via_failure",
8181
"macros_different_nets",
82+
"macros_grid_check",
8283
"macros_grid_through",
8384
"macros_grid_through_without_middle",
8485
"macros_narrow_channel",

src/pdn/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ or_integration_tests(
7878
macros_cells_overlapping_ports
7979
macros_cells_via_failure
8080
macros_different_nets
81+
macros_grid_check
8182
macros_grid_through
8283
macros_grid_through_without_middle
8384
macros_narrow_channel

src/pdn/test/asap7_failed_macro_covered.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ add_pdn_connect -grid {top} -layers {M2 M5}
1818
add_pdn_connect -grid {top} -layers {M5 M6}
1919

2020
define_pdn_grid -name {CORE_macro_grid_1} -voltage_domains {CORE} -macro \
21-
-orient {R0 R180 MX MY} -cells {.*}
21+
-orient {R0 R180 MX MY} -cells {fake.*}
2222
add_pdn_connect -grid {CORE_macro_grid_1} -layers {M4 M5}
2323

2424
catch { pdngen } err

src/pdn/test/asap7_failed_macro_grid.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ add_pdn_connect -grid {top} -layers {M2 M5}
1818
add_pdn_connect -grid {top} -layers {M5 M6}
1919

2020
define_pdn_grid -name {CORE_macro_grid_1} -voltage_domains {CORE} -macro \
21-
-orient {R0 R180 MX MY} -cells {.*}
21+
-orient {R0 R180 MX MY} -cells {fake.*}
2222
add_pdn_connect -grid {CORE_macro_grid_1} -layers {M4 M5}
2323

2424
catch { pdngen } err

src/pdn/test/asap7_macro_notcovered.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ add_pdn_connect -grid {top} -layers {M2 M5}
1818
add_pdn_connect -grid {top} -layers {M5 M6}
1919

2020
define_pdn_grid -name {CORE_macro_grid_1} -voltage_domains {CORE} -macro \
21-
-orient {R0 R180 MX MY} -cells {.*}
21+
-orient {R0 R180 MX MY} -cells {fake.*}
2222
add_pdn_stripe -grid {CORE_macro_grid_1} -layer {M5} -width {0.12} -spacing {0.072} -pitch {11.88} \
2323
-offset {0.300}
2424
add_pdn_connect -grid {CORE_macro_grid_1} -layers {M4 M5}

src/pdn/test/macros_cells_via_failure.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ add_pdn_connect -grid {grid} -layers {metal4 metal7}
3434
# grid for: CORE_macro_grid_1
3535
####################################
3636
define_pdn_grid -name {CORE_macro_grid_1} -voltage_domains {CORE} -macro \
37-
-orient {R0 R180 MX MY} -halo {2.0 2.0 2.0 2.0} -cells {.*}
37+
-orient {R0 R180 MX MY} -halo {2.0 2.0 2.0 2.0} -cells {fake.*}
3838
add_pdn_stripe -grid {CORE_macro_grid_1} -layer {metal5} -width {0.93} -pitch {10.0} -offset {2}
3939
add_pdn_stripe -grid {CORE_macro_grid_1} -layer {metal6} -width {0.93} -pitch {10.0} -offset {2}
4040
add_pdn_connect -grid {CORE_macro_grid_1} -layers {metal4 metal5}
@@ -44,7 +44,7 @@ add_pdn_connect -grid {CORE_macro_grid_1} -layers {metal6 metal7}
4444
# grid for: CORE_macro_grid_2
4545
####################################
4646
define_pdn_grid -name {CORE_macro_grid_2} -voltage_domains {CORE} -macro \
47-
-orient {R90 R270 MXR90 MYR90} -halo {2.0 2.0 2.0 2.0} -cells {.*}
47+
-orient {R90 R270 MXR90 MYR90} -halo {2.0 2.0 2.0 2.0} -cells {fake.*}
4848
add_pdn_stripe -grid {CORE_macro_grid_2} -layer {metal6} -width {0.93} -pitch {40.0} -offset {2}
4949
add_pdn_connect -grid {CORE_macro_grid_2} -layers {metal4 metal6}
5050
add_pdn_connect -grid {CORE_macro_grid_2} -layers {metal6 metal7}

src/pdn/test/macros_grid_check.ok

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[INFO ODB-0227] LEF file: nangate_macros/fakeram45_64x32.lef, created 1 library cells
3+
[INFO ODB-0128] Design: RocketTile
4+
[INFO ODB-0130] Created 269 pins.
5+
[INFO ODB-0131] Created 547 components and 1304 component-terminals.
6+
[INFO ODB-0132] Created 2 special nets and 1094 connections.
7+
[INFO ODB-0133] Created 269 nets and 0 connections.
8+
[WARNING PDN-1031] Unable to find cells: fakeram45_64x55
9+
[WARNING PDN-1050] Ignoring non-fixed instance for grid (sram): dcache.data.data_arrays_0.data_arrays_0_ext.mem_10
10+
Voltage domain: Core
11+
Power net: VDD
12+
Ground net: VSS
13+
Grid name: Core
14+
Type: Core
15+
Straps:
16+
Type: Followpin
17+
Layer: metal1
18+
Width: 0.1700
19+
Spacing: 0.0000
20+
Pitch: 2.8000
21+
Offset: 0.0000
22+
Snap to grid: false
23+
Type: Strap
24+
Layer: metal4
25+
Width: 0.4800
26+
Spacing: 4.0000
27+
Pitch: 49.0000
28+
Offset: 2.5000
29+
Snap to grid: false
30+
Type: Strap
31+
Layer: metal7
32+
Width: 1.4000
33+
Spacing: 18.6000
34+
Pitch: 40.0000
35+
Offset: 2.5000
36+
Snap to grid: false
37+
Connect:
38+
Connect layers metal1 -> metal4
39+
Connect layers metal4 -> metal7
40+
Grid name: sram - dcache.data.data_arrays_0.data_arrays_0_ext.mem
41+
Type: Instance
42+
Halo:
43+
Left: 0.0000
44+
Bottom: 0.0000
45+
Right: 0.0000
46+
Top: 0.0000

src/pdn/test/macros_grid_check.tcl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# test for define_pdn_grid -cells
2+
source "helpers.tcl"
3+
4+
read_lef Nangate45/Nangate45.lef
5+
read_lef nangate_macros/fakeram45_64x32.lef
6+
7+
read_def nangate_macros/floorplan.def
8+
9+
# Create an instance with the same prefix as the macro
10+
odb::dbInst_create \
11+
[ord::get_db_block] \
12+
[[ord::get_db] findMaster FILLCELL_X1] \
13+
{dcache.data.data_arrays_0.data_arrays_0_ext.mem_10}
14+
15+
add_global_connection -net VDD -pin_pattern {^VDD$} -power
16+
add_global_connection -net VDD -pin_pattern {^VDDPE$}
17+
add_global_connection -net VDD -pin_pattern {^VDDCE$}
18+
add_global_connection -net VSS -pin_pattern {^VSS$} -ground
19+
add_global_connection -net VSS -pin_pattern {^VSSE$}
20+
21+
set_voltage_domain -power VDD -ground VSS
22+
23+
define_pdn_grid -name "Core"
24+
add_pdn_stripe -followpins -layer metal1
25+
26+
add_pdn_stripe -layer metal4 -width 0.48 -spacing 4.0 -pitch 49.0 -offset 2.5
27+
add_pdn_stripe -layer metal7 -width 1.4 -pitch 40.0 -offset 2.5
28+
29+
add_pdn_connect -layers {metal1 metal4}
30+
add_pdn_connect -layers {metal4 metal7}
31+
32+
define_pdn_grid -macro -name "sram" -cells "fakeram45_64x55"
33+
34+
define_pdn_grid -macro -name "sram" -instances "dcache.data.data_arrays_0.data_arrays_0_ext.mem"
35+
36+
pdngen -report_only

src/pdn/test/names.ok

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
PDN-0184
1515
[ERROR PDN-1043] Grid named "Core" already defined.
1616
PDN-1043
17-
[WARNING PDN-0231] cmp1 is not connected to any power/ground nets.
18-
[WARNING PDN-0231] cmp1 is not connected to any power/ground nets.
17+
[WARNING PDN-1050] Ignoring non-fixed instance for grid (Inst): cmp1
18+
[WARNING PDN-1050] Ignoring non-fixed instance for grid (Inst): cmp1
1919
PDN-1043

0 commit comments

Comments
 (0)