Skip to content

Commit 5c9ae13

Browse files
authored
Merge branch 'master' into autotuner_ci_level_4
Signed-off-by: Song Luar <[email protected]>
2 parents 07588cc + 8f75399 commit 5c9ae13

File tree

259 files changed

+13538
-13233
lines changed

Some content is hidden

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

259 files changed

+13538
-13233
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ mainREADME.md
9595
build
9696
.scala-build/
9797
.bsp/
98+
99+
# autotuner artifacts
100+
metadata-base-at.json

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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ COPY --link tools tools
1919
ARG numThreads=$(nproc)
2020
2121
RUN echo "" > tools/yosys/abc/.gitcommit && \
22+
env CFLAGS="-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
23+
CXXFLAGS="-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
2224
./build_openroad.sh --no_init --local --threads ${numThreads}
2325

2426
FROM orfs-base

docker/Dockerfile.dev

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ COPY InstallerOpenROAD.sh \
1313
/tmp/installer/tools/OpenROAD/etc/DependencyInstaller.sh
1414

1515
ARG options=""
16+
ARG constantBuildDir="-constant-build-dir"
1617

17-
RUN ./DependencyInstaller.sh $options \
18+
RUN env CFLAGS="-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
19+
CXXFLAGS="-D__TIME__=0 -D__DATE__=0 -D__TIMESTAMP__=0 -Wno-builtin-macro-redefined" \
20+
./DependencyInstaller.sh $options $constantBuildDir \
1821
&& rm -rf /tmp/installer /tmp/* /var/tmp/* /var/lib/apt/lists/*
1922

2023
ARG fromImage

docs/user/FlowVariables.md

Lines changed: 275 additions & 265 deletions
Large diffs are not rendered by default.

docs/user/InstructionsForAutoTuner.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ We have provided two convenience scripts, `./install.sh` and `./setup.sh`
2727
that works in Python3.8 for installation and configuration of AutoTuner,
2828
as shown below:
2929

30+
```{note}
31+
Make sure you run the following commands in `./tools/AutoTuner/src/autotuner`.
32+
```
33+
3034
```shell
3135
# Install prerequisites
3236
./tools/AutoTuner/install.sh
@@ -127,8 +131,8 @@ Example:
127131

128132
```shell
129133
python3 distributed.py --design gcd --platform sky130hd \
130-
--config ../designs/sky130hd/gcd/autotuner.json \
131-
tune
134+
--config ../../../../flow/designs/sky130hd/gcd/autotuner.json \
135+
tune --samples 5
132136
```
133137
#### Sweep only
134138

etc/DependencyInstaller.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@ _installCommon() {
3636
pip3 install --no-cache-dir --user -U $pkgs
3737
fi
3838

39-
baseDir=$(mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
39+
if [[ "$constantBuildDir" == "true" ]]; then
40+
baseDir="/tmp/DependencyInstaller-ORFS"
41+
if [[ -d "$baseDir" ]]; then
42+
echo "[INFO] Removing old building directory $baseDir"
43+
fi
44+
mkdir -p "$baseDir"
45+
else
46+
baseDir=$(mktemp -d /tmp/DependencyInstaller-orfs-XXXXXX)
47+
fi
4048

4149
# Install Verilator
4250
verilatorPrefix=`realpath ${PREFIX:-"/usr/local"}`
@@ -239,6 +247,9 @@ Usage: $0
239247
# sudo or with root access.
240248
$0 -ci
241249
# Installs CI tools
250+
$0 -constant-build-dir
251+
# Use constant build directory, instead of
252+
# random one.
242253
EOF
243254
exit "${1:-1}"
244255
}
@@ -251,6 +262,7 @@ PREFIX=""
251262
option="all"
252263
# default isLocal
253264
isLocal="false"
265+
constantBuildDir="false"
254266
CI="no"
255267

256268
# default values, can be overwritten by cmdline args
@@ -278,11 +290,16 @@ while [ "$#" -gt 0 ]; do
278290
;;
279291
-ci)
280292
CI="yes"
293+
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} -save-deps-prefixes=/etc/openroad_deps_prefixes.txt"
281294
;;
282295
-prefix=*)
283296
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
284297
PREFIX=${1#*=}
285298
;;
299+
-constant-build-dir)
300+
OR_INSTALLER_ARGS="${OR_INSTALLER_ARGS} $1"
301+
constantBuildDir="true"
302+
;;
286303
*)
287304
echo "unknown option: ${1}" >&2
288305
_help

etc/DockerHelper.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ baseDir="$(pwd)"
99
org=openroad
1010

1111
DOCKER_CMD="docker"
12+
noConstantBuildDir=""
1213

1314
_help() {
1415
cat <<EOF
@@ -32,6 +33,7 @@ usage: $0 [CMD] [OPTIONS]
3233
-password=PASSWORD Password to loging at the docker registry.
3334
-ci Install CI tools in image
3435
-dry-run Do not push images to the repository
36+
-no-constant-build-dir Do not use constant build directory
3537
-h -help Show this message and exits
3638
3739
EOF
@@ -67,7 +69,7 @@ _setup() {
6769
fromImage="${FROM_IMAGE_OVERRIDE:-$osBaseImage}"
6870
cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh
6971
context="etc"
70-
buildArgs="--build-arg options=${options}"
72+
buildArgs="--build-arg options=${options} ${noConstantBuildDir}"
7173
;;
7274
*)
7375
echo "Target ${target} not found" >&2
@@ -202,6 +204,9 @@ while [ "$#" -gt 0 ]; do
202204
-tag=* )
203205
tag="${1#*=}"
204206
;;
207+
-no-constant-build-dir )
208+
noConstantBuildDir="--build-arg constantBuildDir= "
209+
;;
205210
-os | -target | -threads | -username | -password | -tag )
206211
echo "${1} requires an argument" >&2
207212
_help

0 commit comments

Comments
 (0)