From bc488d3abcf6716e2d43fb67f773ad3b5d92355e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Czarnecki?= Date: Tue, 31 May 2022 16:00:55 +0200 Subject: [PATCH] wrappers: sh: ql: fixup share path and vpr_common MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Czarnecki --- .../wrappers/sh/quicklogic/fasm2bels.f4pga.sh | 8 +++---- .../sh/quicklogic/generate_bitstream.f4pga.sh | 3 ++- .../sh/quicklogic/vpr_common.f4pga.sh | 23 +++++++++++++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh index da3b19f..c82135b 100644 --- a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh @@ -18,8 +18,8 @@ set -e -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` +SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"} +BIN_DIR_PATH=${BIN_DIR_PATH:="$F4PGA_BIN_SHARE"} OPTS=d:P:p:b: LONGOPTS=device:,part:,pcf:,bit:, @@ -70,8 +70,8 @@ fi # Run fasm2bels if [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then - VPR_DB=`readlink -f ${MYPATH}/../share/symbiflow/arch/${DEVICE}_wlcsp/db_phy.pickle` - FASM2BELS=`readlink -f ${MYPATH}/../bin/python/fasm2bels.py` + VPR_DB=`readlink -f ${SHARE_DIR_PATH}/arch/${DEVICE}_wlcsp/db_phy.pickle` + FASM2BELS=`readlink -f ${BIN_DIR_PATH}/python/fasm2bels.py` FASM2BELS_DEVICE=${DEVICE/ql-/} VERILOG_FILE="${BIT}.v" PCF_FILE="${BIT}.v.pcf" diff --git a/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh b/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh index 8034a96..2d1e56a 100755 --- a/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh @@ -18,6 +18,7 @@ set -e +SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"} OPTS=d:f:r:b:P: LONGOPTS=device:,fasm:,format:,bit:,part: @@ -61,7 +62,7 @@ DB_ROOT="$F4PGA_ENV_SHARE"/fasm_database/${DEVICE} # qlf if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then QLF_FASM=`which qlf_fasm` - DB_ROOT=`realpath ${MYPATH}/../share/symbiflow/fasm_database/${DEVICE}` + DB_ROOT=`realpath ${SHARE_DIR_PATH}//fasm_database/${DEVICE}` ${QLF_FASM} --db-root ${DB_ROOT} --format ${BIT_FORMAT} --assemble $FASM $BIT elif [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then qlfasm --dev-type ${DEVICE} ${FASM} ${BIT} diff --git a/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh b/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh index 3addb97..ef7e6d8 100755 --- a/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh @@ -16,6 +16,8 @@ # # SPDX-License-Identifier: Apache-2.0 +SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"} + function parse_args { OPTS=d:f:e:p:n:P:j:s:t:c: @@ -109,20 +111,31 @@ function parse_args { export CORNER=$CORNER if [[ "$DEVICE" == "qlf_k4n8_qlf_k4n8" ]]; then DEVICE_1="qlf_k4n8-qlf_k4n8_umc22_${CORNER}" + DEVICE_2=${DEVICE_1} elif [[ "$DEVICE" == "qlf_k6n10_qlf_k6n10" ]];then DEVICE_1="qlf_k6n10-qlf_k6n10_gf12" + DEVICE_2=${DEVICE_1} + else + DEVICE_1=${DEVICE} + DEVICE_2="wlcsp" fi export TOP=$TOP - export ARCH_DIR=`realpath ${MYPATH}/../share/symbiflow/arch/${DEVICE_1}_${DEVICE_1}` - export ARCH_DEF=${ARCH_DIR}/arch_${DEVICE_1}_${DEVICE_1}.xml + export ARCH_DIR=`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_1}_${DEVICE_2}` + export ARCH_DEF=${ARCH_DIR}/arch_${DEVICE_1}_${DEVICE_2}.xml + + # qlf* devices use different naming scheme than pp3* ones. export RR_GRAPH=${ARCH_DIR}/${DEVICE_1}.rr_graph.bin - export PLACE_DELAY=${ARCH_DIR}/rr_graph_${DEVICE_1}_${DEVICE_1}.place_delay.bin - export ROUTE_DELAY=${ARCH_DIR}/rr_graph_${DEVICE_1}_${DEVICE_1}.lookahead.bin + if [ ! -f ${RR_GRAPH} ]; then + export RR_GRAPH=${ARCH_DIR}/rr_graph_${DEVICE_1}_${DEVICE_2}.rr_graph.real.bin + fi + + export PLACE_DELAY=${ARCH_DIR}/rr_graph_${DEVICE_1}_${DEVICE_2}.place_delay.bin + export ROUTE_DELAY=${ARCH_DIR}/rr_graph_${DEVICE_1}_${DEVICE_2}.lookahead.bin export DEVICE_NAME=${DEVICE_1} - export VPR_CONFIG=`realpath ${MYPATH}/../share/symbiflow/scripts/${FAMILY}/vpr_config.sh` + export VPR_CONFIG=`realpath ${SHARE_DIR_PATH}/scripts/${FAMILY}/vpr_config.sh` } function run_vpr {