From e5a7a0976918035d1a4312ac9965148f215aa4ed Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Wed, 22 Mar 2023 15:29:01 +0200 Subject: [PATCH] Rework Placement (#1684) + Add warning when attempting to run Sylvain's script without `DPL_CELL_PADDING` >= 0 + Add warning when DPL_CELL_PADDING is set to greater than GPL_CELL_PADDING ~ Update PDK, changing the default values of GPL/DPL cell padding to `0` ~ **Use $HOME/.volare as the default PDK location** ~ `PL_TARGET_DENSITY` incorporates value of `GPL_CELL_PADDING` in calculation ~ Updated various config files to handle new default padding options ~ CI bugfixes + support for Volare 0.7.1 --- .github/workflows/openlane_ci.yml | 23 ++++++++++----- Makefile | 2 +- dependencies/tool_metadata.yml | 2 +- designs/APU/config.json | 11 +++---- designs/PPU/config.json | 9 ++---- designs/aes_core/config.json | 2 ++ .../manual_macro_placement_test/config.json | 1 + designs/picorv32a/config.json | 8 ++--- designs/salsa20/config.json | 8 ++--- designs/usb/config.json | 5 ++-- designs/usb_cdc_core/config.json | 4 ++- designs/wbqspiflash/config.json | 7 ++--- designs/y_huff/config.json | 29 +++++-------------- designs/zipdiv/config.json | 4 ++- docs/source/for_developers/pdk_structure.md | 4 +-- docs/source/index.rst | 2 +- docs/source/reference/configuration.md | 2 +- .../source/reference/datapoint_definitions.md | 2 +- scripts/tcl_commands/all.tcl | 4 ++- scripts/tcl_commands/placement.tcl | 4 +++ scripts/tcl_commands/routing.tcl | 3 ++ 21 files changed, 68 insertions(+), 68 deletions(-) diff --git a/.github/workflows/openlane_ci.yml b/.github/workflows/openlane_ci.yml index 89a5cdcb..0945222c 100644 --- a/.github/workflows/openlane_ci.yml +++ b/.github/workflows/openlane_ci.yml @@ -24,16 +24,24 @@ jobs: - name: Set up environment variables uses: ./.github/actions/set_env_variables + - name: Get Volare Build/Push Dependencies + run: | + # Magic Build Dependencies + sudo apt-get install -y tcsh tcl-dev tk-dev libcairo2-dev m4 + # GHR (Pushing) + go get -u github.com/tcnksm/ghr + - name: Build (or Get) PDK run: | + export PATH=$PATH:$(go env GOPATH)/bin + export OPDKS_VER="$(python3 ./dependencies/tool.py open_pdks -f commit)" PDK=${{ matrix.pdk }} PDK_FAMILY=${PDK%?} + sudo mkdir -p ${{ env.PDK_ROOT }} sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} - go get -u github.com/tcnksm/ghr - export PATH=$PATH:$(go env GOPATH)/bin + python3 -m pip install --upgrade --no-cache-dir volare - export OPDKS_VER="$(python3 ./dependencies/tool.py open_pdks -f commit)" if [ "${{ secrets.VOLARE_REPO }}" != "" ]; then volare enable_or_build\ --pdk $PDK_FAMILY\ @@ -60,11 +68,6 @@ jobs: with: name: pdk-tarball-${{ matrix.pdk }} path: /tmp/${{ matrix.pdk }}.tar - - - name: Determine If Running Extended Test Set - run: | - export EVENT_NAME=${{ github.event_name }}; - python3 ./.github/scripts/determine_test_set.py prepare_test_matrices: name: Prepare Test Matrices runs-on: ubuntu-20.04 @@ -78,6 +81,10 @@ jobs: - name: Python Dependencies run: | python3 -m pip install click pyyaml + - name: Determine If Running Extended Test Set + run: | + export EVENT_NAME=${{ github.event_name }}; + python3 ./.github/scripts/determine_test_set.py - name: Set Matrix id: set-matrix run: | diff --git a/Makefile b/Makefile index d2397f5e..d1e79b2f 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ PRINT_REM_DESIGNS_TIME ?= 0 SKYWATER_COMMIT ?= $(shell $(PYTHON_BIN) ./dependencies/tool.py sky130 -f commit) OPEN_PDKS_COMMIT ?= $(shell $(PYTHON_BIN) ./dependencies/tool.py open_pdks -f commit) -export PDK_ROOT ?= ./pdks +export PDK_ROOT ?= $(HOME)/.volare export PDK_ROOT := $(shell $(PYTHON_BIN) -c "import os; print(os.path.realpath('$(PDK_ROOT)'), end='')") PDK_OPTS = -v $(PDK_ROOT):$(PDK_ROOT) -e PDK_ROOT=$(PDK_ROOT) diff --git a/dependencies/tool_metadata.yml b/dependencies/tool_metadata.yml index e1508add..e0f03781 100644 --- a/dependencies/tool_metadata.yml +++ b/dependencies/tool_metadata.yml @@ -65,6 +65,6 @@ in_install: false - name: open_pdks repo: https://github.com/RTimothyEdwards/open_pdks - commit: e6f9c8876da77220403014b116761b0b2d79aab4 + commit: 12df12e2e74145e31c5a13de02f9a1e176b56e67 in_install: false pdk: true diff --git a/designs/APU/config.json b/designs/APU/config.json index 697f8753..a086db30 100644 --- a/designs/APU/config.json +++ b/designs/APU/config.json @@ -5,15 +5,16 @@ "CLOCK_NET": "clk", "FP_CORE_UTIL": 35, "CLOCK_PERIOD": 17, + "pdk::sky130*": { + "SYNTH_MAX_FANOUT": 6 + }, "pdk::gf180mcu*": { - "DIODE_INSERTION_STRATEGY": "4", + "DIODE_INSERTION_STRATEGY": 4, + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, "PL_RESIZER_HOLD_SLACK_MARGIN": 0.25, "FP_CORE_UTIL": 25, "PL_RESIZER_HOLD_MAX_BUFFER_PERCENT": 60, - "PL_TARGET_DENSITY": 0.31, "CLOCK_PERIOD": 75 - }, - "pdk::sky130*": { - "SYNTH_MAX_FANOUT": 6 } } \ No newline at end of file diff --git a/designs/PPU/config.json b/designs/PPU/config.json index 6e2a5775..ebba7c0c 100644 --- a/designs/PPU/config.json +++ b/designs/PPU/config.json @@ -3,18 +3,15 @@ "VERILOG_FILES": "dir::src/PPU.v", "CLOCK_PORT": "clk", "CLOCK_NET": "clk", + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, + "FP_CORE_UTIL": 20, "pdk::gf180mcu*": { - "FP_CORE_UTIL": 40, "SYNTH_MAX_FANOUT": 8, "CLOCK_PERIOD": 18.0 }, "pdk::sky130*": { "SYNTH_MAX_FANOUT": 8, - "FP_CORE_UTIL": 20, - "PL_TARGET_DENSITY": 0.25, "CLOCK_PERIOD": 18.0 - }, - "pdk::gf180mcu*": { - "PL_TARGET_DENSITY": 0.48 } } \ No newline at end of file diff --git a/designs/aes_core/config.json b/designs/aes_core/config.json index 196525bf..19991f56 100644 --- a/designs/aes_core/config.json +++ b/designs/aes_core/config.json @@ -4,6 +4,8 @@ "CLOCK_PORT": "clk", "CLOCK_NET": "clk", "DIODE_INSERTION_STRATEGY": 4, + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, "GLB_RESIZER_HOLD_MAX_BUFFER_PERCENT": 60, "pdk::sky130*": { "SYNTH_MAX_FANOUT": 6, diff --git a/designs/manual_macro_placement_test/config.json b/designs/manual_macro_placement_test/config.json index 1d802109..cf2c45f2 100644 --- a/designs/manual_macro_placement_test/config.json +++ b/designs/manual_macro_placement_test/config.json @@ -10,6 +10,7 @@ "BASE_SDC_FILE": "dir::base.sdc", "PL_TARGET_DENSITY": 0.35, "PL_BASIC_PLACEMENT": 1, + "GPL_CELL_PADDING": 0, "DPL_CELL_PADDING": 0, "CLOCK_PERIOD": 100, "CLOCK_PORT": "clk1 clk2", diff --git a/designs/picorv32a/config.json b/designs/picorv32a/config.json index 77d18242..fd41d298 100644 --- a/designs/picorv32a/config.json +++ b/designs/picorv32a/config.json @@ -4,16 +4,14 @@ "CLOCK_PORT": "clk", "CLOCK_NET": "clk", "GLB_RESIZER_TIMING_OPTIMIZATIONS": true, + "GPL_CELL_PADDING": 2, + "DPL_CELL_PADDING": 2, "CLOCK_PERIOD": 24, + "FP_CORE_UTIL": 35, "pdk::sky130*": { "SYNTH_MAX_FANOUT": 6, - "FP_CORE_UTIL": 35, "scl::sky130_fd_sc_ms": { "FP_CORE_UTIL": 30 } - }, - "pdk::gf180mcu*": { - "DIODE_PADDING": 0, - "PL_TARGET_DENSITY": 0.62 } } \ No newline at end of file diff --git a/designs/salsa20/config.json b/designs/salsa20/config.json index ef19cdc1..6a6308cb 100644 --- a/designs/salsa20/config.json +++ b/designs/salsa20/config.json @@ -4,17 +4,15 @@ "CLOCK_PORT": "clk", "CLOCK_NET": "clk", "GLB_RESIZER_TIMING_OPTIMIZATIONS": true, + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, + "FP_CORE_UTIL": 20, "pdk::sky130*": { - "FP_CORE_UTIL": 20, "SYNTH_MAX_FANOUT": 6, "CLOCK_PERIOD": 36.73, "scl::sky130_fd_sc_hd": { "CLOCK_PERIOD": 38, "PL_RESIZER_HOLD_SLACK_MARGIN": 0.25 } - }, - "pdk::gf180mcu*": { - "DIODE_PADDING": 0, - "PL_TARGET_DENSITY": 0.62 } } \ No newline at end of file diff --git a/designs/usb/config.json b/designs/usb/config.json index f5ba5f73..2235aa73 100644 --- a/designs/usb/config.json +++ b/designs/usb/config.json @@ -14,7 +14,8 @@ }, "pdk::gf180mcu*": { "CLOCK_PERIOD": 15, - "PL_TARGET_DENSITY": 0.5, - "DIODE_INSERTION_STRATEGY": "4" + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, + "DIODE_INSERTION_STRATEGY": 3 } } \ No newline at end of file diff --git a/designs/usb_cdc_core/config.json b/designs/usb_cdc_core/config.json index d246db38..bb92a111 100644 --- a/designs/usb_cdc_core/config.json +++ b/designs/usb_cdc_core/config.json @@ -13,7 +13,9 @@ } }, "pdk::gf180mcu*": { - "DIODE_INSERTION_STRATEGY": "6", + "DIODE_INSERTION_STRATEGY": 6, + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, "PL_TARGET_DENSITY": 0.62 } } \ No newline at end of file diff --git a/designs/wbqspiflash/config.json b/designs/wbqspiflash/config.json index 4ac271a6..071324f3 100644 --- a/designs/wbqspiflash/config.json +++ b/designs/wbqspiflash/config.json @@ -4,6 +4,8 @@ "CLOCK_PORT": "i_clk", "CLOCK_NET": "i_clk", "DIODE_INSERTION_STRATEGY": 6, + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, "pdk::sky130*": { "CLOCK_PERIOD": 18.86, "SYNTH_MAX_FANOUT": 6, @@ -25,10 +27,5 @@ "scl::sky130_fd_sc_ms": { "FP_CORE_UTIL": 30 } - }, - "pdk::gf180mcu*": { - "DIODE_PADDING": 0, - "PL_TARGET_DENSITY": 0.62, - "DIODE_INSERTION_STRATEGY": 3 } } \ No newline at end of file diff --git a/designs/y_huff/config.json b/designs/y_huff/config.json index f402eef1..5e818682 100644 --- a/designs/y_huff/config.json +++ b/designs/y_huff/config.json @@ -3,31 +3,16 @@ "VERILOG_FILES": "dir::src/y_huff.v", "CLOCK_PORT": "clk", "CLOCK_NET": "clk", - "FP_SIZING": "absolute", - "DIE_AREA": "0 0 700 700", + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, + "FP_CORE_UTIL": 25, "pdk::sky130*": { + "FP_SIZING": "absolute", + "DIE_AREA": "0 0 700 700", "CLOCK_PERIOD": 11.35, - "SYNTH_MAX_FANOUT": 6, - "scl::sky130_fd_sc_hd": { - "FP_CORE_UTIL": 40 - }, - "scl::sky130_fd_sc_hdll": { - "FP_CORE_UTIL": 40 - }, - "scl::sky130_fd_sc_hs": { - "FP_CORE_UTIL": 30 - }, - "scl::sky130_fd_sc_ls": { - "FP_CORE_UTIL": 35 - }, - "scl::sky130_fd_sc_ms": { - "FP_CORE_UTIL": 30 - } + "SYNTH_MAX_FANOUT": 6 }, "pdk::gf180mcu*": { - "FP_SIZING": "relative", - "DIODE_PADDING": 0, - "FP_CORE_UTIL": 40, - "PL_TARGET_DENSITY": 0.62 + "DIODE_INSERTION_STRATEGY": 3 } } \ No newline at end of file diff --git a/designs/zipdiv/config.json b/designs/zipdiv/config.json index 6eb2fa91..b9a573e1 100644 --- a/designs/zipdiv/config.json +++ b/designs/zipdiv/config.json @@ -18,7 +18,9 @@ } }, "pdk::gf180mcu*": { - "DIODE_INSERTION_STRATEGY": "6", + "DIODE_INSERTION_STRATEGY": 6, + "GPL_CELL_PADDING": 4, + "DPL_CELL_PADDING": 4, "PL_TARGET_DENSITY": 0.62 } } \ No newline at end of file diff --git a/docs/source/for_developers/pdk_structure.md b/docs/source/for_developers/pdk_structure.md index 7bb70e01..920646ce 100644 --- a/docs/source/for_developers/pdk_structure.md +++ b/docs/source/for_developers/pdk_structure.md @@ -97,8 +97,8 @@ This section defines the necessary variables to configure a standard cell librar | `SYNTH_TIELO_PORT` | Defines the tie low cell followed by the port that implements the tie high functionality. Used in synthesis.
(Example: `sky130_fd_sc_hd__conb_1 LO`)| | `FILL_CELL` | Defines the fill cell. Used in fill insertion. Can use a wild card to define a class of cells. Example `sky130_fd_sc_hd__fill_*` | | `DECAP_CELL` | Defines the decap cell used for fill insertion. Can use a wild card to define a class of cells. Example `sky130_fd_sc_hd__fill_*` | -| `GPL_CELL_PADDING` | Cell padding value (in sites) for global placement. Using this is not strictly recommended as you can simply use the density control for global placement.
(Example: `0`) | -| `DPL_CELL_PADDING` | Defines the number of sites to pad the cells lef views with during detailed placement . The number will be integer divided by 2 and placed on both sides.
(Example: `4`) | +| `GPL_CELL_PADDING` | Cell padding value (in sites) for global placement.
(Example: `2`) | +| `DPL_CELL_PADDING` | Defines the number of sites to pad the cells with during detailed placement. This value should not be higher than `GPL_CELL_PADDING` unless you know what you're doing.
(Example: `2`) | | `CELL_PAD_EXCLUDE` | Defines the cells to exclude from padding for both detailed placement. | | `CTS_ROOT_BUFFER` | Defines the cell inserted at the root of the clock tree. Used in CTS. | | `CTS_CLK_BUFFER_LIST` | Defines the list of clock buffers to be used in CTS. | diff --git a/docs/source/index.rst b/docs/source/index.rst index 38beb5cd..2d66e0b0 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,7 +2,7 @@ The OpenLane Documentation ========================== OpenLane is an automated RTL to GDSII flow based on several components including OpenROAD, Yosys, Magic, Netgen, CVC, SPEF-Extractor, KLayout and a number of custom scripts for design exploration and optimization. It also provides a number of custom scripts for design exploration and optimization. -The flow performs all ASIC implementation steps from RTL all the way down to GDSII. Currently, it supports both A and B variants of the sky130 PDK, but support for the newly released GF180MCU PDK is in the works, and instructions to add support for other (including proprietary) PDKs are documented. +The flow performs all ASIC implementation steps from RTL all the way down to GDSII. Currently, it supports both A and B variants of the sky130 PDK, the C variant of the gf180mcu PDK, and instructions to add support for other (including proprietary) PDKs are documented. OpenLane abstracts the underlying open source utilities, and allows users to configure all their behavior with just a single configuration file. diff --git a/docs/source/reference/configuration.md b/docs/source/reference/configuration.md index 5666f707..356d8f76 100644 --- a/docs/source/reference/configuration.md +++ b/docs/source/reference/configuration.md @@ -145,7 +145,7 @@ These variables worked initially, but they were too sky130 specific and will be |Variable|Description| |-|-| -| `PL_TARGET_DENSITY` | The desired placement density of cells. It reflects how spread the cells would be on the core area. 1 = closely dense. 0 = widely spread
(Default: `($::env(FP_CORE_UTIL) +5 ) / 100.0`)| +| `PL_TARGET_DENSITY` | The desired placement density of cells. It reflects how spread the cells would be on the core area. 1 = closely dense. 0 = widely spread
(Default: `($::env(FP_CORE_UTIL) + 10 + (5 * $::env(GPL_CELL_PADDING)) ) / 100.0`)| | `PL_TIME_DRIVEN` | Specifies whether the placer should use time driven placement. 0 = false, 1 = true
(Default: `1`)| | `PL_BASIC_PLACEMENT` | Specifies whether the placer should run basic placement. Basic placement is used for extremely simple, low-density designs of only a few dozens of gates, and should be disabled for most designs. 0 = false, 1 = true
(Default: `0`) | | `PL_SKIP_INITIAL_PLACEMENT` | Specifies whether the placer should run initial placement or not. 0 = false, 1 = true
(Default: `0`) | diff --git a/docs/source/reference/datapoint_definitions.md b/docs/source/reference/datapoint_definitions.md index cd548dd4..6af3ac6f 100644 --- a/docs/source/reference/datapoint_definitions.md +++ b/docs/source/reference/datapoint_definitions.md @@ -94,7 +94,7 @@ | `FP_ASPECT_RATIO` | The core's aspect ratio (height / width).
(Default: `1`)| | `FP_PDN_VPITCH` | The pitch of the vertical power stripes on the metal layer 4 in the power distribution network
(Default: `153.6`) | | `FP_PDN_HPITCH` | The pitch of the horizontal power stripes on the metal layer 5 in the power distribution network
(Default: `153.18`) | -| `PL_TARGET_DENSITY` | The desired placement density of cells. It reflects how spread the cells would be on the core area. 1 = closely dense. 0 = widely spread
(Default: `0.55`)| +| `PL_TARGET_DENSITY` | The desired placement density of cells. It reflects how spread the cells would be on the core area. 1 = closely dense. 0 = widely spread
(Default: `($::env(FP_CORE_UTIL) + 10 + (5 * $::env(GPL_CELL_PADDING)) ) / 100.0`) | | `GRT_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph. Values range from 0 to 1.
1 = most reduction, 0 = least reduction
(Default: `0.2`)| | `STD_CELL_LIBRARY` | Specifies the standard cell library used.
(Default: `sky130_fd_sc_hd`) | diff --git a/scripts/tcl_commands/all.tcl b/scripts/tcl_commands/all.tcl index 2e7324c7..01705412 100755 --- a/scripts/tcl_commands/all.tcl +++ b/scripts/tcl_commands/all.tcl @@ -280,6 +280,8 @@ proc merge_lib {args} { parse_key_args "merge_lib" args arg_values $options flags_map $flags + puts_verbose "Merging liberty files \{{*}$arg_values(-inputs)\} into \{$arg_values(-output)\}..." + set_if_unset arg_values(-name) "$::env(PDK)_merged" try_exec python3 $::env(SCRIPTS_DIR)/mergeLib.py\ @@ -712,7 +714,7 @@ proc prep {args} { } if { ![info exists ::env(PL_TARGET_DENSITY)] } { - set ::env(PL_TARGET_DENSITY) [expr ($::env(FP_CORE_UTIL) + 5.0) / 100.0] + set ::env(PL_TARGET_DENSITY) [expr ($::env(FP_CORE_UTIL) + 10.0 + (5 * $::env(GPL_CELL_PADDING))) / 100.0] } set util $::env(FP_CORE_UTIL) diff --git a/scripts/tcl_commands/placement.tcl b/scripts/tcl_commands/placement.tcl index a82721e6..01251485 100755 --- a/scripts/tcl_commands/placement.tcl +++ b/scripts/tcl_commands/placement.tcl @@ -166,6 +166,10 @@ proc run_placement {args} { set ::env(PL_TARGET_DENSITY) $::env(PL_TARGET_DENSITY_CELLS) } + if { $::env(DPL_CELL_PADDING) > $::env(GPL_CELL_PADDING) } { + puts_warn "DPL_CELL_PADDING is set higher than GPL_CELL_PADDING ($::env(DPL_CELL_PADDING) > $::env(GPL_CELL_PADDING)). This may result in inconsistent behavior." + } + if { $::env(PL_RANDOM_GLB_PLACEMENT) } { # useful for very tiny designs random_global_placement diff --git a/scripts/tcl_commands/routing.tcl b/scripts/tcl_commands/routing.tcl index cb3cd861..05ee51d6 100755 --- a/scripts/tcl_commands/routing.tcl +++ b/scripts/tcl_commands/routing.tcl @@ -231,6 +231,9 @@ proc ins_diode_cells_1 {args} { } proc ins_diode_cells_4 {args} { + if { $::env(DPL_CELL_PADDING) == 0 } { + puts_warn "DPL_CELL_PADDING is set to 0. Diode insertion strategies 4, 5 and 6 may not function properly." + } increment_index TIMER::timer_start set log [index_file $::env(routing_logs)/diodes.log]