1+ # Copyright 2020-2022 Efabless Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ source $::env(SCRIPTS_DIR) /openroad/common/set_global_connections.tcl
16+ set_global_connections
17+
18+ set secondary []
19+ foreach vdd $::env(VDD_NETS) gnd $::env(GND_NETS) {
20+ if { $vdd != $::env(VDD_NET) } {
21+ lappend secondary $vdd
22+
23+ set db_net [[ord::get_db_block] findNet $vdd ]
24+ if {$db_net == " NULL" } {
25+ set net [odb::dbNet_create [ord::get_db_block] $vdd ]
26+ $net setSpecial
27+ $net setSigType " POWER"
28+ }
29+ }
30+
31+ if { $gnd != $::env(GND_NET) } {
32+ lappend secondary $gnd
33+
34+ set db_net [[ord::get_db_block] findNet $gnd ]
35+ if {$db_net == " NULL" } {
36+ set net [odb::dbNet_create [ord::get_db_block] $gnd ]
37+ $net setSpecial
38+ $net setSigType " GROUND"
39+ }
40+ }
41+ }
42+
43+ set_voltage_domain -name CORE -power $::env(VDD_NET) -ground $::env(GND_NET) \
44+ -secondary_power $secondary
45+
46+ if { $::env(FP_PDN_MULTILAYER) == 1 } {
47+ define_pdn_grid \
48+ -name stdcell_grid \
49+ -starts_with POWER \
50+ -voltage_domain CORE \
51+ -pins " $::env(FP_PDN_VERTICAL_LAYER) $::env(FP_PDN_HORIZONTAL_LAYER) "
52+
53+ add_pdn_stripe \
54+ -grid stdcell_grid \
55+ -layer $::env(FP_PDN_VERTICAL_LAYER) \
56+ -width $::env(FP_PDN_VWIDTH) \
57+ -pitch $::env(FP_PDN_VPITCH) \
58+ -offset $::env(FP_PDN_VOFFSET) \
59+ -spacing $::env(FP_PDN_VSPACING) \
60+ -starts_with POWER -extend_to_core_ring
61+
62+ add_pdn_stripe \
63+ -grid stdcell_grid \
64+ -layer $::env(FP_PDN_HORIZONTAL_LAYER) \
65+ -width $::env(FP_PDN_HWIDTH) \
66+ -pitch $::env(FP_PDN_HPITCH) \
67+ -offset $::env(FP_PDN_HOFFSET) \
68+ -spacing $::env(FP_PDN_HSPACING) \
69+ -starts_with POWER -extend_to_core_ring
70+
71+ add_pdn_connect \
72+ -grid stdcell_grid \
73+ -layers " $::env(FP_PDN_VERTICAL_LAYER) $::env(FP_PDN_HORIZONTAL_LAYER) "
74+ } else {
75+ define_pdn_grid \
76+ -name stdcell_grid \
77+ -starts_with POWER \
78+ -voltage_domain CORE \
79+ -pins $::env(FP_PDN_VERTICAL_LAYER)
80+
81+ add_pdn_stripe \
82+ -grid stdcell_grid \
83+ -layer $::env(FP_PDN_VERTICAL_LAYER) \
84+ -width $::env(FP_PDN_VWIDTH) \
85+ -pitch $::env(FP_PDN_VPITCH) \
86+ -offset $::env(FP_PDN_VOFFSET) \
87+ -spacing $::env(FP_PDN_VSPACING) \
88+ -starts_with POWER -extend_to_core_ring
89+ }
90+
91+ # Adds the standard cell rails if enabled.
92+ if { $::env(FP_PDN_ENABLE_RAILS) == 1 } {
93+ add_pdn_stripe \
94+ -grid stdcell_grid \
95+ -layer $::env(FP_PDN_RAIL_LAYER) \
96+ -width $::env(FP_PDN_RAIL_WIDTH) \
97+ -followpins \
98+ -starts_with POWER
99+
100+ add_pdn_connect \
101+ -grid stdcell_grid \
102+ -layers " $::env(FP_PDN_RAIL_LAYER) $::env(FP_PDN_VERTICAL_LAYER) "
103+ }
104+
105+
106+ # Adds the core ring if enabled.
107+ if { $::env(FP_PDN_CORE_RING) == 1 } {
108+ if { $::env(FP_PDN_MULTILAYER) == 1 } {
109+ add_pdn_ring \
110+ -grid stdcell_grid \
111+ -layers " $::env(FP_PDN_VERTICAL_LAYER) $::env(FP_PDN_HORIZONTAL_LAYER) " \
112+ -widths " $::env(FP_PDN_CORE_RING_VWIDTH) $::env(FP_PDN_CORE_RING_HWIDTH) " \
113+ -spacings " $::env(FP_PDN_CORE_RING_VSPACING) $::env(FP_PDN_CORE_RING_HSPACING) " \
114+ -core_offset " $::env(FP_PDN_CORE_RING_VOFFSET) $::env(FP_PDN_CORE_RING_HOFFSET) "
115+ } else {
116+ throw APPLICATION " FP_PDN_CORE_RING cannot be used when FP_PDN_MULTILAYER is set to false."
117+ # add_pdn_ring \
118+ # -grid stdcell_grid \
119+ # -layers "$::env(FP_PDN_VERTICAL_LAYER)" \
120+ # -widths "$::env(FP_PDN_CORE_RING_VWIDTH)" \
121+ # -spacings "$::env(FP_PDN_CORE_RING_VSPACING)" \
122+ # -core_offset "$::env(FP_PDN_CORE_RING_VOFFSET)"
123+ }
124+ }
125+
126+ # define_pdn_grid \
127+ # -macro \
128+ # -default \
129+ # -name macro \
130+ # -starts_with POWER \
131+ # -halo "$::env(FP_PDN_HORIZONTAL_HALO) $::env(FP_PDN_VERTICAL_HALO)"
132+
133+
134+ # # add_pdn_stripe \
135+ # # -grid macro \
136+ # # -layer $::env(FP_PDN_VERTICAL_LAYER) \
137+ # # -width $::env(FP_PDN_VWIDTH) \
138+ # # -pitch $::env(FP_PDN_VPITCH) \
139+ # # -offset $::env(FP_PDN_VOFFSET) \
140+ # # -spacing $::env(FP_PDN_VSPACING) \
141+ # # -starts_with POWER -extend_to_core_ring
142+
143+ # add_pdn_connect \
144+ # -grid macro \
145+ # -layers "met3 met4"
0 commit comments