Skip to content

Commit 0b6de0d

Browse files
committed
Merge branch 'master' into secure-yosys0.45
Signed-off-by: Eder Monteiro <[email protected]>
2 parents 7e97491 + 74df8de commit 0b6de0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+973
-688
lines changed

build_openroad.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
set -eu
66

77
# Make sure we are on the correct folder before beginning
8-
cd "$(dirname $(readlink -f $0))"
8+
DIR="$(dirname $(readlink -f $0))"
9+
cd "$DIR"
910

1011
# Set up paths to dependencies, such as cmake and boost. Safe no-op
1112
# if tools were set up elsewhere in the path.
@@ -62,13 +63,13 @@ Options:
6263
--yosys-args-overwrite Do not use default flags set by this scrip during
6364
Yosys compilation.
6465
65-
--yosys-args STRING Aditional compilation flags for Yosys compilation.
66+
--yosys-args STRING Additional compilation flags for Yosys compilation.
6667
6768
--openroad-args-overwrite
6869
Do not use default flags set by this scrip during
6970
OpenROAD app compilation.
7071
71-
--openroad-args STRING Aditional compilation flags for OpenROAD app
72+
--openroad-args STRING Additional compilation flags for OpenROAD app
7273
compilation.
7374
7475
--install-path PATH Path to install tools. Default is ${INSTALL_PATH}.
@@ -84,7 +85,7 @@ Options:
8485
Options valid only for Docker builds:
8586
-c, --copy-platforms Copy platforms to inside docker image.
8687
87-
--os=DOCKER_OS_NAME Choose beween ubuntu22.04 (default), ubuntu20.04.
88+
--os=DOCKER_OS_NAME Choose between ubuntu22.04 (default), ubuntu20.04.
8889
8990
This script builds the OpenROAD tools: openroad, yosys and yosys plugins.
9091
By default, the tools will be built from the linked submodule hashes.
@@ -128,14 +129,14 @@ while (( "$#" )); do
128129
DOCKER_COPY_PLATFORMS=1
129130
;;
130131
--yosys-args-overwrite)
131-
YOSYS_OVERWIRTE_ARGS=1
132+
YOSYS_OVERWRITE_ARGS=1
132133
;;
133134
--yosys-args)
134135
YOSYS_USER_ARGS="$2"
135136
shift
136137
;;
137138
--openroad-args-overwrite)
138-
OPENROAD_APP_OVERWIRTE_ARGS=1
139+
OPENROAD_APP_OVERWRITE_ARGS=1
139140
;;
140141
--openroad-args)
141142
OPENROAD_APP_USER_ARGS="$2"
@@ -189,14 +190,14 @@ if [ -n "$CMAKE_INSTALL_RPATH" ]; then
189190
fi
190191

191192
__args_setup() {
192-
if [ ! -z "${YOSYS_OVERWIRTE_ARGS+x}" ]; then
193+
if [ ! -z "${YOSYS_OVERWRITE_ARGS+x}" ]; then
193194
echo "[INFO FLW-0014] Overwriting Yosys compilation flags."
194195
YOSYS_ARGS="${YOSYS_USER_ARGS}"
195196
else
196197
YOSYS_ARGS+=" ${YOSYS_USER_ARGS}"
197198
fi
198199

199-
if [ ! -z "${OPENROAD_APP_OVERWIRTE_ARGS+x}" ]; then
200+
if [ ! -z "${OPENROAD_APP_OVERWRITE_ARGS+x}" ]; then
200201
echo "[INFO FLW-0015] Overwriting OpenROAD app compilation flags."
201202
OPENROAD_APP_ARGS="${OPENROAD_APP_USER_ARGS}"
202203
else
@@ -246,7 +247,7 @@ __local_build()
246247
${NICE} make install -C tools/yosys -j "${PROC}" ${YOSYS_ARGS}
247248

248249
echo "[INFO FLW-0018] Compiling OpenROAD."
249-
eval ${NICE} cmake tools/OpenROAD -B tools/OpenROAD/build ${OPENROAD_APP_ARGS}
250+
eval ${NICE} ./tools/OpenROAD/etc/Build.sh -dir="$DIR/tools/OpenROAD/build" -threads=${PROC} -cmake=\'${OPENROAD_APP_ARGS}\'
250251
${NICE} cmake --build tools/OpenROAD/build --target install -j "${PROC}"
251252
}
252253

