diff --git a/docs/user/FlowVariables.md b/docs/user/FlowVariables.md index 449ec84425..487dc4ab26 100644 --- a/docs/user/FlowVariables.md +++ b/docs/user/FlowVariables.md @@ -158,6 +158,7 @@ configuration file. | GDS_ALLOW_EMPTY| Single regular expression of module names of macros that have no .gds file| | | GDS_FILES| Path to platform GDS files.| | | GENERATE_ARTIFACTS_ON_FAILURE| For instance Bazel needs artifacts (.odb and .rpt files) on a failure to allow the user to save hours on re-running the failed step locally, but when working with a Makefile flow, it is more natural to fail the step and leave the user to manually inspect the logs and artifacts directly via the file system. Set to 1 to change the behavior to generate artifacts upon failure to e.g. do a global route. The exit code will still be non-zero on all other failures that aren't covered by the "useful to inspect the artifacts on failure" use-case. Example: just like detailed routing, a global route that fails with congestion, is not a build failure(as in exit code non-zero), it is a successful(as in zero exit code) global route that produce reports detailing the problem. Detailed route will not proceed, if there is global routing congestion This allows build systems, such as bazel, to create artifacts for global and detailed route, even if the operation had problems, without having know about the semantics between global and detailed route. Considering that global and detailed route can run for a long time and use a lot of memory, this allows inspecting results on a laptop for a build that ran on a server.| 0| +| GLOBAL_CONNECT_TCL| File path to the add_global_connection rules that connect the supply pins of the instances to the supply nets. Sourced at floorplan right after the netlist is loaded, before any step can mark an instance dont_touch; the rules are kept in the database. The platform's file by default; a design whose PDN_TCL names other supply nets sets its own. PDN_TCL defines the grids.| | | GLOBAL_PLACEMENT_ARGS| Use additional tuning parameters during global placement other than default args defined in global_place.tcl.| | | GLOBAL_ROUTE_ARGS| Replaces default arguments for global route. The -congestion_iterations default is set by the flow (30 for FastRoute, 10 for CUGR); add -congestion_iterations here to override it.| -congestion_report_iter_step 5 -verbose| | GLOBAL_ROUTE_USE_CUGR| Passed as -use_cugr to global_route. Uses CUGR as the global routing solver instead of the default FastRoute solver. NOTE: CUGR is not ready for production.| 0| @@ -420,6 +421,7 @@ configuration file. - [FLOORPLAN_DEF](#FLOORPLAN_DEF) - [FOOTPRINT](#FOOTPRINT) - [FOOTPRINT_TCL](#FOOTPRINT_TCL) +- [GLOBAL_CONNECT_TCL](#GLOBAL_CONNECT_TCL) - [HOLD_SLACK_MARGIN](#HOLD_SLACK_MARGIN) - [IO_CONSTRAINTS](#IO_CONSTRAINTS) - [MACRO_PLACEMENT_TCL](#MACRO_PLACEMENT_TCL) diff --git a/flow/designs/gf180/uart-blocks/BLOCKS_grid_strategy.tcl b/flow/designs/gf180/uart-blocks/BLOCKS_grid_strategy.tcl index c431fbff0f..b0a3368eea 100644 --- a/flow/designs/gf180/uart-blocks/BLOCKS_grid_strategy.tcl +++ b/flow/designs/gf180/uart-blocks/BLOCKS_grid_strategy.tcl @@ -1,17 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDP$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDC$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VNW$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSC$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VPW$} -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/designs/gf180/uart-blocks/uart_rx/pdn.tcl b/flow/designs/gf180/uart-blocks/uart_rx/pdn.tcl index ac80ec7d83..000216ef69 100644 --- a/flow/designs/gf180/uart-blocks/uart_rx/pdn.tcl +++ b/flow/designs/gf180/uart-blocks/uart_rx/pdn.tcl @@ -1,17 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDP$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDC$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VNW$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSC$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VPW$} -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/config.mk b/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/config.mk index 4af4286850..3bf29814a9 100644 --- a/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/config.mk +++ b/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/config.mk @@ -17,5 +17,6 @@ export PLACE_DENSITY = 0.75 export CORNERS = slow typ fast +export GLOBAL_CONNECT_TCL = $(DESIGN_HOME)/$(PLATFORM)/i2c-gpio-expander/global_connect.tcl export PDN_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(TOP_DESIGN_NICKNAME)/${DESIGN_NAME}/pdn.tcl diff --git a/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/pdn.tcl b/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/pdn.tcl index e6c2311a3a..400718201f 100644 --- a/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/pdn.tcl +++ b/flow/designs/ihp-sg13g2/i2c-gpio-expander/I2cDeviceCtrl/pdn.tcl @@ -1,18 +1,3 @@ -# standard cells -add_global_connection -net {VDD} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -pin_pattern {^VDDCE$} -add_global_connection -net {VSS} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -pin_pattern {^VSSE$} - -# macros -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VDD!} -power -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VSS!} -ground -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground - -global_connect - # core voltage domain set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/designs/ihp-sg13g2/i2c-gpio-expander/config.mk b/flow/designs/ihp-sg13g2/i2c-gpio-expander/config.mk index 53f618cb07..d42b756487 100644 --- a/flow/designs/ihp-sg13g2/i2c-gpio-expander/config.mk +++ b/flow/designs/ihp-sg13g2/i2c-gpio-expander/config.mk @@ -51,6 +51,7 @@ export FOOTPRINT_TCL = $(PLATFORM_DIR)/pad.tcl export MACRO_PLACEMENT_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/macros.tcl +export GLOBAL_CONNECT_TCL = $(DESIGN_HOME)/$(PLATFORM)/i2c-gpio-expander/global_connect.tcl export PDN_TCL = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/pdn.tcl export BLOCKS = I2cDeviceCtrl diff --git a/flow/designs/ihp-sg13g2/i2c-gpio-expander/global_connect.tcl b/flow/designs/ihp-sg13g2/i2c-gpio-expander/global_connect.tcl new file mode 100644 index 0000000000..01012cbbeb --- /dev/null +++ b/flow/designs/ihp-sg13g2/i2c-gpio-expander/global_connect.tcl @@ -0,0 +1,14 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +# standard cells +add_global_connection -net {VDD} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -pin_pattern {^VDDCE$} +add_global_connection -net {VSS} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -pin_pattern {^VSSE$} + +# macros +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VDD!} -power +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VSS!} -ground +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground diff --git a/flow/designs/ihp-sg13g2/i2c-gpio-expander/pdn.tcl b/flow/designs/ihp-sg13g2/i2c-gpio-expander/pdn.tcl index aa317e8153..cc380e42b0 100644 --- a/flow/designs/ihp-sg13g2/i2c-gpio-expander/pdn.tcl +++ b/flow/designs/ihp-sg13g2/i2c-gpio-expander/pdn.tcl @@ -1,18 +1,3 @@ -# standard cells -add_global_connection -net {VDD} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -pin_pattern {^VDDCE$} -add_global_connection -net {VSS} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -pin_pattern {^VSSE$} - -# macros -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VDD!} -power -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VSS!} -ground -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground - -global_connect - # core voltage domain set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/designs/nangate45/gcd/grid_strategy-M1-M4-M7.tcl b/flow/designs/nangate45/gcd/grid_strategy-M1-M4-M7.tcl index 124e9a32cc..0d9bd1982f 100644 --- a/flow/designs/nangate45/gcd/grid_strategy-M1-M4-M7.tcl +++ b/flow/designs/nangate45/gcd/grid_strategy-M1-M4-M7.tcl @@ -1,13 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/asap7/config.mk b/flow/platforms/asap7/config.mk index a732b7abf6..286310146f 100644 --- a/flow/platforms/asap7/config.mk +++ b/flow/platforms/asap7/config.mk @@ -37,6 +37,8 @@ export PLACE_SITE ?= asap7sc7p5t export MAKE_TRACKS = $(PLATFORM_DIR)/openRoad/make_tracks.tcl # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/openRoad/pdn/global_connect.tcl + ifeq ($(BLOCKS),) export PDN_TCL ?= $(PLATFORM_DIR)/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl else diff --git a/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl b/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl index 2c971d7e45..c5af0b8afa 100644 --- a/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl +++ b/flow/platforms/asap7/openRoad/pdn/BLOCKS_grid_strategy.tcl @@ -1,12 +1,6 @@ # Top level PDN for macros using BLOCK_grid_strategy.tcl source $::env(SCRIPTS_DIR)/util.tcl -#################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground - #################################### # voltage domains #################################### diff --git a/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl b/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl index 0b54067ea9..0ac2c48e44 100644 --- a/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl +++ b/flow/platforms/asap7/openRoad/pdn/BLOCK_grid_strategy.tcl @@ -1,11 +1,5 @@ # macro level counterpart to BLOCKS_grid_strategy.tcl -#################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground - #################################### # voltage domains #################################### diff --git a/flow/platforms/asap7/openRoad/pdn/global_connect.tcl b/flow/platforms/asap7/openRoad/pdn/global_connect.tcl new file mode 100644 index 0000000000..c1c6284ca3 --- /dev/null +++ b/flow/platforms/asap7/openRoad/pdn/global_connect.tcl @@ -0,0 +1,7 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} diff --git a/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl b/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl index f15e778427..cd41f240ce 100644 --- a/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl +++ b/flow/platforms/asap7/openRoad/pdn/grid_strategy-M1-M2-M5-M6.tcl @@ -1,13 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/gf180/config.mk b/flow/platforms/gf180/config.mk index 59d9ed8421..3b65d7c39e 100644 --- a/flow/platforms/gf180/config.mk +++ b/flow/platforms/gf180/config.mk @@ -76,6 +76,7 @@ export IO_PLACER_H ?= Metal3 export IO_PLACER_V ?= Metal4 # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/openROAD/pdn/global_connect.tcl export PDN_TCL ?= $(PLATFORM_DIR)/openROAD/pdn/pdn_grid_strategy_$(TRACK_OPTION)_6M.cfg # Endcap and Welltie cells diff --git a/flow/platforms/gf180/openROAD/pdn/global_connect.tcl b/flow/platforms/gf180/openROAD/pdn/global_connect.tcl new file mode 100644 index 0000000000..10fdfb4135 --- /dev/null +++ b/flow/platforms/gf180/openROAD/pdn/global_connect.tcl @@ -0,0 +1,12 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDP$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDC$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VNW$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSC$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VPW$} diff --git a/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_7t_6M.cfg b/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_7t_6M.cfg index 20a1ed4000..b258ce72b6 100644 --- a/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_7t_6M.cfg +++ b/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_7t_6M.cfg @@ -1,17 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDP$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDC$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VNW$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSC$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VPW$} -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_9t_6M.cfg b/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_9t_6M.cfg index 513c6fd84a..5b1521de23 100644 --- a/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_9t_6M.cfg +++ b/flow/platforms/gf180/openROAD/pdn/pdn_grid_strategy_9t_6M.cfg @@ -1,17 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDP$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDC$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VNW$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSC$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VPW$} -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/gt2n/config.mk b/flow/platforms/gt2n/config.mk index 2fab2a4b46..50e24068be 100644 --- a/flow/platforms/gt2n/config.mk +++ b/flow/platforms/gt2n/config.mk @@ -98,6 +98,7 @@ export IO_PLACER_H ?= M2 export IO_PLACER_V ?= M3 # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/global_connect.tcl export PDN_TCL ?= $(PLATFORM_DIR)/pdn.tcl # Endcap and Welltie cells diff --git a/flow/platforms/gt2n/global_connect.tcl b/flow/platforms/gt2n/global_connect.tcl new file mode 100644 index 0000000000..8a83c1df5b --- /dev/null +++ b/flow/platforms/gt2n/global_connect.tcl @@ -0,0 +1,4 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {vdd} -inst_pattern {.*} -pin_pattern {^vdd$} -power +add_global_connection -net {vss} -inst_pattern {.*} -pin_pattern {^vss$} -ground diff --git a/flow/platforms/gt2n/pdn.tcl b/flow/platforms/gt2n/pdn.tcl index 1dd5f91f3c..06a03e23db 100644 --- a/flow/platforms/gt2n/pdn.tcl +++ b/flow/platforms/gt2n/pdn.tcl @@ -1,10 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {vdd} -inst_pattern {.*} -pin_pattern {^vdd$} -power -add_global_connection -net {vss} -inst_pattern {.*} -pin_pattern {^vss$} -ground -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {vdd} -ground {vss} diff --git a/flow/platforms/ihp-sg13g2/config.mk b/flow/platforms/ihp-sg13g2/config.mk index 577d5c41ea..e1daf3a001 100644 --- a/flow/platforms/ihp-sg13g2/config.mk +++ b/flow/platforms/ihp-sg13g2/config.mk @@ -86,6 +86,7 @@ export IO_PLACER_V ?= Metal2 export IO_PLACER_H ?= Metal3 # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/global_connect.tcl export PDN_TCL ?= $(PLATFORM_DIR)/pdn.tcl # To allow the core rings to fit inside the core area diff --git a/flow/platforms/ihp-sg13g2/global_connect.tcl b/flow/platforms/ihp-sg13g2/global_connect.tcl new file mode 100644 index 0000000000..cfb7730768 --- /dev/null +++ b/flow/platforms/ihp-sg13g2/global_connect.tcl @@ -0,0 +1,7 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {VDD} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -pin_pattern {^VDDCE$} +add_global_connection -net {VSS} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -pin_pattern {^VSSE$} diff --git a/flow/platforms/ihp-sg13g2/pdn.tcl b/flow/platforms/ihp-sg13g2/pdn.tcl index 9ad053612a..3acb3c4969 100644 --- a/flow/platforms/ihp-sg13g2/pdn.tcl +++ b/flow/platforms/ihp-sg13g2/pdn.tcl @@ -1,14 +1,4 @@ #################################### -# global connections -#################################### -# standard cells -add_global_connection -net {VDD} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -pin_pattern {^VDDCE$} -add_global_connection -net {VSS} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -pin_pattern {^VSSE$} -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/nangate45/config.mk b/flow/platforms/nangate45/config.mk index 6371d09410..0ae5eddb94 100644 --- a/flow/platforms/nangate45/config.mk +++ b/flow/platforms/nangate45/config.mk @@ -54,6 +54,7 @@ export IO_PLACER_H ?= metal5 export IO_PLACER_V ?= metal6 # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/global_connect.tcl export PDN_TCL ?= $(PLATFORM_DIR)/grid_strategy-M1-M4-M7.tcl # Endcap and Welltie cells diff --git a/flow/platforms/nangate45/global_connect.tcl b/flow/platforms/nangate45/global_connect.tcl new file mode 100644 index 0000000000..c1c6284ca3 --- /dev/null +++ b/flow/platforms/nangate45/global_connect.tcl @@ -0,0 +1,7 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} diff --git a/flow/platforms/nangate45/grid_strategy-M1-M4-M7.tcl b/flow/platforms/nangate45/grid_strategy-M1-M4-M7.tcl index eca9dce29a..3021bc542c 100644 --- a/flow/platforms/nangate45/grid_strategy-M1-M4-M7.tcl +++ b/flow/platforms/nangate45/grid_strategy-M1-M4-M7.tcl @@ -1,13 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/sky130hd/config.mk b/flow/platforms/sky130hd/config.mk index 8aaa4ce0b7..1d50414ec6 100644 --- a/flow/platforms/sky130hd/config.mk +++ b/flow/platforms/sky130hd/config.mk @@ -97,6 +97,7 @@ export IO_PLACER_H ?= met3 export IO_PLACER_V ?= met2 # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/global_connect.tcl export PDN_TCL ?= $(PLATFORM_DIR)/pdn.tcl # Endcap and Welltie cells diff --git a/flow/platforms/sky130hd/global_connect.tcl b/flow/platforms/sky130hd/global_connect.tcl new file mode 100644 index 0000000000..46b6fd3bb5 --- /dev/null +++ b/flow/platforms/sky130hd/global_connect.tcl @@ -0,0 +1,11 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPWR} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPB} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VGND} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VNB} diff --git a/flow/platforms/sky130hd/pdn.tcl b/flow/platforms/sky130hd/pdn.tcl index 748c17ddda..e364d70bee 100644 --- a/flow/platforms/sky130hd/pdn.tcl +++ b/flow/platforms/sky130hd/pdn.tcl @@ -1,17 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPWR} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPB} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VGND} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VNB} -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/platforms/sky130hs/config.mk b/flow/platforms/sky130hs/config.mk index 6e73e77a23..d0097bb3dd 100644 --- a/flow/platforms/sky130hs/config.mk +++ b/flow/platforms/sky130hs/config.mk @@ -59,6 +59,7 @@ export IO_PLACER_H ?= met3 export IO_PLACER_V ?= met2 # Define default PDN config +export GLOBAL_CONNECT_TCL ?= $(PLATFORM_DIR)/global_connect.tcl export PDN_TCL ?= $(PLATFORM_DIR)/pdn.tcl # Endcap and Welltie cells diff --git a/flow/platforms/sky130hs/global_connect.tcl b/flow/platforms/sky130hs/global_connect.tcl new file mode 100644 index 0000000000..46b6fd3bb5 --- /dev/null +++ b/flow/platforms/sky130hs/global_connect.tcl @@ -0,0 +1,11 @@ +# Global connections, made at floorplan right after the netlist is +# loaded (GLOBAL_CONNECT_TCL); the PDN scripts define the grids. +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPWR} +add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPB} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VGND} +add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VNB} diff --git a/flow/platforms/sky130hs/pdn.tcl b/flow/platforms/sky130hs/pdn.tcl index 0c4ef234af..0ffa8a85bd 100644 --- a/flow/platforms/sky130hs/pdn.tcl +++ b/flow/platforms/sky130hs/pdn.tcl @@ -1,17 +1,4 @@ #################################### -# global connections -#################################### -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDD$} -power -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDPE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {^VDDCE$} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPWR} -add_global_connection -net {VDD} -inst_pattern {.*} -pin_pattern {VPB} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSS$} -ground -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {^VSSE$} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VGND} -add_global_connection -net {VSS} -inst_pattern {.*} -pin_pattern {VNB} -global_connect -#################################### # voltage domains #################################### set_voltage_domain -name {CORE} -power {VDD} -ground {VSS} diff --git a/flow/scripts/floorplan.tcl b/flow/scripts/floorplan.tcl index 67b5b16564..3190eeb612 100644 --- a/flow/scripts/floorplan.tcl +++ b/flow/scripts/floorplan.tcl @@ -2,6 +2,15 @@ utl::set_metrics_stage "floorplan__{}" source $::env(SCRIPTS_DIR)/load.tcl erase_non_stage_variables floorplan load_design 1_synth.odb 1_synth.sdc + +# The global connections, before any step can mark an instance +# dont_touch: global_connect skips one (ODB-0383). The rules stay in the +# database for a later step that creates instances. +if { [env_var_exists_and_non_empty GLOBAL_CONNECT_TCL] } { + log_cmd source $::env(GLOBAL_CONNECT_TCL) + log_cmd global_connect +} + source_step_tcl PRE FLOORPLAN proc report_unused_masters { } { diff --git a/flow/scripts/pdn.tcl b/flow/scripts/pdn.tcl index 1ffbadd9ba..7a7c32b25f 100644 --- a/flow/scripts/pdn.tcl +++ b/flow/scripts/pdn.tcl @@ -4,6 +4,9 @@ load_design 2_3_floorplan_tapcell.odb 2_1_floorplan.sdc source_step_tcl PRE PDN source $::env(PDN_TCL) +# The rules floorplan stored, for the instances made since (tap and +# endcap cells), and any PDN_TCL adds. +global_connect pdngen source_step_tcl POST PDN diff --git a/flow/scripts/variables.json b/flow/scripts/variables.json index 7ac2d93f3b..4638b73b89 100644 --- a/flow/scripts/variables.json +++ b/flow/scripts/variables.json @@ -406,6 +406,12 @@ "default": 0, "description": "For instance Bazel needs artifacts (.odb and .rpt files) on a failure to allow the user to save hours on re-running the failed step locally, but when working with a Makefile flow, it is more natural to fail the step and leave the user to manually inspect the logs and artifacts directly via the file system. Set to 1 to change the behavior to generate artifacts upon failure to e.g. do a global route. The exit code will still be non-zero on all other failures that aren't covered by the \"useful to inspect the artifacts on failure\" use-case. Example: just like detailed routing, a global route that fails with congestion, is not a build failure(as in exit code non-zero), it is a successful(as in zero exit code) global route that produce reports detailing the problem. Detailed route will not proceed, if there is global routing congestion This allows build systems, such as bazel, to create artifacts for global and detailed route, even if the operation had problems, without having know about the semantics between global and detailed route. Considering that global and detailed route can run for a long time and use a lot of memory, this allows inspecting results on a laptop for a build that ran on a server.\n" }, + "GLOBAL_CONNECT_TCL": { + "description": "File path to the add_global_connection rules that connect the supply pins of the instances to the supply nets. Sourced at floorplan right after the netlist is loaded, before any step can mark an instance dont_touch; the rules are kept in the database. The platform's file by default; a design whose PDN_TCL names other supply nets sets its own. PDN_TCL defines the grids.\n", + "stages": [ + "floorplan" + ] + }, "GLOBAL_PLACEMENT_ARGS": { "description": "Use additional tuning parameters during global placement other than default args defined in global_place.tcl.\n", "stages": [ diff --git a/flow/scripts/variables.yaml b/flow/scripts/variables.yaml index a2119190de..3286a0ee96 100644 --- a/flow/scripts/variables.yaml +++ b/flow/scripts/variables.yaml @@ -640,6 +640,16 @@ PDN_TCL: the actual metal straps. stages: - floorplan +GLOBAL_CONNECT_TCL: + description: > + File path to the add_global_connection rules that connect the supply pins + of the instances to the supply nets. Sourced at floorplan right after the + netlist is loaded, before any step can mark an instance dont_touch; the + rules are kept in the database. The platform's file by default; a design + whose PDN_TCL names other supply nets sets its own. PDN_TCL defines the + grids. + stages: + - floorplan MAKE_TRACKS: description: | Tcl file that defines add routing tracks to a floorplan. diff --git a/flow/test/test_global_connections.py b/flow/test/test_global_connections.py new file mode 100644 index 0000000000..347007faac --- /dev/null +++ b/flow/test/test_global_connections.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python3 +"""Floorplan makes the global connections right after the netlist is loaded. + +global_connect skips a dont_touch instance, so floorplan.tcl makes the +global connections (GLOBAL_CONNECT_TCL) right after it loads the +netlist, before any step, the PRE_FLOORPLAN_TCL hook included, can mark +an instance dont_touch. Every instance's supply pins are then on a net, +and the rules stay in the database: a later step that creates instances +connects them with global_connect before marking them. + +floorplan.tcl runs as is on a two-inverter nangate45 design, with a +PRE_FLOORPLAN_TCL hook that marks one of them dont_touch; load.tcl is +replaced by one that reads the netlist and stubs the reports. + +Skipped when no openroad is available: OPENROAD_EXE or openroad on PATH. +""" + +import os +import shutil +import subprocess +import tempfile +import unittest + +FLOW = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") +SCRIPTS = os.path.join(FLOW, "scripts") +PLATFORM = os.path.join(FLOW, "platforms", "nangate45") +LEF = os.path.join(PLATFORM, "lef") +TECH_LEF = os.path.join(LEF, "NangateOpenCellLibrary.tech.lef") +SC_LEF = os.path.join(LEF, "NangateOpenCellLibrary.macro.mod.lef") +LIB = os.path.join(PLATFORM, "lib", "NangateOpenCellLibrary_typical.lib") + +DESIGN = """\ +module top (input a, output y0, output y1); + INV_X1 kept (.A(a), .ZN(y0)); + INV_X1 free (.A(a), .ZN(y1)); +endmodule +""" + +# In place of load.tcl: the netlist and liberty without an SDC, and no +# timing reports. +LOAD = f"""\ +source {{{os.path.join(SCRIPTS, "util.tcl")}}} +proc load_design {{ design_file sdc_file }} {{ + read_liberty {{{LIB}}} + read_lef {{{TECH_LEF}}} + read_lef {{{SC_LEF}}} + read_verilog top.v + link_design top +}} +proc report_metrics {{ args }} {{ }} +proc report_units_metric {{ }} {{ }} +proc report_layer_rc {{ }} {{ }} +proc write_endpoint_slack {{ args }} {{ }} +""" + +ENV = { + "KEEP_VARS": "1", + "GLOBAL_CONNECT_TCL": os.path.join(PLATFORM, "global_connect.tcl"), + "DIE_AREA": "0 0 100 100", + "CORE_AREA": "10 10 90 90", + "PLACE_SITE": "FreePDK45_38x28_10R_NP_162NW_34O", + "MIN_ROUTING_LAYER": "metal2", + "MAX_ROUTING_LAYER": "metal10", + "ROUTING_LAYER_ADJUSTMENT": "0.5", + "DONT_USE_CELLS": "", + "SKIP_REPAIR_TIE_FANOUT": "1", + "SKIP_FLOORPLAN_REPAIR_TIMING": "1", + "WRITE_ODB_AND_SDC_EACH_STAGE": "1", + "OPENROAD_HIERARCHICAL": "0", +} + +# The PRE_FLOORPLAN_TCL hook: the first step after the netlist is loaded +# that could mark an instance dont_touch. +PRE_FLOORPLAN = """\ +[[ord::get_db_block] findInst kept] setDoNotTouch 1 +""" + +# A later step: reads floorplan's result, creates an instance and +# connects it before marking it dont_touch. +LATER = f"""\ +read_lef {{{TECH_LEF}}} +read_lef {{{SC_LEF}}} +read_db 2_1_floorplan.odb +set block [ord::get_db_block] +proc supply {{ name pin }} {{ + set net [[[[ord::get_db_block] findInst $name] findITerm $pin] getNet] + if {{ $net eq "NULL" }} {{ + return none + }} + return [$net getName] +}} +foreach name {{kept free}} {{ + puts "floorplan $name [supply $name VDD] [supply $name VSS]" +}} +set created [odb::dbInst_create $block [[ord::get_db] findMaster INV_X1] created] +global_connect +$created setDoNotTouch 1 +foreach name {{kept created}} {{ + puts "later $name [supply $name VDD] [supply $name VSS]" +}} +""" + + +def openroad(): + return os.environ.get("OPENROAD_EXE") or shutil.which("openroad") + + +def run(script, cwd, env): + result = subprocess.run( + [openroad(), "-no_init", "-no_splash", "-exit", script], + cwd=cwd, + env=env, + capture_output=True, + text=True, + ) + if result.returncode != 0: + raise AssertionError( + f"openroad {script} exited with {result.returncode}\n" + f"{result.stdout}{result.stderr}" + ) + return result.stdout + + +@unittest.skipUnless(openroad(), "no openroad: set OPENROAD_EXE") +class GlobalConnectionsTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.tmp = tempfile.TemporaryDirectory() + cls.addClassCleanup(cls.tmp.cleanup) + cwd = cls.tmp.name + stub = os.path.join(cwd, "scripts") + os.mkdir(stub) + with open(os.path.join(stub, "load.tcl"), "w") as f: + f.write(LOAD) + with open(os.path.join(cwd, "top.v"), "w") as f: + f.write(DESIGN) + with open(os.path.join(cwd, "later.tcl"), "w") as f: + f.write(LATER) + with open(os.path.join(cwd, "pre_floorplan.tcl"), "w") as f: + f.write(PRE_FLOORPLAN) + env = dict( + os.environ, + SCRIPTS_DIR=stub, + PLATFORM_DIR=PLATFORM, + RESULTS_DIR=cwd, + REPORTS_DIR=cwd, + PRE_FLOORPLAN_TCL=os.path.join(cwd, "pre_floorplan.tcl"), + **ENV, + ) + run(os.path.join(SCRIPTS, "floorplan.tcl"), cwd, env) + cls.supply = {} + for line in run("later.tcl", cwd, env).splitlines(): + words = line.split() + if len(words) == 4 and words[0] in ("floorplan", "later"): + cls.supply[(words[0], words[1])] = words[2:] + + def test_supply_pins_are_connected_at_floorplan(self): + self.assertEqual(self.supply[("floorplan", "free")], ["VDD", "VSS"]) + + def test_an_instance_the_pre_floorplan_hook_marks_is_connected(self): + self.assertEqual(self.supply[("floorplan", "kept")], ["VDD", "VSS"]) + self.assertEqual(self.supply[("later", "kept")], ["VDD", "VSS"]) + + def test_rules_stay_in_the_database_for_a_later_step(self): + self.assertEqual(self.supply[("later", "created")], ["VDD", "VSS"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/flow/util/makeIssue.sh b/flow/util/makeIssue.sh index 6941a98071..dce785fe96 100755 --- a/flow/util/makeIssue.sh +++ b/flow/util/makeIssue.sh @@ -34,6 +34,7 @@ ISSUE_CP_PLATFORM_FILE_VARS="LIB_FILES \ POST_FLOORPLAN_TCL \ TAPCELL_TCL \ PDN_CFG \ + GLOBAL_CONNECT_TCL \ PDN_TCL \ POST_PDN_TCL \ POST_CTS_TCL \