Skip to content

Commit ace2e64

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents df13635 + 636e3d5 commit ace2e64

File tree

21 files changed

+501
-279
lines changed

21 files changed

+501
-279
lines changed

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/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: 3 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)

flow/Makefile

Lines changed: 7 additions & 5 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
@@ -139,6 +144,7 @@ export ROUTING_LAYER_ADJUSTMENT ?= 0.5
139144
export RECOVER_POWER ?= 0
140145
export SKIP_INCREMENTAL_REPAIR ?= 0
141146
export DETAILED_METRICS ?= 0
147+
export EQUIVALENCE_CHECK ?= 0
142148

143149
# If we are running headless use offscreen rendering for save_image
144150
ifndef DISPLAY
@@ -191,10 +197,6 @@ export UTILS_DIR ?= $(FLOW_HOME)/util
191197
export SCRIPTS_DIR ?= $(FLOW_HOME)/scripts
192198
export TEST_DIR ?= $(FLOW_HOME)/test
193199

194-
#-------------------------------------------------------------------------------
195-
# Include design and platform configuration
196-
include $(DESIGN_CONFIG)
197-
198200
PUBLIC=nangate45 sky130hd sky130hs asap7 ihp-sg13g2 gf180
199201

200202
ifneq ($(wildcard $(PLATFORM_HOME)/$(PLATFORM)),)
@@ -373,7 +375,7 @@ ifeq ($(wildcard $(3)),)
373375
# each macro.
374376
block := $(patsubst ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/%,%,$(dir $(3)))
375377
$(1) $(2) &:
376-
$$(UNSET_AND_MAKE) DESIGN_NAME=${block} DESIGN_NICKNAME=$$(DESIGN_NICKNAME)_${block} DESIGN_CONFIG=./designs/$$(PLATFORM)/$$(DESIGN_NICKNAME)/block.mk generate_abstract
378+
$$(UNSET_AND_MAKE) DESIGN_NAME=${block} DESIGN_NICKNAME=$$(DESIGN_NICKNAME)_${block} DESIGN_CONFIG=$$(shell dirname $$(DESIGN_CONFIG))/block.mk generate_abstract
377379
else
378380
# There is a unique config.mk for this Verilog module
379381
$(1) $(2) &:

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/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
},

flow/designs/sky130hd/gcd/autotuner.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,4 @@
9999
"step": 0
100100
}
101101
}
102+

flow/scripts/cts.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ if {[info exist ::env(CTS_SNAPSHOTS)]} {
7272
}
7373

7474
if {[info exists ::env(SKIP_CTS_REPAIR_TIMING)] == 0 || $::env(SKIP_CTS_REPAIR_TIMING) == 0} {
75-
if {[info exists ::env(EQUIVALENCE_CHECK)] && $::env(EQUIVALENCE_CHECK) == 1} {
75+
if {$::env(EQUIVALENCE_CHECK)} {
7676
write_eqy_verilog 4_before_rsz.v
7777
}
7878

7979
repair_timing_helper
8080

81-
if {[info exists ::env(EQUIVALENCE_CHECK)] && $::env(EQUIVALENCE_CHECK) == 1} {
81+
if {$::env(EQUIVALENCE_CHECK)} {
8282
run_equivalence_test
8383
}
8484

flow/test/test_helper.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,39 @@ if [ $ret -eq 0 ] && grep -q 'power:' <(echo $TARGETS); then
7777
ret=$(( ret + $? ))
7878
fi
7979

80+
# Run Autotuner CI specifically for gcd on selected platforms.
81+
RUN_AUTOTUNER=0
82+
case $DESIGN_NAME in
83+
"gcd")
84+
RUN_AUTOTUNER=1
85+
;;
86+
esac
87+
case $PLATFORM in
88+
"asap7" | "sky130hd" | "ihp-sg13g2" )
89+
# Keep RUN_AUTOTUNER enabled only for these platforms
90+
;;
91+
*)
92+
RUN_AUTOTUNER=0
93+
;;
94+
esac
95+
96+
if [ $RUN_AUTOTUNER -eq 1 ]; then
97+
# change directory to the root of the repo
98+
echo "Install and starting venv"
99+
cd ../
100+
./tools/AutoTuner/installer.sh
101+
. ./tools/AutoTuner/setup.sh
102+
103+
# remove dashes
104+
PLATFORM=${PLATFORM//-/}
105+
# convert to uppercase
106+
PLATFORM=${PLATFORM^^}
107+
108+
echo "Running Autotuner smoke tune test"
109+
python3 -m unittest tools.AutoTuner.test.smoke_test_tune.${PLATFORM}TuneSmokeTest.test_tune
110+
111+
echo "Running Autotuner smoke sweep test"
112+
python3 -m unittest tools.AutoTuner.test.smoke_test_sweep.${PLATFORM}SweepSmokeTest.test_sweep
113+
fi
114+
80115
exit $ret

flow/util/genReport.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ def write_summary():
246246

247247
for log_dir, dirs, files in sorted(os.walk(LOGS_FOLDER, topdown=False)):
248248
dir_list = log_dir.split(os.sep)
249-
if len(dir_list) != 4:
249+
# Handles autotuner folders, which do not have `report.log` natively.
250+
# TODO: Can we log something for autotuner?
251+
if len(dir_list) != 4 or "test-" in dir_list[-1]:
250252
continue
251253
report_dir = log_dir.replace(LOGS_FOLDER, REPORTS_FOLDER)
252254

0 commit comments

Comments
 (0)