docker/Dockerfile.builder

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ COPY --link flow/platforms flow/platforms
3333
COPY --link flow/util flow/util
3434
COPY --link flow/scripts flow/scripts
3535
COPY --link flow/designs flow/designs
36+
COPY --link tools/AutoTuner tools/AutoTuner
3637

3738
COPY --link --from=orfs-builder-base /OpenROAD-flow-scripts/tools/install tools/install
3839
COPY --link \

docs/user/FlowVariables.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Note:
7272
| `PDN_TCL` | ?= | ?= | ?= | ?= | ?= |
7373
| `IO_PLACER_H` | = | = | = | = | ?= |
7474
| `IO_PLACER_V` | = | = | = | = | ?= |
75+
| `FILL_CELLS` | = | = | = | = | = |
7576
| Placement | | | | | |
7677
| `CELL_PAD_IN_SITES_GLOBAL_PLACEMENT` | ?= | ?= | ?= | ?= | ?= |
7778
| `CELL_PAD_IN_SITES_DETAIL_PLACEMENT` | ?= | ?= | ?= | ?= | ?= |
@@ -85,7 +86,6 @@ Note:
8586
| `EQUIVALENCE_CHECK` | ?= | ?= | ?= | ?= | ?= |
8687
| `REMOVE_CELLS_FOR_EQY` | ?= | ?= | ?= | ?= | ?= |
8788
| Routing | | | | | |
88-
| `FILL_CELLS` | = | = | = | = | = |
8989
| `KLAYOUT_TECH_FILE` | = | = | = | = | = |
9090
| `MAX_ROUTING_LAYER` | = | = | = | = | ?= |
9191
| `MIN_ROUTING_LAYER` | = | = | = | = | ?= |
@@ -147,6 +147,8 @@ Note:
147147
| `GUI_NO_TIMING` | Skip loading timing for a faster GUI load. |
148148
| `GUI_SOURCE` | Source the script. |
149149
| `GUI_ARGS` | OpenROAD command line options for gui_ and open_ targets, typically set tup `-exit` in combination with GUI_SOURCE to run a script and exit. |
150+
| `FILL_CELLS` | Fill cells are used to fill empty sites. If not set or empty, fill cell insertion is skipped. |
151+
| `TAP_CELL_NAME` | Name of the cell to use in tap cell insertion. |
150152

151153

152154
### Placement
@@ -189,7 +191,6 @@ Note:
189191

190192
| Variable | Description |
191193
|-----------------------|---------------------------------------------------------------------------------------------------|
192-
| `FILL_CELLS` | Fill cells are used to fill empty sites. |
193194
| `MIN_ROUTING_LAYER` | The lowest metal layer name to be used in routing. |
194195
| `MAX_ROUTING_LAYER` | The highest metal layer name to be used in routing. |
195196
| `DETAILED_ROUTE_ARGS` | Add additional arguments for debugging purpose during detail route. |
@@ -264,16 +265,18 @@ configuration file.
264265

