f4pga/wrappers/sh: cleanup
Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
parent
a6f4fbd481
commit
9dc9d6cb98
|
@ -234,7 +234,7 @@ python3 '{share_dir}'/scripts/prjxray_create_place_constraints.py \
|
||||||
--part '{part}' \
|
--part '{part}' \
|
||||||
--vpr_grid_map '{share_dir}/arch/{device}/vpr_grid_map.csv' \
|
--vpr_grid_map '{share_dir}/arch/{device}/vpr_grid_map.csv' \
|
||||||
--input '{ioplace_file}' \
|
--input '{ioplace_file}' \
|
||||||
--db_root "${{DATABASE_DIR:=$(prjxray-config)}}" \
|
--db_root "${{DATABASE_DIR:-$(prjxray-config)}}" \
|
||||||
> constraints.place
|
> constraints.place
|
||||||
""")
|
""")
|
||||||
|
|
||||||
|
@ -268,7 +268,6 @@ fi
|
||||||
"""
|
"""
|
||||||
else:
|
else:
|
||||||
place_cmds += """
|
place_cmds += """
|
||||||
PCF=${PCF:=}
|
|
||||||
echo "Generating constrains ..."
|
echo "Generating constrains ..."
|
||||||
python3 -m f4pga.wrappers.sh.generate_constraints $EBLIF $NET $PART $DEVICE $ARCH_DEF $PCF
|
python3 -m f4pga.wrappers.sh.generate_constraints $EBLIF $NET $PART $DEVICE $ARCH_DEF $PCF
|
||||||
VPR_PLACE_FILE='constraints.place'
|
VPR_PLACE_FILE='constraints.place'
|
||||||
|
@ -292,20 +291,17 @@ def synth():
|
||||||
|
|
||||||
def write_fasm(genfasm_extra_args = None):
|
def write_fasm(genfasm_extra_args = None):
|
||||||
print("[F4PGA] Running (deprecated) write fasm")
|
print("[F4PGA] Running (deprecated) write fasm")
|
||||||
p_run_bash_cmds(p_vpr_common_cmds('fasm')+"""
|
p_run_bash_cmds(p_vpr_common_cmds('fasm')+f"""
|
||||||
TOP="${EBLIF%.*}"
|
|
||||||
FASM_EXTRA="${TOP}_fasm_extra.fasm"
|
|
||||||
""" + f"""
|
|
||||||
'{which('genfasm')}' \
|
'{which('genfasm')}' \
|
||||||
${{ARCH_DEF}} ${{EBLIF}} --device ${{DEVICE_NAME}} \
|
${{ARCH_DEF}} ${{EBLIF}} --device ${{DEVICE_NAME}} \
|
||||||
${{VPR_OPTIONS}} \
|
${{VPR_OPTIONS}} \
|
||||||
--read_rr_graph ${{RR_GRAPH}} {' '.join(genfasm_extra_args) if genfasm_extra_args is not None else ''}
|
--read_rr_graph ${{RR_GRAPH}} {' '.join(genfasm_extra_args) if genfasm_extra_args is not None else ''}
|
||||||
""" + """
|
""" + """
|
||||||
echo "FASM extra: $FASM_EXTRA"
|
TOP="${EBLIF%.*}"
|
||||||
|
FASM_EXTRA="${TOP}_fasm_extra.fasm"
|
||||||
if [ -f $FASM_EXTRA ]; then
|
if [ -f $FASM_EXTRA ]; then
|
||||||
echo "writing final fasm"
|
echo "writing final fasm (extra: $FASM_EXTRA)"
|
||||||
cat ${TOP}.fasm $FASM_EXTRA > tmp.fasm
|
cat $FASM_EXTRA >> ${TOP}.fasm
|
||||||
mv tmp.fasm ${TOP}.fasm
|
|
||||||
fi
|
fi
|
||||||
""")
|
""")
|
||||||
Path('vpr_stdout.log').rename('fasm.log')
|
Path('vpr_stdout.log').rename('fasm.log')
|
||||||
|
@ -347,7 +343,7 @@ while true; do
|
||||||
--) break ;;
|
--) break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
DATABASE_DIR=${DATABASE_DIR:=$(prjxray-config)}
|
DATABASE_DIR=${DATABASE_DIR:-$(prjxray-config)}
|
||||||
if [ -z $DEVICE ]; then
|
if [ -z $DEVICE ]; then
|
||||||
# Try to find device name. Accept only when exactly one is found
|
# Try to find device name. Accept only when exactly one is found
|
||||||
PART_DIRS=(${DATABASE_DIR}/*/${PART})
|
PART_DIRS=(${DATABASE_DIR}/*/${PART})
|
||||||
|
@ -445,7 +441,7 @@ if [ -z $BIT ]; then echo "Please provide an output bistream file name"; exit 1;
|
||||||
""" + f"""
|
""" + f"""
|
||||||
if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then
|
if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then
|
||||||
'{which('qlf_fasm')}' \
|
'{which('qlf_fasm')}' \
|
||||||
--db-root "${{SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}}/fasm_database/${{DEVICE}}" \
|
--db-root "${{F4PGA_SHARE_DIR}}/fasm_database/${{DEVICE}}" \
|
||||||
--format "$BIT_FORMAT" \
|
--format "$BIT_FORMAT" \
|
||||||
--assemble \
|
--assemble \
|
||||||
"$FASM" \
|
"$FASM" \
|
||||||
|
@ -477,7 +473,7 @@ else
|
||||||
DEVICE_1={device}
|
DEVICE_1={device}
|
||||||
fi
|
fi
|
||||||
""" + """
|
""" + """
|
||||||
ARCH_DIR="$F4PGA_SHARE_DIR"/arch/${DEVICE_1}_${DEVICE_1}
|
ARCH_DIR="${F4PGA_SHARE_DIR}/arch/${DEVICE_1}_${DEVICE_1}"
|
||||||
PINMAP_XML=${ARCH_DIR}/${PINMAPXML}
|
PINMAP_XML=${ARCH_DIR}/${PINMAPXML}
|
||||||
""" + f"""
|
""" + f"""
|
||||||
'{python3}' "$F4PGA_SHARE_DIR"/scripts/create_lib.py \
|
'{python3}' "$F4PGA_SHARE_DIR"/scripts/create_lib.py \
|
||||||
|
@ -497,10 +493,8 @@ def ql():
|
||||||
|
|
||||||
def fasm2bels():
|
def fasm2bels():
|
||||||
print("[F4PGA] Running (deprecated) fasm2bels")
|
print("[F4PGA] Running (deprecated) fasm2bels")
|
||||||
p_run_bash_cmds("""
|
p_run_bash_cmds(f"""
|
||||||
set -e
|
set -e
|
||||||
SHARE_DIR_PATH=${{SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}}
|
|
||||||
""" + f"""
|
|
||||||
eval set -- "$(
|
eval set -- "$(
|
||||||
getopt \
|
getopt \
|
||||||
--options=d:P:p:b:v:o:q \
|
--options=d:P:p:b:v:o:q \
|
||||||
|
@ -534,8 +528,8 @@ if ! [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then echo "ERROR: Unsupported dev
|
||||||
if [ -z "{PCF}" ]; then PCF_ARGS=""; else PCF_ARGS="--input-pcf ${PCF}"; fi
|
if [ -z "{PCF}" ]; then PCF_ARGS=""; else PCF_ARGS="--input-pcf ${PCF}"; fi
|
||||||
echo "Running fasm2bels"
|
echo "Running fasm2bels"
|
||||||
""" + f"""
|
""" + f"""
|
||||||
'{python3}' "`readlink -f ${{SHARE_DIR_PATH}}/scripts/fasm2bels.py`" "${{BIT}}" \
|
'{python3}' "${{F4PGA_SHARE_DIR}}"/scripts/fasm2bels.py "${{BIT}}" \
|
||||||
--phy-db "`readlink -f ${{SHARE_DIR_PATH}}/arch/${{DEVICE}}_wlcsp/db_phy.pickle`" \
|
--phy-db "${{F4PGA_SHARE_DIR}}/arch/${{DEVICE}}_wlcsp/db_phy.pickle" \
|
||||||
--device-name "${{DEVICE/ql-/}}" \
|
--device-name "${{DEVICE/ql-/}}" \
|
||||||
--package-name "$PART" \
|
--package-name "$PART" \
|
||||||
--input-type bitstream \
|
--input-type bitstream \
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}
|
SHARE_DIR_PATH=${SHARE_DIR_PATH:-"$F4PGA_SHARE_DIR"}
|
||||||
|
|
||||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||||
|
|
||||||
|
@ -88,62 +88,25 @@ for arg in $@; do
|
||||||
-h|--help) exit 0 ;;
|
-h|--help) exit 0 ;;
|
||||||
*)
|
*)
|
||||||
case $OPT in
|
case $OPT in
|
||||||
src)
|
src) SOURCE=$arg; OPT="" ;;
|
||||||
SOURCE=$arg
|
top) TOP=$arg; OPT="" ;;
|
||||||
OPT=""
|
dev) DEVICE=$arg; OPT="" ;;
|
||||||
;;
|
pcf) PCF=$arg; OPT="" ;;
|
||||||
top)
|
part) PART=$arg; OPT="" ;;
|
||||||
TOP=$arg
|
json) JSON=$arg; OPT="" ;;
|
||||||
OPT=""
|
sdc) SDC=$arg; OPT="" ;;
|
||||||
;;
|
pnr_corner) PNR_CORNER=$arg; OPT="" ;;
|
||||||
vlog)
|
analysis_corner) ANALYSIS_CORNER=$arg; OPT="" ;;
|
||||||
VERILOG_FILES+="$arg "
|
build_dir) BUILDDIR=$arg OPT="" ;;
|
||||||
;;
|
|
||||||
dev)
|
|
||||||
DEVICE=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
pcf)
|
|
||||||
PCF=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
part)
|
|
||||||
PART=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
json)
|
|
||||||
JSON=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
sdc)
|
|
||||||
SDC=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
route)
|
route)
|
||||||
ROUTE_FLAG0="$arg"
|
ROUTE_FLAG0="$arg"
|
||||||
ROUTE_FLAG0="${ROUTE_FLAG0,,}"
|
ROUTE_FLAG0="${ROUTE_FLAG0,,}"
|
||||||
OPT=""
|
OPT=""
|
||||||
;;
|
;;
|
||||||
pnr_corner)
|
vlog) VERILOG_FILES+="$arg " ;;
|
||||||
PNR_CORNER=$arg
|
dump) OUT+="$arg " ;;
|
||||||
OPT=""
|
compile_xtra) ;;
|
||||||
;;
|
options_file) COMPILE_EXTRA_ARGS+=("-f \"`realpath $arg`\" ") ;;
|
||||||
analysis_corner)
|
|
||||||
ANALYSIS_CORNER=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
dump)
|
|
||||||
OUT+="$arg "
|
|
||||||
;;
|
|
||||||
compile_xtra)
|
|
||||||
;;
|
|
||||||
options_file)
|
|
||||||
COMPILE_EXTRA_ARGS+=("-f \"`realpath $arg`\" ")
|
|
||||||
;;
|
|
||||||
build_dir)
|
|
||||||
BUILDDIR=$arg
|
|
||||||
OPT=""
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Refer help for more details: ql_symbiflow -h "
|
echo "Refer help for more details: ql_symbiflow -h "
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -157,69 +120,47 @@ for arg in $@; do
|
||||||
done
|
done
|
||||||
|
|
||||||
case ${DEVICE} in
|
case ${DEVICE} in
|
||||||
qlf_k4n8)
|
qlf_k4n8) DEVICE="${DEVICE}_${DEVICE}"; FAMILY="qlf_k4n8"; DEVICE_CHECK="VALID"; USE_PINMAP=1 ;;
|
||||||
DEVICE="${DEVICE}_${DEVICE}"
|
qlf_k6n10) DEVICE="${DEVICE}_${DEVICE}"; FAMILY="qlf_k6n10"; DEVICE_CHECK="VALID"; USE_PINMAP=1 ;;
|
||||||
FAMILY="qlf_k4n8"
|
ql-eos-s3) DEVICE="${DEVICE}"; FAMILY="pp3"; DEVICE_CHECK="VALID"; USE_PINMAP=0 ;;
|
||||||
DEVICE_CHECK="VALID"
|
*) echo "Unsupported device '${DEVICE}'"; exit 1 ;;
|
||||||
USE_PINMAP=1
|
|
||||||
;;
|
|
||||||
qlf_k6n10)
|
|
||||||
DEVICE="${DEVICE}_${DEVICE}"
|
|
||||||
FAMILY="qlf_k6n10"
|
|
||||||
DEVICE_CHECK="VALID"
|
|
||||||
USE_PINMAP=1
|
|
||||||
;;
|
|
||||||
ql-eos-s3)
|
|
||||||
DEVICE="${DEVICE}"
|
|
||||||
FAMILY="pp3"
|
|
||||||
DEVICE_CHECK="VALID"
|
|
||||||
USE_PINMAP=0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported device '${DEVICE}'"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## Check if the source directory exists
|
|
||||||
if [[ $1 == "-h" || $1 == "--help" ]];then
|
if [[ $1 == "-h" || $1 == "--help" ]];then
|
||||||
exit 1
|
exit 1
|
||||||
else
|
fi
|
||||||
if [ -z "$SOURCE" ];then
|
|
||||||
SOURCE=$PWD
|
## Check if the source directory exists
|
||||||
elif [ $SOURCE == "." ];then
|
SOURCE=${SOURCE:-$PWD}
|
||||||
SOURCE=$PWD
|
if [ $SOURCE == "." ];then
|
||||||
elif [ ! -d "$SOURCE" ];then
|
SOURCE=$PWD
|
||||||
echo "Directory path $SOURCE DOES NOT exists. Please add absolute path"
|
elif [ ! -d "$SOURCE" ];then
|
||||||
|
echo "Directory path $SOURCE DOES NOT exists. Please add absolute path"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f $SOURCE/v_list_tmp ];then
|
||||||
|
rm -f $SOURCE/v_list_tmp
|
||||||
|
fi
|
||||||
|
if [ "$VERILOG_FILES" == "*.v" ];then
|
||||||
|
VERILOG_FILES=`cd ${SOURCE};ls *.v`
|
||||||
|
fi
|
||||||
|
echo "$VERILOG_FILES" >${SOURCE}/v_list
|
||||||
|
|
||||||
|
## Validate the verlog source files
|
||||||
|
if [ ${#VERILOG_FILES[@]} -eq 0 ]; then
|
||||||
|
if [[ $1 != "-h" || $1 != "--help" ]];then
|
||||||
|
echo "Please provide at least one Verilog file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
if [[ $1 == "-h" || $1 == "--help" ]];then
|
echo "verilog files: $VERILOG_FILES"
|
||||||
exit 0
|
echo $VERILOG_FILES >${SOURCE}/v_list
|
||||||
else
|
sed '/^$/d' $SOURCE/v_list > $SOURCE/f_list_temp
|
||||||
if [ -f $SOURCE/v_list_tmp ];then
|
VERILOG_FILES=`cat $SOURCE/f_list_temp`
|
||||||
rm -f $SOURCE/v_list_tmp
|
|
||||||
fi
|
|
||||||
if [ "$VERILOG_FILES" == "*.v" ];then
|
|
||||||
VERILOG_FILES=`cd ${SOURCE};ls *.v`
|
|
||||||
fi
|
|
||||||
echo "$VERILOG_FILES" >${SOURCE}/v_list
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Validate the verlog source files
|
|
||||||
if [ ${#VERILOG_FILES[@]} -eq 0 ]; then
|
|
||||||
if [[ $1 != "-h" || $1 != "--help" ]];then
|
|
||||||
echo "Please provide at least one Verilog file"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "verilog files: $VERILOG_FILES"
|
|
||||||
echo $VERILOG_FILES >${SOURCE}/v_list
|
|
||||||
sed '/^$/d' $SOURCE/v_list > $SOURCE/f_list_temp
|
|
||||||
VERILOG_FILES=`cat $SOURCE/f_list_temp`
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ $1 == "-compile" || $1 == "-post_verilog" ]]; then
|
if [[ $1 == "-compile" || $1 == "-post_verilog" ]]; then
|
||||||
if [ -z "$DEVICE" ]; then
|
if [ -z "$DEVICE" ]; then
|
||||||
echo "DEVICE name is missing. Refer -h/--help"
|
echo "DEVICE name is missing. Refer -h/--help"
|
||||||
|
@ -344,9 +285,9 @@ elif [[ -f $PCF ]];then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $USE_PINMAP -ne 0 ]]; then
|
if [[ $USE_PINMAP -ne 0 ]]; then
|
||||||
export PART=${CSV_PATH}
|
export PART=${CSV_PATH}
|
||||||
else
|
else
|
||||||
export PART=${PART}
|
export PART=${PART}
|
||||||
fi
|
fi
|
||||||
export JSON=${JSON_PATH}
|
export JSON=${JSON_PATH}
|
||||||
export PCF_PATH=${PCF_PATH}
|
export PCF_PATH=${PCF_PATH}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
export SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}
|
export SHARE_DIR_PATH=${SHARE_DIR_PATH:-"$F4PGA_SHARE_DIR"}
|
||||||
SPLIT_INOUTS=`realpath ${SHARE_DIR_PATH}/scripts/split_inouts.py`
|
SPLIT_INOUTS=`realpath ${SHARE_DIR_PATH}/scripts/split_inouts.py`
|
||||||
CONVERT_OPTS=`realpath ${SHARE_DIR_PATH}/scripts/convert_compile_opts.py`
|
CONVERT_OPTS=`realpath ${SHARE_DIR_PATH}/scripts/convert_compile_opts.py`
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}
|
SHARE_DIR_PATH=${SHARE_DIR_PATH:-"$F4PGA_SHARE_DIR"}
|
||||||
|
|
||||||
if [ -z $VPR_OPTIONS ]; then
|
if [ -z $VPR_OPTIONS ]; then
|
||||||
echo "Using default VPR options."
|
echo "Using default VPR options."
|
||||||
|
|
|
@ -118,7 +118,7 @@ if [ ${#VERILOG_FILES[@]} -eq 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DATABASE_DIR=${DATABASE_DIR:=$(prjxray-config)}
|
DATABASE_DIR=${DATABASE_DIR:-$(prjxray-config)}
|
||||||
|
|
||||||
export TOP=${TOP}
|
export TOP=${TOP}
|
||||||
export USE_ROI="FALSE"
|
export USE_ROI="FALSE"
|
||||||
|
@ -130,7 +130,7 @@ export OUT_SYNTH_V=${TOP}_synth.v
|
||||||
export OUT_EBLIF=${TOP}.eblif
|
export OUT_EBLIF=${TOP}.eblif
|
||||||
export PART_JSON=`realpath ${DATABASE_DIR}/$DEVICE/$PART/part.json`
|
export PART_JSON=`realpath ${DATABASE_DIR}/$DEVICE/$PART/part.json`
|
||||||
export OUT_FASM_EXTRA=${TOP}_fasm_extra.fasm
|
export OUT_FASM_EXTRA=${TOP}_fasm_extra.fasm
|
||||||
export PYTHON3=${PYTHON3:=$(which python3)}
|
export PYTHON3=${PYTHON3:-$(which python3)}
|
||||||
|
|
||||||
LOG=${TOP}_synth.log
|
LOG=${TOP}_synth.log
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"}
|
SHARE_DIR_PATH=${SHARE_DIR_PATH:-"$F4PGA_SHARE_DIR"}
|
||||||
|
|
||||||
if [ -z $VPR_OPTIONS ]; then
|
if [ -z $VPR_OPTIONS ]; then
|
||||||
echo "Using default VPR options."
|
echo "Using default VPR options."
|
||||||
|
|
Loading…
Reference in New Issue