@@ -29,9 +29,11 @@ OPENROAD_APP_ARGS=""
2929DOCKER_OS_NAME=" ubuntu22.04"
3030PROC=-1
3131
32- VERIFIC_COMPONENTS=' database util containers pct hier_tree verilog'
3332WITH_VERIFIC=0
34- VERIFIC_DIR=" "
33+ VERIFIC_SRC=" "
34+ VERIFIC_COMPONENTS=' database util containers pct hier_tree verilog'
35+ VERIFIC_ARGS=" VERIFIC_COMPONENTS='${VERIFIC_COMPONENTS} '"
36+ VERIFIC_ARGS+=" ENABLE_VERIFIC=1 ENABLE_VERIFIC_VHDL=0 VERIFIC_DIR=verific"
3537
3638function usage() {
3739 cat << EOF
@@ -145,20 +147,17 @@ while (( "$#" )); do
145147 YOSYS_OVERWRITE_ARGS=1
146148 ;;
147149 --yosys-args)
148- YOSYS_USER_ARGS=" $2 "
150+ YOSYS_USER_ARGS+ =" $2 "
149151 shift
150152 ;;
151153 --with-verific)
152- YOSYS_USER_ARGS+=" ENABLE_VERIFIC=1"
153- YOSYS_USER_ARGS+=" ENABLE_VERIFIC_VHDL=0"
154- YOSYS_USER_ARGS+=" VERIFIC_COMPONENTS='${VERIFIC_COMPONENTS} '"
155- VERIFIC_DIR=${2}
156- if [ ! -d " ${VERIFIC_DIR} " ]; then
157- echo " [ERROR] Verific path '${VERIFIC_DIR} ' does not exist." >&2
154+ WITH_VERIFIC=1
155+ VERIFIC_SRC=${2}
156+ if [ ! -d " ${VERIFIC_SRC} " ]; then
157+ echo " [ERROR] Verific path '${VERIFIC_SRC} ' does not exist." >&2
158158 exit 1
159159 fi
160- YOSYS_USER_ARGS+=" VERIFIC_DIR=${VERIFIC_DIR} "
161- WITH_VERIFIC=1
160+ YOSYS_USER_ARGS+=" ${VERIFIC_ARGS} "
162161 shift
163162 ;;
164163 --openroad-args-overwrite)
@@ -238,8 +237,14 @@ __docker_build()
238237 cp .dockerignore{,.bak}
239238 sed -i ' /flow\/platforms/d' .dockerignore
240239 fi
240+ options=" "
241+ if [ -n " ${WITH_VERIFIC} " ]; then
242+ cp -r " ${VERIFIC_SRC} " tools/verific
243+ options=" -buildArgs=--build-arg verificPath=tools/verific"
244+ fi
241245 ./etc/DockerHelper.sh create -target=dev -os=" ${DOCKER_OS_NAME} " -threads=" ${PROC} "
242- ./etc/DockerHelper.sh create -target=builder -os=" ${DOCKER_OS_NAME} " -threads=" ${PROC} "
246+ ./etc/DockerHelper.sh create -target=builder -os=" ${DOCKER_OS_NAME} " -threads=" ${PROC} " " ${options} "
247+ rm -rf tools/verific
243248 if [ ! -z " ${DOCKER_COPY_PLATFORMS+x} " ]; then
244249 mv .dockerignore{.bak,}
245250 fi
@@ -248,56 +253,56 @@ __docker_build()
248253__local_build ()
249254{
250255 if [[ " $OSTYPE " == " darwin" * ]]; then
251- export PATH=" $( brew --prefix bison) /bin:$( brew --prefix flex) /bin:$( brew --prefix tcl-tk) /bin:$PATH "
252- export CMAKE_PREFIX_PATH=$( brew --prefix or-tools)
256+ export PATH=" $( brew --prefix bison) /bin:$( brew --prefix flex) /bin:$( brew --prefix tcl-tk) /bin:$PATH "
257+ export CMAKE_PREFIX_PATH=$( brew --prefix or-tools)
253258 fi
254259 if [[ -f " /opt/rh/rh-python38/enable" ]]; then
255- set +u
256- source /opt/rh/rh-python38/enable
257- set -u
260+ set +u
261+ source /opt/rh/rh-python38/enable
262+ set -u
258263 fi
259264 if [[ -f " /opt/rh/devtoolset-8/enable" ]]; then
260- # the scl script has unbound variables
261- set +u
262- source /opt/rh/devtoolset-8/enable
263- set -u
265+ # the scl script has unbound variables
266+ set +u
267+ source /opt/rh/devtoolset-8/enable
268+ set -u
264269 fi
265270
266271 if [ -z " ${SKIP_OPENROAD+x} " ]; then
267- echo " [INFO FLW-0018] Compiling OpenROAD."
268- if [ -f " ${DIR} /openroad_deps_prefixes.txt" ]; then
269- DEPS_PREFIX_ARG=" ${DIR} /openroad_deps_prefixes.txt"
270- elif [ -f " ${DIR} /tools/OpenROAD/etc/openroad_deps_prefixes.txt" ]; then
271- DEPS_PREFIX_ARG=" ${DIR} /tools/OpenROAD/etc/openroad_deps_prefixes.txt"
272- elif [ -f /etc/openroad_deps_prefixes.txt ]; then
273- DEPS_PREFIX_ARG=" /etc/openroad_deps_prefixes.txt"
274- else
275- DEPS_PREFIX_ARG=" "
276- fi
277- if [[ -n " ${DEPS_PREFIX_ARG} " ]]; then
278- echo " [INFO FLW-0029] Found OpenROAD dependencies prefixes file: '${DEPS_PREFIX_ARG} '."
279- DEPS_PREFIX_ARG=" -deps-prefixes-file=${DEPS_PREFIX_ARG} "
280- fi
281- eval ${NICE} ./tools/OpenROAD/etc/Build.sh \
282- -dir=" $DIR /tools/OpenROAD/build" \
283- -threads=${PROC} \
284- -cmake=\' ${OPENROAD_APP_ARGS} \' \
285- ${DEPS_PREFIX_ARG}
286- ${NICE} cmake --build tools/OpenROAD/build --target install -j " ${PROC} "
272+ echo " [INFO FLW-0018] Compiling OpenROAD."
273+ if [ -f " ${DIR} /openroad_deps_prefixes.txt" ]; then
274+ DEPS_PREFIX_ARG=" ${DIR} /openroad_deps_prefixes.txt"
275+ elif [ -f " ${DIR} /tools/OpenROAD/etc/openroad_deps_prefixes.txt" ]; then
276+ DEPS_PREFIX_ARG=" ${DIR} /tools/OpenROAD/etc/openroad_deps_prefixes.txt"
277+ elif [ -f /etc/openroad_deps_prefixes.txt ]; then
278+ DEPS_PREFIX_ARG=" /etc/openroad_deps_prefixes.txt"
279+ else
280+ DEPS_PREFIX_ARG=" "
281+ fi
282+ if [[ -n " ${DEPS_PREFIX_ARG} " ]]; then
283+ echo " [INFO FLW-0029] Found OpenROAD dependencies prefixes file: '${DEPS_PREFIX_ARG} '."
284+ DEPS_PREFIX_ARG=" -deps-prefixes-file=${DEPS_PREFIX_ARG} "
285+ fi
286+ eval ${NICE} ./tools/OpenROAD/etc/Build.sh \
287+ -dir=" $DIR /tools/OpenROAD/build" \
288+ -threads=${PROC} \
289+ -cmake=\' ${OPENROAD_APP_ARGS} \' \
290+ ${DEPS_PREFIX_ARG}
291+ ${NICE} cmake --build tools/OpenROAD/build --target install -j " ${PROC} "
287292 fi
288293
289294 YOSYS_ABC_PATH=tools/yosys/abc
290295 if [[ -d " ${YOSYS_ABC_PATH} /.git" ]]; then
291- # update indexes to make sure git diff-index uses correct data
292- git --work-tree=${YOSYS_ABC_PATH} --git-dir=${YOSYS_ABC_PATH} /.git update-index --refresh
296+ # update indexes to make sure git diff-index uses correct data
297+ git --work-tree=${YOSYS_ABC_PATH} --git-dir=${YOSYS_ABC_PATH} /.git update-index --refresh
293298 fi
294299
295300 if [ ${WITH_VERIFIC} -eq 1 ]; then
296301 echo " [INFO FLW-0031] Compiling Verific components."
297- cp -r " ${VERIFIC_DIR } " verific
302+ cp -r " ${VERIFIC_SRC } " tools/yosys/ verific
298303 for c in ${VERIFIC_COMPONENTS} ; do
299- make -j -C " verific/${c} " clean
300- make -j -C " verific/${c} "
304+ make -j -C " tools/yosys/ verific/${c} " clean
305+ make -j -C " tools/yosys/ verific/${c} "
301306 done
302307 fi
303308
@@ -322,7 +327,7 @@ __local_build()
322327
323328 if [ ${WITH_VERIFIC} -eq 1 ]; then
324329 echo " [INFO FLW-0032] Cleaning up Verific components."
325- rm -rf verific
330+ rm -rf tools/yosys/ verific
326331 fi
327332}
328333
0 commit comments