Loading files
# Copyright 2025 LibreLane Contributors
#
# Adapted from OpenLane
#
# Copyright 2020-2022 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
source $::env(SCRIPTS_DIR)/openroad/common/io.tcl
source $::env(SCRIPTS_DIR)/openroad/common/set_global_connections.tcl
set_global_connections
set secondary []
foreach vdd $::env(VDD_NETS) gnd $::env(GND_NETS) {
if { $vdd != $::env(VDD_NET)} {
lappend secondary $vdd
set db_net [[ord::get_db_block] findNet $vdd]
if {$db_net == "NULL"} {
set net [odb::dbNet_create [ord::get_db_block] $vdd]
$net setSpecial
$net setSigType "POWER"
}
}
if { $gnd != $::env(GND_NET)} {
lappend secondary $gnd
set db_net [[ord::get_db_block] findNet $gnd]
if {$db_net == "NULL"} {
set net [odb::dbNet_create [ord::get_db_block] $gnd]
$net setSpecial
$net setSigType "GROUND"
}
}
}
set_voltage_domain -name CORE -power $::env(VDD_NET) -ground $::env(GND_NET) \
-secondary_power $secondary
if { $::env(PDN_MULTILAYER) == 1 } {
set arg_list [list]
if { $::env(PDN_ENABLE_PINS) } {
lappend arg_list -pins "$::env(PDN_VERTICAL_LAYER) $::env(PDN_HORIZONTAL_LAYER)"
}
define_pdn_grid \
-name stdcell_grid \
-starts_with POWER \
-voltage_domain CORE \
{*}$arg_list
set arg_list [list]
append_if_equals arg_list PDN_EXTEND_TO "core_ring" -extend_to_core_ring
append_if_equals arg_list PDN_EXTEND_TO "boundary" -extend_to_boundary
add_pdn_stripe \
-grid stdcell_grid \
-layer $::env(PDN_VERTICAL_LAYER) \
-width $::env(PDN_VWIDTH) \
-pitch $::env(PDN_VPITCH) \
-offset $::env(PDN_VOFFSET) \
-spacing $::env(PDN_VSPACING) \
-starts_with POWER \
{*}$arg_list
add_pdn_stripe \
-grid stdcell_grid \
-layer $::env(PDN_HORIZONTAL_LAYER) \
-width $::env(PDN_HWIDTH) \
-pitch $::env(PDN_HPITCH) \
-offset $::env(PDN_HOFFSET) \
-spacing $::env(PDN_HSPACING) \
-starts_with POWER \
{*}$arg_list
add_pdn_connect \
-grid stdcell_grid \
-layers "$::env(PDN_VERTICAL_LAYER) $::env(PDN_HORIZONTAL_LAYER)"
} else {
set arg_list [list]
if { $::env(PDN_ENABLE_PINS) } {
lappend arg_list -pins "$::env(PDN_VERTICAL_LAYER)"
}
define_pdn_grid \
-name stdcell_grid \
-starts_with POWER \
-voltage_domain CORE \
{*}$arg_list
set arg_list [list]
append_if_equals arg_list PDN_EXTEND_TO "core_ring" -extend_to_core_ring
append_if_equals arg_list PDN_EXTEND_TO "boundary" -extend_to_boundary
add_pdn_stripe \
-grid stdcell_grid \
-layer $::env(PDN_VERTICAL_LAYER) \
-width $::env(PDN_VWIDTH) \
-pitch $::env(PDN_VPITCH) \
-offset $::env(PDN_VOFFSET) \
-spacing $::env(PDN_VSPACING) \
-starts_with POWER \
{*}$arg_list
}
# Adds the standard cell rails if enabled.
if { $::env(PDN_ENABLE_RAILS) == 1 } {
add_pdn_stripe \
-grid stdcell_grid \
-layer $::env(PDN_RAIL_LAYER) \
-width $::env(PDN_RAIL_WIDTH) \
-followpins
add_pdn_connect \
-grid stdcell_grid \
-layers "$::env(PDN_RAIL_LAYER) $::env(PDN_VERTICAL_LAYER)"
}
# Adds the core ring if enabled.
if { $::env(PDN_CORE_RING) == 1 } {
if { $::env(PDN_MULTILAYER) == 1 } {
set arg_list [list]
append_if_flag arg_list PDN_CORE_RING_ALLOW_OUT_OF_DIE -allow_out_of_die
append_if_flag arg_list PDN_CORE_RING_CONNECT_TO_PADS -connect_to_pads
append_if_equals arg_list PDN_EXTEND_TO "boundary" -extend_to_boundary
append_if_exists_argument arg_list PDN_CORE_RING_CONNECT_TO_PAD_LAYERS -connect_to_pad_layers
set pdn_core_vertical_layer $::env(PDN_VERTICAL_LAYER)
set pdn_core_horizontal_layer $::env(PDN_HORIZONTAL_LAYER)
if { [info exists ::env(PDN_CORE_VERTICAL_LAYER)] } {
set pdn_core_vertical_layer $::env(PDN_CORE_VERTICAL_LAYER)
}
if { [info exists ::env(PDN_CORE_HORIZONTAL_LAYER)] } {
set pdn_core_horizontal_layer $::env(PDN_CORE_HORIZONTAL_LAYER)
}
add_pdn_ring \
-grid stdcell_grid \
-layers "$pdn_core_vertical_layer $pdn_core_horizontal_layer" \
-widths "$::env(PDN_CORE_RING_VWIDTH) $::env(PDN_CORE_RING_HWIDTH)" \
-spacings "$::env(PDN_CORE_RING_VSPACING) $::env(PDN_CORE_RING_HSPACING)" \
-core_offset "$::env(PDN_CORE_RING_VOFFSET) $::env(PDN_CORE_RING_HOFFSET)" \
{*}$arg_list
if { [info exists ::env(PDN_CORE_VERTICAL_LAYER)] } {
add_pdn_connect \
-grid stdcell_grid \
-layers "$::env(PDN_CORE_VERTICAL_LAYER) $::env(PDN_HORIZONTAL_LAYER)"
}
if { [info exists ::env(PDN_CORE_HORIZONTAL_LAYER)] } {
add_pdn_connect \
-grid stdcell_grid \
-layers "$::env(PDN_CORE_HORIZONTAL_LAYER) $::env(PDN_VERTICAL_LAYER)"
}
if { [info exists ::env(PDN_CORE_VERTICAL_LAYER)] && [info exists ::env(PDN_CORE_HORIZONTAL_LAYER)] } {
add_pdn_connect \
-grid stdcell_grid \
-layers "$::env(PDN_CORE_VERTICAL_LAYER) $::env(PDN_CORE_HORIZONTAL_LAYER)"
}
} else {
throw APPLICATION "PDN_CORE_RING cannot be used when PDN_MULTILAYER is set to false."
}
}
define_pdn_grid \
-macro \
-default \
-name macro \
-starts_with POWER \
-halo "$::env(PDN_HORIZONTAL_HALO) $::env(PDN_VERTICAL_HALO)"
add_pdn_connect \
-grid macro \
-layers "$::env(PDN_VERTICAL_LAYER) $::env(PDN_HORIZONTAL_LAYER)"
aaf7a9387This file is pinned to the selected release. Download the original to open it in your design tool.