265266
| Variable | Description |
266267
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
267-
| `CORE_UTILIZATION` | The core utilization percentage (0-100). Overrides `DIE_AREA` and `CORE_AREA`. |
268-
| `CORE_ASPECT_RATIO` | The core aspect ratio (height / width). This values is ignored if `CORE_UTILIZATION` undefined. |
269-
| `CORE_MARGIN` | The margin between the core area and die area, in multiples of SITE heights. The margin is applied to each side. This variable is ignored if `CORE_UTILIZATION` is undefined. |
270-
| `DIE_AREA` | The die area specified as a list of lower-left and upper-right corners in microns (X1 Y1 X2 Y2). This variable is ignored if `CORE_UTILIZATION` and `CORE_ASPECT_RATIO` are defined. |
271-
| `CORE_AREA` | The core area specified as a list of lower-left and upper-right corners in microns (X1 Y1 X2 Y2). This variable is ignored if `CORE_UTILIZATION` and `CORE_ASPECT_RATIO` are defined. |
268+
| `CORE_UTILIZATION` | The core utilization percentage (0-100). |
269+
| `CORE_ASPECT_RATIO` | The core aspect ratio (height / width). This values is ignored if `CORE_UTILIZATION` undefined. |
270+
| `CORE_MARGIN` | The margin between the core area and die area, in multiples of SITE heights. The margin is applied to each side. This variable is ignored if `CORE_UTILIZATION` is undefined. |
271+
| `DIE_AREA` | The die area specified as a list of lower-left and upper-right corners in microns (X1 Y1 X2 Y2). |
272+
| `CORE_AREA` | The core area specified as a list of lower-left and upper-right corners in microns (X1 Y1 X2 Y2). |
272273
| `RESYNTH_AREA_RECOVER` | Enable re-synthesis for area reclaim. |
273274
| `RESYNTH_TIMING_RECOVER` | Enable re-synthesis for timing optimization. |
274275
| `MACRO_HALO_X` | Set macro halo for x-direction. Only available for ASAP7 PDK. |
275276
| `MACRO_HALO_Y` | Set macro halo for y-direction. Only available for ASAP7 PDK. |
276277

278+
The various methods to specify the die and core area(`FLOORPLAN_DEF`, `FOOTPRINT`, `DIE_AREA` and `CORE_UTILIZATION`) are mutually exclusive. If two methods are specified, floorplan.tcl will exit with an error requiring that a single method is used.
279+
277280
#### Placement
278281

279282

docs/user/InstructionsForAutoTuner.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ User-defined coefficient values (`coeff_perform`, `coeff_power`, `coeff_area`) o
2323

2424
## Setting up AutoTuner
2525

