From aac68a0ca1de2ffe512d88f9e907f4fb89a61aed Mon Sep 17 00:00:00 2001
From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com>
Date: Mon, 31 Jan 2022 18:03:00 +0200
Subject: [PATCH] Added PDN and tap halo distinction (#896)
+ Add separate variables for PDN and tap halos
~ Update relevant documentation
---
configuration/README.md | 6 ++++--
configuration/floorplan.tcl | 6 ++++--
designs/def_test/config.tcl | 4 ++--
designs/inverter/config.tcl | 4 ++--
docs/source/hardening_macros.md | 2 +-
scripts/openroad/pdn_cfg.tcl | 8 ++++----
scripts/openroad/tapcell.tcl | 4 ++--
scripts/tcl_commands/all.tcl | 2 ++
8 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/configuration/README.md b/configuration/README.md
index 076cacf8..8ee152d8 100644
--- a/configuration/README.md
+++ b/configuration/README.md
@@ -83,8 +83,10 @@ These variables are optional that can be specified in the design configuration f
| `FP_PDN_ENABLE_MACROS_GRID` | Enables the connection of macros to the top level power grid. 0=Disable 1=Enable.
(Default: `1`) |
| `FP_PDN_MACRO_HOOKS` | Specifies explicit power connections of internal macros to the top level power grid. Comma separated list of macro instance names and power domain vdd and ground net names: ` `
(Default: macros are connected to the first power domain) |
| `FP_PDN_CHECK_NODES` | Enables checking for unconnected nodes in the power grid. 0=Disable 1=Enable.
(Default: `1`) |
-| `FP_HORIZONTAL_HALO` | Sets the horizontal halo around the tap and decap cells. The value provided is in microns.
Default: `10` |
-| `FP_VERTICAL_HALO` | Sets the vertical halo around the tap and decap cells. The value provided is in microns.
Default: set to the value of `FP_HORIZONTAL_HALO` |
+| `FP_TAP_HORIZONTAL_HALO` | Specify the horizontal halo size around macros during tap insertion. The value provided is in microns.
Default: `10` |
+| `FP_TAP_VERTICAL_HALO` | Specify the vertical halo size around macros during tap insertion. The value provided is in microns.
Default: set to the value of `FP_TAP_HORIZONTAL_HALO` |
+| `FP_PDN_HORIZONTAL_HALO` | Sets the horizontal halo around the macros during power grid insertion. The value provided is in microns.
Default: `10` |
+| `FP_PDN_VERTICAL_HALO` | Sets the vertical halo around the macros during power grid insertion. The value provided is in microns.
Default: set to the value of `FP_PDN_HORIZONTAL_HALO` |
| `DESIGN_IS_CORE` | Controls the layers used in the power grid. Depending on whether the design is the core of the chip or a macro inside the core. 1=Is a Core, 0=Is a Macro
(Default: `1`)|
| `FP_PIN_ORDER_CFG` | Points to the pin order configuration file to set the pins in specific directions (S, W, E, N). Check this [file][0] as an example. If not set, then the IO pins will be placed based on one of the other methods depending on the rest of the configurations.
(Default: NONE)|
| `FP_CONTEXT_DEF` | Points to the parent DEF file that includes this macro/design and uses this DEF file to determine the best locations for the pins. It must be used with `FP_CONTEXT_LEF`, otherwise it's considered non-existing. If not set, then the IO pins will be placed based on one of the other methods depending on the rest of the configurations.
(Default: NONE)|
diff --git a/configuration/floorplan.tcl b/configuration/floorplan.tcl
index e7145e3b..df63a6bf 100755
--- a/configuration/floorplan.tcl
+++ b/configuration/floorplan.tcl
@@ -45,8 +45,10 @@ set ::env(TOP_MARGIN_MULT) 4
set ::env(LEFT_MARGIN_MULT) 12
set ::env(RIGHT_MARGIN_MULT) 12
-set ::env(FP_HORIZONTAL_HALO) 10
-set ::env(FP_VERTICAL_HALO) $::env(FP_HORIZONTAL_HALO)
+set ::env(FP_PDN_HORIZONTAL_HALO) 10
+set ::env(FP_PDN_VERTICAL_HALO) $::env(FP_PDN_HORIZONTAL_HALO)
+set ::env(FP_TAP_HORIZONTAL_HALO) 10
+set ::env(FP_TAP_VERTICAL_HALO) $::env(FP_TAP_HORIZONTAL_HALO)
set ::env(FP_PDN_ENABLE_GLOBAL_CONNECTIONS) 1
set ::env(FP_PDN_ENABLE_MACROS_GRID) 1
diff --git a/designs/def_test/config.tcl b/designs/def_test/config.tcl
index 13ef2508..9d674d4e 100755
--- a/designs/def_test/config.tcl
+++ b/designs/def_test/config.tcl
@@ -19,8 +19,8 @@ set ::env(FP_SIZING) absolute
set ::env(DIE_AREA) "0 0 300 300"
set ::env(PL_TARGET_DENSITY) 0.75
-set ::env(FP_HORIZONTAL_HALO) 6
-set ::env(FP_VERTICAL_HALO) $::env(FP_HORIZONTAL_HALO)
+set ::env(FP_PDN_HORIZONTAL_HALO) 6
+set ::env(FP_PDN_VERTICAL_HALO) $::env(FP_PDN_HORIZONTAL_HALO)
set ::env(DIODE_INSERTION_STRATEGY) 3
diff --git a/designs/inverter/config.tcl b/designs/inverter/config.tcl
index f77b16ac..44c71f15 100755
--- a/designs/inverter/config.tcl
+++ b/designs/inverter/config.tcl
@@ -14,8 +14,8 @@ set ::env(FP_SIZING) absolute
set ::env(DIE_AREA) "0 0 34.165 54.885"
set ::env(PL_TARGET_DENSITY) 0.75
-set ::env(FP_HORIZONTAL_HALO) 6
-set ::env(FP_VERTICAL_HALO) $::env(FP_HORIZONTAL_HALO)
+set ::env(FP_PDN_HORIZONTAL_HALO) 6
+set ::env(FP_PDN_VERTICAL_HALO) $::env(FP_TAP_HORIZONTAL_HALO)
set ::env(DIODE_INSERTION_STRATEGY) 3
diff --git a/docs/source/hardening_macros.md b/docs/source/hardening_macros.md
index 804be62c..ce1929f0 100644
--- a/docs/source/hardening_macros.md
+++ b/docs/source/hardening_macros.md
@@ -104,7 +104,7 @@ For Global Placement, the most important value would be `PL_TARGET_DENSITY` whic
- If your design is not a tiny design, then `PL_TARGET_DENSITY` should have a value that is `FP_CORE_UTIL` + 1~5%. Note that `FP_CORE_UTIL` has a value from 0 to 100, while `PL_TARGET_DENSITY` has a value from 0 to 1.0.
-- If your design is a tiny design, then you may need to set `PL_RANDOM_GLB_PLACEMENT` to `1` or `PL_RANDOM_INITIAL_PLACEMENT` to 1. Also, `PL_TARGET_DENSITY` should have high value, while `FP_CORE_UTIL` should have a low value. (i.e `PL_TARGET_DENSITY` set to 0.5 and `FP_CORE_UTIL` set to 5). In very tiny designs (i.e. 1 std cell designs), the approximated DIE AREA in the floorplan stage may not leave enough room to insert tap cells in the design. Thus, it's recommended to use `FP_SIZING` as `absolute` and manually setting an appropriate `DIE_AREA`, check [the floorplan section](#floorplan) for more details. You may also want to reduce the values for `FP_HORIZONTAL_HALO` and `FP_VERTICAL_HALO`. You can read more about those [here][0].
+- If your design is a tiny design, then you may need to set `PL_RANDOM_GLB_PLACEMENT` to `1` or `PL_RANDOM_INITIAL_PLACEMENT` to 1. Also, `PL_TARGET_DENSITY` should have high value, while `FP_CORE_UTIL` should have a low value. (i.e `PL_TARGET_DENSITY` set to 0.5 and `FP_CORE_UTIL` set to 5). In very tiny designs (i.e. 1 std cell designs), the approximated DIE AREA in the floorplan stage may not leave enough room to insert tap cells in the design. Thus, it's recommended to use `FP_SIZING` as `absolute` and manually setting an appropriate `DIE_AREA`, check [the floorplan section](#floorplan) for more details. You may also want to reduce the values for `FP_PDN_HORIZONTAL_HALO` and `FP_PDN_VERTICAL_HALO`. You can read more about those [here][0].
Other values to be considered are `PL_BASIC_PLACEMENT` and `PL_SKIP_INITIAL_PLACEMENT`, you can read more about those [here][0].
diff --git a/scripts/openroad/pdn_cfg.tcl b/scripts/openroad/pdn_cfg.tcl
index 9475b254..2f38c2f5 100644
--- a/scripts/openroad/pdn_cfg.tcl
+++ b/scripts/openroad/pdn_cfg.tcl
@@ -72,18 +72,18 @@ if { $::env(FP_PDN_ENABLE_MACROS_GRID) == 1} {
foreach macro_instance $::env(FP_PDN_MACROS) {
set macro_instance_grid [subst $macro]
dict append $macro_instance_grid instance $macro_instance
- set ::halo [list $::env(FP_HORIZONTAL_HALO) $::env(FP_VERTICAL_HALO)]
+ set ::halo [list $::env(FP_PDN_HORIZONTAL_HALO) $::env(FP_PDN_VERTICAL_HALO)]
pdngen::specify_grid macro [subst $macro_instance_grid]
}
} else {
- set ::halo [list $::env(FP_HORIZONTAL_HALO) $::env(FP_VERTICAL_HALO)]
+ set ::halo [list $::env(FP_PDN_HORIZONTAL_HALO) $::env(FP_PDN_VERTICAL_HALO)]
pdngen::specify_grid macro [subst $macro]
}
# CAN NOT ENABLE THE TCL COMMAND BECAUSE THERE IS NO ARGUMENT FOR SPECIFYING THE POWER AND GROUND PIN NAMES ON THE MACRO
- # define_pdn_grid -macro -orient {R0 R180 MX MY R90 R270 MXR90 MYR90} -grid_over_pg_pins -starts_with POWER -pin_direction vertical -halo [subst {$::env(FP_HORIZONTAL_HALO) $::env(FP_VERTICAL_HALO)}]
+ # define_pdn_grid -macro -orient {R0 R180 MX MY R90 R270 MXR90 MYR90} -grid_over_pg_pins -starts_with POWER -pin_direction vertical -halo [subst {$::env(FP_PDN_HORIZONTAL_HALO) $::env(FP_PDN_VERTICAL_HALO)}]
# add_pdn_connect -layers [subst {$::env(FP_PDN_LOWER_LAYER) $::env(FP_PDN_UPPER_LAYER)}]
} else {
- define_pdn_grid -macro -orient {R0 R180 MX MY R90 R270 MXR90 MYR90} -grid_over_pg_pins -starts_with POWER -halo [subst {$::env(FP_HORIZONTAL_HALO) $::env(FP_VERTICAL_HALO)}]
+ define_pdn_grid -macro -orient {R0 R180 MX MY R90 R270 MXR90 MYR90} -grid_over_pg_pins -starts_with POWER -halo [subst {$::env(FP_PDN_HORIZONTAL_HALO) $::env(FP_PDN_VERTICAL_HALO)}]
}
# POWER or GROUND #Std. cell rails starting with power or ground rails at the bottom of the core area
diff --git a/scripts/openroad/tapcell.tcl b/scripts/openroad/tapcell.tcl
index 783cb5f7..edfe0397 100755
--- a/scripts/openroad/tapcell.tcl
+++ b/scripts/openroad/tapcell.tcl
@@ -27,7 +27,7 @@ tapcell\
-distance $::env(FP_TAPCELL_DIST)\
-tapcell_master "$::env(FP_WELLTAP_CELL)"\
-endcap_master "$::env(FP_ENDCAP_CELL)"\
- -halo_width_x $::env(FP_HORIZONTAL_HALO)\
- -halo_width_y $::env(FP_VERTICAL_HALO)
+ -halo_width_x $::env(FP_TAP_HORIZONTAL_HALO)\
+ -halo_width_y $::env(FP_TAP_HORIZONTAL_HALO)
write_def $::env(SAVE_DEF)
diff --git a/scripts/tcl_commands/all.tcl b/scripts/tcl_commands/all.tcl
index 6e8f6d0b..b1bdef3a 100755
--- a/scripts/tcl_commands/all.tcl
+++ b/scripts/tcl_commands/all.tcl
@@ -397,6 +397,8 @@ proc prep {args} {
handle_deprecated_config LIB_MAX LIB_SLOWEST;
handle_deprecated_config CELL_PAD_EXECLUDE CELL_PAD_EXCLUDE;
handle_deprecated_config ROUTING_OPT_ITERS DRT_OPT_ITERS;
+ handle_deprecated_config FP_HORIZONTAL_HALO FP_PDN_HORIZONTAL_HALO;
+ handle_deprecated_config FP_VERTICAL_HALO FP_PDN_VERTICAL_HALO;
if { [info exists arg_values(-run_path)] } {
set run_path "[file normalize $arg_values(-run_path)]/$tag"