diff --git a/f4pga/setup.py b/f4pga/setup.py index 263ad34..b8bb5e2 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -88,7 +88,11 @@ setuptools_setup( package_dir={"f4pga": "."}, package_data={ 'f4pga': ['*.json', 'platforms/*.json'], - 'f4pga.wrappers.sh': ['xc7/*.f4pga.sh', 'quicklogic/*.f4pga.sh'] + 'f4pga.wrappers.sh': [ + 'xc7/*.f4pga.sh', + 'quicklogic/*.f4pga.sh', + 'quicklogic/env' + ] }, classifiers=[], python_requires='>=3.6', diff --git a/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh b/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh index 15232bb..77315ab 100755 --- a/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh @@ -18,16 +18,18 @@ set -e -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" - export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH} -fi - +source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_analysis.log -run_vpr --analysis --gen_post_synthesis_netlist on --gen_post_implementation_merged_netlist on --post_synth_netlist_unconn_inputs nets --post_synth_netlist_unconn_outputs nets --verify_file_digests off +run_vpr \ + --analysis \ + --gen_post_synthesis_netlist on \ + --gen_post_implementation_merged_netlist on \ + --post_synth_netlist_unconn_inputs nets \ + --post_synth_netlist_unconn_outputs nets \ + --verify_file_digests off mv vpr_stdout.log analysis.log diff --git a/f4pga/wrappers/sh/quicklogic/env b/f4pga/wrappers/sh/quicklogic/env index 942256c..c2c5f81 100644 --- a/f4pga/wrappers/sh/quicklogic/env +++ b/f4pga/wrappers/sh/quicklogic/env @@ -16,10 +16,7 @@ # # SPDX-License-Identifier: Apache-2.0 -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - if [ -z $VPRPATH ]; then - export VPRPATH=$MYPATH - export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH} + export VPRPATH="$F4PGA_BIN_DIR" + export PYTHONPATH="${VPRPATH}/python:${PYTHONPATH}" fi diff --git a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh index c48707c..ca77997 100755 --- a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh @@ -36,72 +36,54 @@ OUT_PCF="" OUT_QCF="" while true; do - case "$1" in - -d|--device) - DEVICE=$2 - shift 2 - ;; - -P|--part) - PART=$2 - shift 2 - ;; - -p|--pcf) - PCF=$2 - shift 2 - ;; - -b|--bit) - BIT=$2 - shift 2 - ;; - -v|--out-verilog) - OUT_VERILOG=$2 - shift 2 - ;; - -o|--out-pcf) - OUT_PCF=$2 - shift 2 - ;; - -q|--out-qcf) - OUT_QCF=$2 - shift 2 - ;; - --) - break - ;; - esac + case "$1" in + -d|--device) DEVICE=$2; shift 2 ;; + -P|--part) PART=$2; shift 2 ;; + -p|--pcf) PCF=$2; shift 2 ;; + -b|--bit) BIT=$2; shift 2 ;; + -v|--out-verilog) OUT_VERILOG=$2; shift 2 ;; + -o|--out-pcf) OUT_PCF=$2; shift 2 ;; + -q|--out-qcf) OUT_QCF=$2; shift 2 ;; + --) break ;; + esac done if [ -z $DEVICE ]; then - echo "Please provide device name" - exit 1 + echo "Please provide device name" + exit 1 fi if [ -z $BIT ]; then - echo "Please provide an input bistream file name" - exit 1 + echo "Please provide an input bistream file name" + exit 1 fi +if ! [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then + echo "ERROR: Unsupported device '${DEVICE}' for fasm2bels" + exit -1 +fi # $DEVICE is not ql-eos-s3 or ql-pp3e if ! [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then - echo "ERROR: Unsupported device '${DEVICE}' for fasm2bels" - exit -1 + echo "ERROR: Unsupported device '${DEVICE}' for fasm2bels" + exit -1 fi -# Run fasm2bels -VPR_DB=`readlink -f ${SHARE_DIR_PATH}/arch/${DEVICE}_wlcsp/db_phy.pickle` -FASM2BELS=`readlink -f ${SHARE_DIR_PATH}/scripts/fasm2bels.py` -FASM2BELS_DEVICE=${DEVICE/ql-/} - -VERILOG_FILE="${OUT_VERILOG:-$BIT.v}" -PCF_FILE="${OUT_PCF:-$BIT.v.pcf}" -QCF_FILE="${OUT_QCF:-$BIT.v.qcf}" - if [ ! -z "{PCF}" ]; then - PCF_ARGS="--input-pcf ${PCF}" + PCF_ARGS="--input-pcf ${PCF}" else - PCF_ARGS="" + PCF_ARGS="" fi echo "Running fasm2bels" -`which python3` ${FASM2BELS} ${BIT} --phy-db ${VPR_DB} --device-name ${FASM2BELS_DEVICE} --package-name ${PART} --input-type bitstream --output-verilog ${VERILOG_FILE} ${PCF_ARGS} --output-pcf ${PCF_FILE} --output-qcf ${QCF_FILE} + +echo "Running fasm2bels" +`which python3` "`readlink -f ${SHARE_DIR_PATH}/scripts/fasm2bels.py`" "${BIT}" \ + --phy-db "`readlink -f ${SHARE_DIR_PATH}/arch/${DEVICE}_wlcsp/db_phy.pickle`" \ + --device-name "${DEVICE/ql-/}" \ + --package-name "$PART" \ + --input-type bitstream \ + --output-verilog "${OUT_VERILOG:-$BIT.v}" \ + ${PCF_ARGS} \ + --output-pcf "${OUT_PCF:-$BIT.v.pcf}" \ + --output-qcf "${OUT_QCF:-$BIT.v.qcf}" diff --git a/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh b/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh index 1027323..da41954 100755 --- a/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/generate_bitstream.f4pga.sh @@ -18,7 +18,6 @@ set -e -SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} OPTS=d:f:r:b:P: LONGOPTS=device:,fasm:,format:,bit:,part: @@ -57,16 +56,26 @@ if [ -z $BIT ]; then exit 1 fi -DB_ROOT="$F4PGA_SHARE_DIR"/fasm_database/${DEVICE} - -# qlf if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then - QLF_FASM=`which qlf_fasm` - DB_ROOT=`realpath ${SHARE_DIR_PATH}//fasm_database/${DEVICE}` - ${QLF_FASM} --db-root ${DB_ROOT} --format ${BIT_FORMAT} --assemble $FASM $BIT + + `which qlf_fasm` \ + --db-root "${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}/fasm_database/${DEVICE}" \ + --format "$BIT_FORMAT" \ + --assemble \ + "$FASM" \ + "$BIT" + elif [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then - qlfasm --dev-type ${DEVICE} ${FASM} ${BIT} + + qlfasm \ + --dev-type \ + "$DEVICE" \ + "$FASM" \ + "$BIT" + else - echo "ERROR: Unsupported device '${DEVICE}' for bitstream generation" - exit -1 + + echo "ERROR: Unsupported device '${DEVICE}' for bitstream generation" + exit -1 + fi diff --git a/f4pga/wrappers/sh/quicklogic/generate_constraints.f4pga.sh b/f4pga/wrappers/sh/quicklogic/generate_constraints.f4pga.sh index a3e463e..90c6b62 100755 --- a/f4pga/wrappers/sh/quicklogic/generate_constraints.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/generate_constraints.f4pga.sh @@ -29,71 +29,71 @@ CORNER=$7 PROJECT=$(basename -- "$EBLIF") IOPLACE_FILE="${PROJECT%.*}_io.place" -BIN_DIR_PATH=${BIN_DIR_PATH:="$F4PGA_BIN_DIR"} SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} PYTHON3=$(which python3) if [[ "$DEVICE" =~ ^(qlf_.*)$ ]]; then + if [[ "$DEVICE" =~ ^(qlf_k4n8_qlf_k4n8)$ ]];then - DEVICE_1="qlf_k4n8-qlf_k4n8_umc22_$CORNER" - DEVICE_2=${DEVICE_1} + DEVICE_PATH="qlf_k4n8-qlf_k4n8_umc22_$CORNER" PINMAPXML="pinmap_qlf_k4n8_umc22.xml" elif [[ "$DEVICE" =~ ^(qlf_k6n10_qlf_k6n10)$ ]];then - DEVICE_1="qlf_k6n10-qlf_k6n10_gf12" - DEVICE_2=${DEVICE_1} + DEVICE_PATH="qlf_k6n10-qlf_k6n10_gf12" PINMAPXML="pinmap_qlf_k6n10_gf12.xml" else echo "ERROR: Unknown qlf device '${DEVICE}'" exit -1 fi - PINMAP_XML=`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_1}_${DEVICE_1}/${PINMAPXML}` - IOGEN=`realpath ${SHARE_DIR_PATH}/scripts/qlf_k4n8_create_ioplace.py` - - ${PYTHON3} ${IOGEN} --pcf $PCF --blif $EBLIF --pinmap_xml $PINMAP_XML --csv_file $PART --net $NET > ${IOPLACE_FILE} + "${PYTHON3}" "`realpath ${SHARE_DIR_PATH}/scripts/qlf_k4n8_create_ioplace.py`" \ + --pcf "$PCF" \ + --blif "$EBLIF" \ + --pinmap_xml "`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_PATH}_${DEVICE_PATH}/${PINMAPXML}`" \ + --csv_file "$PART" \ + --net "$NET" \ + > "${IOPLACE_FILE}" elif [[ "$DEVICE" =~ ^(ql-.*)$ ]]; then - DEVICE_1=${DEVICE} - DEVICE_2="wlcsp" - if ! [[ "$PART" =~ ^(PU64|WR42|PD64|WD30)$ ]]; then - PINMAPCSV="pinmap_PD64.csv" - CLKMAPCSV="clkmap_PD64.csv" + if ! [[ "$PART" =~ ^(PU64|WR42|PD64|WD30)$ ]]; then + PINMAPCSV="pinmap_PD64.csv" + CLKMAPCSV="clkmap_PD64.csv" else - PINMAPCSV="pinmap_${PART}.csv" - CLKMAPCSV="clkmap_${PART}.csv" + PINMAPCSV="pinmap_${PART}.csv" + CLKMAPCSV="clkmap_${PART}.csv" fi echo "PINMAP FILE : $PINMAPCSV" echo "CLKMAP FILE : $CLKMAPCSV" - PINMAP=`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_1}_${DEVICE_2}/${PINMAPCSV}` - CLKMAP=`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_1}_${DEVICE_2}/${CLKMAPCSV}` + DEVICE_PATH="${DEVICE}_wlcsp" + PINMAP=`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_PATH}/${PINMAPCSV}` - IOGEN=`realpath ${SHARE_DIR_PATH}/scripts/pp3_create_ioplace.py` - PLACEGEN=`realpath ${SHARE_DIR_PATH}/scripts/pp3_create_place_constraints.py` + "${PYTHON3}" `realpath ${SHARE_DIR_PATH}/scripts/pp3_create_ioplace.py` \ + --pcf "$PCF" \ + --blif "$EBLIF" \ + --map "$PINMAP" \ + --net "$NET" \ + > ${IOPLACE_FILE} - PLACE_FILE="${PROJECT%.*}_constraints.place" - - ${PYTHON3} ${IOGEN} --pcf $PCF --blif $EBLIF --map $PINMAP --net $NET > ${IOPLACE_FILE} - ${PYTHON3} ${PLACEGEN} --blif $EBLIF --map $CLKMAP -i ${IOPLACE_FILE} > ${PLACE_FILE} + "${PYTHON3}" `realpath ${SHARE_DIR_PATH}/scripts/pp3_create_place_constraints.py` \ + --blif "$EBLIF" \ + --map "`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_PATH}/${CLKMAPCSV}`" \ + -i "$IOPLACE_FILE" \ + > "${PROJECT%.*}_constraints.place" # EOS-S3 IOMUX configuration if [[ "$DEVICE" =~ ^(ql-eos-s3)$ ]]; then - - IOMUXGEN=`realpath ${SHARE_DIR_PATH}/scripts/pp3_eos_s3_iomux_config.py` - - IOMUX_JLINK="${PROJECT%.*}_iomux.jlink" - IOMUX_OPENOCD="${PROJECT%.*}_iomux.openocd" - IOMUX_BINARY="${PROJECT%.*}_iomux.bin" - - ${PYTHON3} ${IOMUXGEN} --eblif $EBLIF --pcf $PCF --map $PINMAP --output-format=jlink > ${IOMUX_JLINK} - ${PYTHON3} ${IOMUXGEN} --eblif $EBLIF --pcf $PCF --map $PINMAP --output-format=openocd > ${IOMUX_OPENOCD} - ${PYTHON3} ${IOMUXGEN} --eblif $EBLIF --pcf $PCF --map $PINMAP --output-format=binary > ${IOMUX_BINARY} + IOMUXGEN=`realpath ${SHARE_DIR_PATH}/scripts/pp3_eos_s3_iomux_config.py` + "${PYTHON3}" "${IOMUXGEN}" --eblif "$EBLIF" --pcf "$PCF" --map "$PINMAP" --output-format=jlink > "${PROJECT%.*}_iomux.jlink" + "${PYTHON3}" "${IOMUXGEN}" --eblif "$EBLIF" --pcf "$PCF" --map "$PINMAP" --output-format=openocd > "${PROJECT%.*}_iomux.openocd" + "${PYTHON3}" "${IOMUXGEN}" --eblif "$EBLIF" --pcf "$PCF" --map "$PINMAP" --output-format=binary > "${PROJECT%.*}_iomux.bin" fi else - echo "FIXME: Unsupported device '${DEVICE}'" - exit -1 + + echo "FIXME: Unsupported device '${DEVICE}'" + exit -1 + fi diff --git a/f4pga/wrappers/sh/quicklogic/generate_libfile.f4pga.sh b/f4pga/wrappers/sh/quicklogic/generate_libfile.f4pga.sh index 579204c..865cc60 100755 --- a/f4pga/wrappers/sh/quicklogic/generate_libfile.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/generate_libfile.f4pga.sh @@ -35,9 +35,9 @@ ARCH_DIR="$F4PGA_SHARE_DIR"/arch/${DEVICE_1}_${DEVICE_1} PINMAP_XML=${ARCH_DIR}/${PINMAPXML} `which python3` "$F4PGA_SHARE_DIR"/scripts/create_lib.py \ - -n ${DEV}_0P72_SSM40 \ + -n "${DEV}_0P72_SSM40" \ -m fpga_top \ - -c $PART \ - -x ${ARCH_DIR}/lib/${INTERFACEXML} \ - -l ${DEV}_0P72_SSM40.lib \ - -t ${ARCH_DIR}/lib + -c "$PART" \ + -x "${ARCH_DIR}/lib/${INTERFACEXML}" \ + -l "${DEV}_0P72_SSM40.lib" \ + -t "${ARCH_DIR}/lib" diff --git a/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh b/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh index 030b6e9..1267520 100755 --- a/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh @@ -18,16 +18,15 @@ set -e -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" - export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH} -fi - +source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log -run_vpr --pack --write_block_usage block_usage.json +run_vpr \ + --pack \ + --write_block_usage \ + block_usage.json mv vpr_stdout.log pack.log diff --git a/f4pga/wrappers/sh/quicklogic/place.f4pga.sh b/f4pga/wrappers/sh/quicklogic/place.f4pga.sh index 9fdf58f..7cb1950 100755 --- a/f4pga/wrappers/sh/quicklogic/place.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/place.f4pga.sh @@ -18,11 +18,7 @@ set -e -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" - export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH} -fi - +source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh b/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh index c9599b1..79a0d82 100755 --- a/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh @@ -18,10 +18,7 @@ set -e -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" -fi - +source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/route.f4pga.sh b/f4pga/wrappers/sh/quicklogic/route.f4pga.sh index e83f122..effbad2 100755 --- a/f4pga/wrappers/sh/quicklogic/route.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/route.f4pga.sh @@ -18,11 +18,7 @@ set -e -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" - export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH} -fi - +source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh b/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh index 1d9dd9a..d21683c 100755 --- a/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh @@ -18,8 +18,9 @@ set -e +source $(dirname "$0")/env + export SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} -VPRPATH=${VPRPATH:="$F4PGA_BIN_DIR"} SPLIT_INOUTS=`realpath ${SHARE_DIR_PATH}/scripts/split_inouts.py` CONVERT_OPTS=`realpath ${SHARE_DIR_PATH}/scripts/convert_compile_opts.py` diff --git a/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh b/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh index f9e7985..f9b87c0 100755 --- a/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/vpr_common.f4pga.sh @@ -19,193 +19,160 @@ SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} if [ -z $VPR_OPTIONS ]; then - echo "Using default VPR options." - VPR_OPTIONS=" - --max_router_iterations 500 - --routing_failure_predictor off - --router_high_fanout_threshold -1 - --constant_net_method route - " + echo "Using default VPR options." + VPR_OPTIONS=" + --max_router_iterations 500 + --routing_failure_predictor off + --router_high_fanout_threshold -1 + --constant_net_method route + " fi function parse_args { - OPTS=d:f:e:p:n:P:j:s:t:c: - LONGOPTS=device:,eblif:,pcf:,net:,part:,json:,sdc:,top:,corner: + OPTS=d:f:e:p:n:P:j:s:t:c: + LONGOPTS=device:,eblif:,pcf:,net:,part:,json:,sdc:,top:,corner: - PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- $@` - eval set -- ${PARSED_OPTS} + PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- $@` + eval set -- ${PARSED_OPTS} - DEVICE="" - FAMILY="" - DEVICE_NAME="" - PART="" - EBLIF="" - PCF="" - NET="" - SDC="" - JSON="" - TOP="top" - CORNER="" + DEVICE="" + FAMILY="" + DEVICE_NAME="" + PART="" + EBLIF="" + PCF="" + NET="" + SDC="" + JSON="" + TOP="top" + CORNER="" - while true; do - case "$1" in - -d|--device) - DEVICE=$2 - shift 2 - ;; - -f|--family) - FAMILY=$2 - shift 2 - ;; - -e|--eblif) - EBLIF=$2 - shift 2 - ;; - -p|--pcf) - PCF=$2 - shift 2 - ;; - -n|--net) - NET=$2 - shift 2 - ;; - -P|--part) - PART=$2 - shift 2 - ;; - -j|--json) - JSON=$2 - shift 2 - ;; - -s|--sdc) - SDC=$2 - shift 2 - ;; - -t|--top) - TOP=$2 - shift 2 - ;; - -c|--corner) - CORNER=$2 - shift 2 - ;; - --) - break - ;; - esac - done + while true; do + case "$1" in + -d|--device) DEVICE=$2; shift 2 ;; + -f|--family) FAMILY=$2; shift 2 ;; + -e|--eblif) EBLIF=$2; shift 2 ;; + -p|--pcf) PCF=$2; shift 2 ;; + -n|--net) NET=$2; shift 2 ;; + -P|--part) PART=$2; shift 2 ;; + -j|--json) JSON=$2; shift 2 ;; + -s|--sdc) SDC=$2; shift 2 ;; + -t|--top) TOP=$2; shift 2 ;; + -c|--corner) CORNER=$2; shift 2 ;; + --) break ;; + esac + done - if [ -z $DEVICE ]; then - echo "Please provide device name" - exit 1 - fi + if [ -z $DEVICE ]; then + echo "Please provide device name" + exit 1 + fi - if [ -z $FAMILY ]; then - echo "Please provide device family name" - exit 1 - fi + if [ -z $FAMILY ]; then + echo "Please provide device family name" + exit 1 + fi - if [ -z $EBLIF ]; then - echo "Please provide blif file name" - exit 1 - fi + if [ -z $EBLIF ]; then + echo "Please provide blif file name" + exit 1 + fi - export DEVICE=$DEVICE - export FAMILY=$FAMILY - export EBLIF=$EBLIF - export PCF=$PCF - export NET=$NET - export SDC=$SDC - export JSON=$JSON - 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 DEVICE=$DEVICE + export FAMILY=$FAMILY + export EBLIF=$EBLIF + export PCF=$PCF + export NET=$NET + export SDC=$SDC + export JSON=$JSON + 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 ${SHARE_DIR_PATH}/arch/${DEVICE_1}_${DEVICE_2}` - export ARCH_DEF=${ARCH_DIR}/arch_${DEVICE_1}_${DEVICE_2}.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 - if [ ! -f ${RR_GRAPH} ]; then - export RR_GRAPH=${ARCH_DIR}/rr_graph_${DEVICE_1}_${DEVICE_2}.rr_graph.real.bin - fi + # qlf* devices use different naming scheme than pp3* ones. + export RR_GRAPH=${ARCH_DIR}/${DEVICE_1}.rr_graph.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 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 DEVICE_NAME=${DEVICE_1} - if [[ "$DEVICE" == "qlf_k4n8_qlf_k4n8" ]]; then - VPR_OPTIONS="$VPR_OPTIONS - --route_chan_width 10 - --clock_modeling ideal - --place_delta_delay_matrix_calculation_method dijkstra - --place_delay_model delta_override - --router_lookahead extended_map - --allow_dangling_combinational_nodes on - --absorb_buffer_luts off" - else - VPR_OPTIONS="$VPR_OPTIONS - --route_chan_width 100 - --clock_modeling route - --place_delay_model delta_override - --router_lookahead extended_map - --check_route quick - --strict_checks off - --allow_dangling_combinational_nodes on - --disable_errors check_unbuffered_edges:check_route - --congested_routing_iteration_threshold 0.8 - --incremental_reroute_delay_ripup off - --base_cost_type delay_normalized_length_bounded - --bb_factor 10 - --initial_pres_fac 4.0 - --check_rr_graph off - --pack_high_fanout_threshold PB-LOGIC:18 - --suppress_warnings ${OUT_NOISY_WARNINGS},sum_pin_class:check_unbuffered_edges:load_rr_indexed_data_T_values:check_rr_node:trans_per_R:check_route:set_rr_graph_tool_comment" - fi + if [[ "$DEVICE" == "qlf_k4n8_qlf_k4n8" ]]; then + VPR_OPTIONS="$VPR_OPTIONS + --route_chan_width 10 + --clock_modeling ideal + --place_delta_delay_matrix_calculation_method dijkstra + --place_delay_model delta_override + --router_lookahead extended_map + --allow_dangling_combinational_nodes on + --absorb_buffer_luts off" + else + VPR_OPTIONS="$VPR_OPTIONS + --route_chan_width 100 + --clock_modeling route + --place_delay_model delta_override + --router_lookahead extended_map + --check_route quick + --strict_checks off + --allow_dangling_combinational_nodes on + --disable_errors check_unbuffered_edges:check_route + --congested_routing_iteration_threshold 0.8 + --incremental_reroute_delay_ripup off + --base_cost_type delay_normalized_length_bounded + --bb_factor 10 + --initial_pres_fac 4.0 + --check_rr_graph off + --pack_high_fanout_threshold PB-LOGIC:18 + --suppress_warnings ${OUT_NOISY_WARNINGS},sum_pin_class:check_unbuffered_edges:load_rr_indexed_data_T_values:check_rr_node:trans_per_R:check_route:set_rr_graph_tool_comment" + fi } function run_vpr { - set -e + set -e - SDC_OPTIONS="" - if [ ! -z $SDC ] - then - SDC_OPTIONS="--sdc_file $SDC" - fi + SDC_OPTIONS="" + if [ ! -z $SDC ]; then + SDC_OPTIONS="--sdc_file $SDC" + fi - `which vpr` ${ARCH_DEF} \ - ${EBLIF} \ - --read_rr_graph ${RR_GRAPH} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_router_lookahead ${ROUTE_DELAY} \ - --read_placement_delay_lookup ${PLACE_DELAY} \ - ${SDC_OPTIONS} \ - $@ + "`which vpr`" ${ARCH_DEF} \ + ${EBLIF} \ + --read_rr_graph ${RR_GRAPH} \ + --device ${DEVICE_NAME} \ + ${VPR_OPTIONS} \ + --read_router_lookahead ${ROUTE_DELAY} \ + --read_placement_delay_lookup ${PLACE_DELAY} \ + ${SDC_OPTIONS} \ + $@ - return $? + return $? } function run_genfasm { - set -e + set -e - `which genfasm` ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - $@ + "`which genfasm`" ${ARCH_DEF} \ + ${EBLIF} \ + --device ${DEVICE_NAME} \ + ${VPR_OPTIONS} \ + --read_rr_graph ${RR_GRAPH} \ + $@ - return $? + return $? } diff --git a/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh index e0623d2..3e713dd 100755 --- a/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh @@ -18,11 +18,7 @@ set -e -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" - export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH} -fi - +source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args "$@"