26-
To setup AutoTuner, make sure you have a virtual environment set up with
27-
Python 3.9.X. There are plenty of ways to do this, we recommend using
28-
[Miniconda](https://docs.conda.io/en/latest/miniconda.html),
29-
which is a free minimal installer for the package manager `conda`.
26+
We have provided two convenience scripts, `./install.sh` and `./setup.sh`
27+
that works in Python3.8 for installation and configuration of AutoTuner,
28+
as shown below:
3029

3130
```shell
32-
# set up conda environment
33-
conda create -n autotuner_env python=3.9
34-
conda activate autotuner_env
31+
# Install prerequisites
32+
./tools/AutoTuner/install.sh
3533

36-
# install requirements
37-
pip install -r ./tools/AutoTuner/requirements.txt
34+
# Start virtual environment
35+
./tools/AutoTuner/setup.sh
3836
```
3937

4038
## Input JSON structure
@@ -198,6 +196,15 @@ We show three different views possible at the end, namely: `Table View`, `Scatte
198196
![Parallel Coordinate View](../images/Autotuner_best_parameter_view.webp)
199197
<p style="text-align: center;">Parallel Coordinate View (best run is in green)</p>
200198

199+
## Testing framework
200+
201+
Assuming the virtual environment is setup at `./tools/AutoTuner/autotuner_env`:
202+
203+
```
204+
./tools/AutoTuner/setup.sh
205+
python3 ./tools/AutoTuner/test/smoke_test_sweep.py
206+
python3 ./tools/AutoTuner/test/smoke_test_tune.py
207+
```
201208

202209
## Citation
203210

etc/DependencyInstaller.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ _installUbuntuPackages() {
126126
zlib1g-dev
127127

128128
# install KLayout
129-
if [[ $1 == "rodete" || $(_versionCompare "$1") -ge 23.04 ]]; then
129+
if [[ $1 == "rodete" ]]; then
130+
apt-get -y install --no-install-recommends klayout python3-pandas
131+
elif _versionCompare "$1" -ge 23.04; then
130132
apt-get -y install --no-install-recommends klayout python3-pandas
131133
else
132134
arch=$(uname -m)
@@ -276,6 +278,7 @@ while [ "$#" -gt 0 ]; do
276278
;;
277279
-ci)
278280
CI="yes"
281+
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -save-deps-prefixes=/etc/openroad_deps_prefixes.txt"
279282
;;
280283
-prefix=*)
281284
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"

flow/Makefile

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
# Default design
105105
DESIGN_CONFIG ?= ./designs/nangate45/gcd/config.mk
106106

107+
# Include design and platform configuration before setting default options
108+
# in this file. This allows the DESIGN_CONFIG to set different defaults than
109+
# this file.
110+
include $(DESIGN_CONFIG)
111+
107112
# For instance Bazel needs artifacts (.odb and .rpt files) on a failure to
108113
# allow the user to save hours on re-running the failed step locally, but
109114
# when working with a Makefile flow, it is more natural to fail the step
@@ -136,6 +141,13 @@ export TNS_END_PERCENT ?=100
136141

137142
# Default routing layer adjustment
138143
export ROUTING_LAYER_ADJUSTMENT ?= 0.5
144+
export RECOVER_POWER ?= 0
145+
export SKIP_INCREMENTAL_REPAIR ?= 0
146+
export DETAILED_METRICS ?= 0
147+
export EQUIVALENCE_CHECK ?= 0
148+
export CORE_UTILIZATION ?=
149+
export DIE_AREA ?=
150+
export CORE_AREA ?=
139151

140152
# If we are running headless use offscreen rendering for save_image
141153
ifndef DISPLAY
@@ -188,10 +200,6 @@ export UTILS_DIR ?= $(FLOW_HOME)/util
188200
export SCRIPTS_DIR ?= $(FLOW_HOME)/scripts
189201
export TEST_DIR ?= $(FLOW_HOME)/test
190202

191-
#-------------------------------------------------------------------------------
192-
# Include design and platform configuration
193-
include $(DESIGN_CONFIG)
194-
195203
PUBLIC=nangate45 sky130hd sky130hs asap7 ihp-sg13g2 gf180
196204

197205
ifneq ($(wildcard $(PLATFORM_HOME)/$(PLATFORM)),)
@@ -254,10 +262,6 @@ export RESULTS_DIR = $(WORK_HOME)/results/$(PLATFORM)/$(DESIGN_NICKNAME)/$(FLOW_
254262
export MACROS ?= $(BLOCKS)
255263

256264
ifdef BLOCKS
257-
ifeq ($(MAKELEVEL),0)
258-
$(info [INFO][FLOW] Invoked hierarchical flow.)
259-
$(foreach block,$(BLOCKS),$(info Block ${block} needs to be hardened.))
260-
endif
261265
$(foreach block,$(BLOCKS),$(eval BLOCK_LEFS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lef))
262266
$(foreach block,$(BLOCKS),$(eval BLOCK_LIBS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lib))
263267
$(foreach block,$(BLOCKS),$(eval BLOCK_GDS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/6_final.gds))
@@ -374,7 +378,7 @@ ifeq ($(wildcard $(3)),)
374378
# each macro.
375379
block := $(patsubst ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/%,%,$(dir $(3)))
376380
$(1) $(2) &:
377-
$$(UNSET_AND_MAKE) DESIGN_NAME=${block} DESIGN_NICKNAME=$$(DESIGN_NICKNAME)_${block} DESIGN_CONFIG=./designs/$$(PLATFORM)/$$(DESIGN_NICKNAME)/block.mk generate_abstract
381+
$$(UNSET_AND_MAKE) DESIGN_NAME=${block} DESIGN_NICKNAME=$$(DESIGN_NICKNAME)_${block} DESIGN_CONFIG=$$(shell dirname $$(DESIGN_CONFIG))/block.mk generate_abstract
378382
else
379383
# There is a unique config.mk for this Verilog module
380384
$(1) $(2) &:
@@ -386,7 +390,7 @@ endef
386390
.PHONY: build_macros
387391
build_macros: $(BLOCK_LEFS) $(BLOCK_LIBS)
388392

389-
$(foreach block,$(BLOCKS),$(eval $(call GENERATE_ABSTRACT_RULE,./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lef,./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lib,./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/${block}/config.mk)))
393+
$(foreach block,$(BLOCKS),$(eval $(call GENERATE_ABSTRACT_RULE,./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lef,./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lib,$(shell dirname $(DESIGN_CONFIG))/${block}/config.mk)))
390394
$(foreach block,$(BLOCKS),$(eval ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/6_final.gds: ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lef))
391395

392396
# Utility to print tool version information
@@ -711,7 +715,11 @@ $(eval $(call do-step,2_4_floorplan_macro,$(RESULTS_DIR)/2_3_floorplan_tdms.odb
711715

712716
# STEP 5: Tapcell and Welltie insertion
713717
#-------------------------------------------------------------------------------
718+
ifeq ($(TAPCELL_TCL),)
719+
$(eval $(call do-copy,2_5_floorplan_tapcell,2_4_floorplan_macro.odb))
720+
else
714721
$(eval $(call do-step,2_5_floorplan_tapcell,$(RESULTS_DIR)/2_4_floorplan_macro.odb $(TAPCELL_TCL),tapcell))
722+
endif
715723

716724
# STEP 6: PDN generation
717725
#-------------------------------------------------------------------------------
@@ -830,6 +838,10 @@ clean_cts:
830838
.PHONY: route
831839
route: $(RESULTS_DIR)/5_route.odb \
832840
$(RESULTS_DIR)/5_route.sdc
841+
842+
.PHONY: grt
843+
grt: $(RESULTS_DIR)/5_1_grt.odb
844+
833845
# ==============================================================================
834846

835847

@@ -839,7 +851,11 @@ $(eval $(call do-step,5_1_grt,$(RESULTS_DIR)/4_cts.odb $(FASTROUTE_TCL) $(PRE_GL
839851

840852
# SEP 2: Filler cell insertion
841853
# ------------------------------------------------------------------------------
854+
ifeq ($(FILL_CELLS),)
855+
$(eval $(call do-copy,5_2_fillcell,5_1_grt.odb))
856+
else
842857
$(eval $(call do-step,5_2_fillcell,$(RESULTS_DIR)/5_1_grt.odb,fillcell))
858+
endif
843859

844860
# STEP 3: Run detailed route
845861
#-------------------------------------------------------------------------------

flow/designs/asap7/gcd/autotuner.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"_SDC_CLK_PERIOD": {
44
"type": "float",
55
"minmax": [
6-
50,
6+
300,
77
1000
88
],
99
"step": 0

flow/designs/gf180/uart-blocks/config.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ export MACRO_PLACE_CHANNEL = 20 20
2121
export PDN_TCL = ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/BLOCKS_grid_strategy.tcl
2222
export PLACE_DENSITY = 0.60
2323

24-
export TAPCELL_TCL = ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/tapcell.tcl
24+
export TAPCELL_TCL ?= ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/tapcell.tcl
2525
export MACRO_HALO_X = 14
2626
export MACRO_HALO_Y = 14

flow/designs/ihp-sg13g2/gcd/autotuner.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"_SDC_CLK_PERIOD": {
44
"type": "float",
55
"minmax": [
6-
1.0,
7-
4.3647
6+
7.0,
7+
12.0
88
],
99
"step": 0
1010
},
@@ -52,23 +52,23 @@
5252
"type": "float",
5353
"minmax": [
5454
0.1,
55-
0.7
55+
0.3
5656
],
5757
"step": 0
5858
},
5959
"PLACE_DENSITY_LB_ADDON": {
6060
"type": "float",
6161
"minmax": [
6262
0.0,
63-
0.99
63+
0.1
6464
],
6565
"step": 0
6666
},
6767
"_PINS_DISTANCE": {
6868
"type": "int",
6969
"minmax": [
7070
1,
71-
4
71+
1
7272
],
7373
"step": 1
7474
},

0 commit comments

Comments
 (0)