Merge pull request #573 from antmicro/pcza/ql-support
Update QL support and enable EOS-S3
This commit is contained in:
commit
297f8e53d4
|
@ -18,14 +18,14 @@
|
|||
|
||||
set -e
|
||||
|
||||
F4PGA_FAM=${F4PGA_FAM:=xc7}
|
||||
FPGA_FAM=${FPGA_FAM:=xc7}
|
||||
|
||||
case "$F4PGA_FAM" in
|
||||
case "$FPGA_FAM" in
|
||||
xc7) F4PGA_DIR_ROOT='install';;
|
||||
eos-s3) F4PGA_DIR_ROOT='quicklogic-arch-defs';;
|
||||
esac
|
||||
|
||||
export PATH="$F4PGA_INSTALL_DIR/$F4PGA_FAM/$F4PGA_DIR_ROOT/bin:$PATH"
|
||||
source "$F4PGA_INSTALL_DIR/$F4PGA_FAM/conda/etc/profile.d/conda.sh"
|
||||
export PATH="$F4PGA_INSTALL_DIR/$FPGA_FAM/$F4PGA_DIR_ROOT/bin:$PATH"
|
||||
source "$F4PGA_INSTALL_DIR/$FPGA_FAM/conda/etc/profile.d/conda.sh"
|
||||
|
||||
conda activate $F4PGA_FAM
|
||||
conda activate $FPGA_FAM
|
||||
|
|
|
@ -28,12 +28,12 @@ cd f4pga-examples
|
|||
echo '::endgroup::'
|
||||
|
||||
|
||||
F4PGA_FAM=${F4PGA_FAM:=xc7}
|
||||
FPGA_FAM=${FPGA_FAM:=xc7}
|
||||
|
||||
echo '::group::Install Miniconda3'
|
||||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
|
||||
|
||||
F4PGA_INSTALL_DIR_FAM="$F4PGA_INSTALL_DIR/$F4PGA_FAM"
|
||||
F4PGA_INSTALL_DIR_FAM="$F4PGA_INSTALL_DIR/$FPGA_FAM"
|
||||
|
||||
bash conda_installer.sh -u -b -p "$F4PGA_INSTALL_DIR_FAM"/conda
|
||||
source "$F4PGA_INSTALL_DIR_FAM"/conda/etc/profile.d/conda.sh
|
||||
|
@ -41,19 +41,19 @@ echo '::endgroup::'
|
|||
|
||||
|
||||
echo '::group::Create environment'
|
||||
conda env create -f "$F4PGA_FAM"/environment.yml
|
||||
conda env create -f "$FPGA_FAM"/environment.yml
|
||||
echo '::endgroup::'
|
||||
|
||||
|
||||
echo '::group::Install arch-defs'
|
||||
case "$F4PGA_FAM" in
|
||||
case "$FPGA_FAM" in
|
||||
xc7)
|
||||
mkdir -p "$F4PGA_INSTALL_DIR_FAM"/install
|
||||
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/535/20220128-000432/symbiflow-arch-defs-install-5fa5e715.tar.xz | tar -xJC $F4PGA_INSTALL_DIR/xc7/install
|
||||
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/535/20220128-000432/symbiflow-arch-defs-xc7a50t_test-5fa5e715.tar.xz | tar -xJC $F4PGA_INSTALL_DIR/xc7/install
|
||||
;;
|
||||
eos-s3)
|
||||
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs-install/quicklogic-arch-defs-63c3d8f9.tar.gz | tar -xz -C $F4PGA_INSTALL_DIR_FAM
|
||||
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs-install/quicklogic-arch-defs-qlf-fc5d8da.tar.gz | tar -xz -C $F4PGA_INSTALL_DIR_FAM
|
||||
;;
|
||||
esac
|
||||
echo '::endgroup::'
|
||||
|
@ -64,7 +64,7 @@ cd ..
|
|||
|
||||
echo '::group::Add f4pga-env'
|
||||
|
||||
case "$F4PGA_FAM" in
|
||||
case "$FPGA_FAM" in
|
||||
xc7) F4PGA_DIR_ROOT='install';;
|
||||
eos-s3) F4PGA_DIR_ROOT='quicklogic-arch-defs';;
|
||||
esac
|
||||
|
@ -78,7 +78,7 @@ echo '::group::🗑️ Remove the wrappers (pre-packaged from arch-defs)'
|
|||
|
||||
cd "$F4PGA_DIR_BIN"
|
||||
|
||||
case "$F4PGA_FAM" in
|
||||
case "$FPGA_FAM" in
|
||||
xc7)
|
||||
rm -vrf \
|
||||
env \
|
||||
|
|
|
@ -88,7 +88,7 @@ jobs:
|
|||
name: '🚦 Example (deprecated sh) | ${{ matrix.fam }}'
|
||||
env:
|
||||
F4PGA_INSTALL_DIR: /opt/f4pga
|
||||
F4PGA_FAM: ${{ matrix.fam }}
|
||||
FPGA_FAM: ${{ matrix.fam }}
|
||||
|
||||
steps:
|
||||
|
||||
|
@ -149,7 +149,7 @@ jobs:
|
|||
name: '🐍 Example | xc7'
|
||||
env:
|
||||
F4PGA_INSTALL_DIR: /opt/f4pga
|
||||
F4PGA_FAM: xc7
|
||||
FPGA_FAM: xc7
|
||||
|
||||
steps:
|
||||
|
||||
|
@ -187,7 +187,7 @@ jobs:
|
|||
name: '🐍 PYTHONPATH'
|
||||
env:
|
||||
F4PGA_INSTALL_DIR: /opt/f4pga
|
||||
F4PGA_FAM: xc7
|
||||
FPGA_FAM: xc7
|
||||
|
||||
steps:
|
||||
|
||||
|
@ -205,7 +205,7 @@ jobs:
|
|||
name: '🐍 Python wrappers'
|
||||
env:
|
||||
F4PGA_INSTALL_DIR: /opt/f4pga
|
||||
F4PGA_FAM: xc7
|
||||
FPGA_FAM: xc7
|
||||
|
||||
steps:
|
||||
|
||||
|
|
|
@ -11,10 +11,7 @@ case "$1" in
|
|||
;;
|
||||
share)
|
||||
(
|
||||
case "$F4PGA_FAM" in
|
||||
xc7) cd $(dirname "$0")/../share/symbiflow;;
|
||||
eos-s3) cd $(dirname "$0")/../share;;
|
||||
esac
|
||||
cd $(dirname "$0")/../share/symbiflow
|
||||
pwd
|
||||
)
|
||||
;;
|
||||
|
|
|
@ -23,7 +23,7 @@ from typing import List
|
|||
from setuptools import setup as setuptools_setup
|
||||
|
||||
from os import environ
|
||||
F4PGA_FAM = environ.get('F4PGA_FAM', 'xc7')
|
||||
FPGA_FAM = environ.get('FPGA_FAM', 'xc7')
|
||||
|
||||
|
||||
packagePath = Path(__file__).resolve().parent
|
||||
|
@ -61,13 +61,23 @@ wrapper_entrypoints = [
|
|||
f"{sf}_synth = {shwrappers}:synth",
|
||||
f"{sf}_write_bitstream = {shwrappers}:write_bitstream",
|
||||
f"{sf}_write_fasm = {shwrappers}:write_fasm",
|
||||
] if F4PGA_FAM == 'xc7' else [
|
||||
] if FPGA_FAM == 'xc7' else [
|
||||
f"{sf}_synth = {shwrappers}:synth",
|
||||
f"{sf}_pack = {shwrappers}:pack",
|
||||
f"{sf}_repack = {shwrappers}:repack",
|
||||
f"{sf}_place = {shwrappers}:place",
|
||||
f"{sf}_route = {shwrappers}:route",
|
||||
f"{sf}_write_fasm = {shwrappers}:write_fasm",
|
||||
f"{sf}_generate_bitstream = {shwrappers}:generate_bitstream",
|
||||
f"{sf}_generate_constraints = {shwrappers}:generate_constraints",
|
||||
f"{sf}_analysis = {shwrappers}:analysis",
|
||||
f"{sf}_fasm2bels = {shwrappers}:fasm2bels",
|
||||
f"ql_{sf} = {shwrappers}:ql",
|
||||
f"vpr_common = {shwrappers}:vpr_common",
|
||||
]
|
||||
|
||||
|
||||
|
||||
setuptools_setup(
|
||||
name=packagePath.name,
|
||||
version="0.0.0",
|
||||
|
|
|
@ -28,17 +28,17 @@ from subprocess import check_call
|
|||
f4pga_environ = environ.copy()
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
F4PGA_FAM = f4pga_environ.get('F4PGA_FAM', 'xc7')
|
||||
isQuickLogic = F4PGA_FAM == 'eos-s3'
|
||||
SH_SUBDIR = 'quicklogic' if isQuickLogic else F4PGA_FAM
|
||||
FPGA_FAM = f4pga_environ.get('FPGA_FAM', 'xc7')
|
||||
isQuickLogic = FPGA_FAM == 'eos-s3'
|
||||
SH_SUBDIR = 'quicklogic' if isQuickLogic else FPGA_FAM
|
||||
|
||||
F4PGA_INSTALL_DIR = f4pga_environ.get('F4PGA_INSTALL_DIR')
|
||||
if F4PGA_INSTALL_DIR is None:
|
||||
raise(Exception("Required environment variable F4PGA_INSTALL_DIR is undefined!"))
|
||||
F4PGA_INSTALL_DIR_PATH = Path(F4PGA_INSTALL_DIR)
|
||||
|
||||
f4pga_environ['F4PGA_ENV_BIN'] = f4pga_environ.get('F4PGA_ENV_BIN', str(F4PGA_INSTALL_DIR_PATH / F4PGA_FAM / 'conda/bin'))
|
||||
f4pga_environ['F4PGA_ENV_SHARE'] = f4pga_environ.get('F4PGA_ENV_SHARE', str(F4PGA_INSTALL_DIR_PATH / F4PGA_FAM / (
|
||||
f4pga_environ['F4PGA_ENV_BIN'] = f4pga_environ.get('F4PGA_ENV_BIN', str(F4PGA_INSTALL_DIR_PATH / FPGA_FAM / 'conda/bin'))
|
||||
f4pga_environ['F4PGA_ENV_SHARE'] = f4pga_environ.get('F4PGA_ENV_SHARE', str(F4PGA_INSTALL_DIR_PATH / FPGA_FAM / (
|
||||
'share' if isQuickLogic else 'install/share/symbiflow'
|
||||
)))
|
||||
|
||||
|
@ -117,3 +117,8 @@ def generate_libfile():
|
|||
def ql():
|
||||
print("[F4PGA] Running (deprecated) ql")
|
||||
run_sh(ROOT / "quicklogic/ql.f4pga.sh")
|
||||
|
||||
|
||||
def fasm2bels():
|
||||
print("[F4PGA] Running (deprecated) fasm2bels")
|
||||
run_sh(ROOT / "quicklogic/fasm2bels.f4pga.sh")
|
||||
|
|
|
@ -20,21 +20,14 @@ set -e
|
|||
|
||||
if [ -z $VPRPATH ]; then
|
||||
export VPRPATH="$F4PGA_ENV_BIN"
|
||||
export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH}
|
||||
export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH}
|
||||
fi
|
||||
|
||||
source ${VPRPATH}/vpr_common
|
||||
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 --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
|
||||
|
||||
python3 "$F4PGA_ENV_BIN"/python/vpr_fixup_post_synth.py \
|
||||
--vlog-in ${TOP}_post_synthesis.v \
|
||||
--vlog-out ${TOP}_post_synthesis.v \
|
||||
--sdf-in ${TOP}_post_synthesis.sdf \
|
||||
--sdf-out ${TOP}_post_synthesis.sdf \
|
||||
--split-ports
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2020-2022 F4PGA Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
echo -e "\e[1;34mInstallation starting for conda based symbiflow\e[0m"
|
||||
echo -e "\e[1;34mQuickLogic Corporation\e[0m"
|
||||
|
||||
if [ -z "$INSTALL_DIR" ]
|
||||
then
|
||||
echo -e "\e[1;31m\$INSTALL_DIR is not set, please set and then proceed!\e[0m"
|
||||
echo -e "\e[1;31mExample: \"export INSTALL_DIR=/<custom_location>\". \e[0m"
|
||||
exit 0
|
||||
elif [ -d "$INSTALL_DIR/conda" ]; then
|
||||
echo -e "\e[1;32m $INSTALL_DIR/conda already exists, please clean up and re-install ! \e[0m"
|
||||
exit 0
|
||||
else
|
||||
echo -e "\e[1;32m\$INSTALL_DIR is set to $INSTALL_DIR ! \e[0m"
|
||||
fi
|
||||
|
||||
mkdir -p $INSTALL_DIR
|
||||
|
||||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
|
||||
bash conda_installer.sh -b -p $INSTALL_DIR/conda && rm conda_installer.sh
|
||||
source "$INSTALL_DIR/conda/etc/profile.d/conda.sh"
|
||||
echo "include-system-site-packages=false" >> $INSTALL_DIR/conda/pyvenv.cfg
|
||||
CONDA_FLAGS="-y --override-channels -c defaults -c conda-forge"
|
||||
conda update $CONDA_FLAGS -q conda
|
||||
curl $(curl https://storage.googleapis.com/symbiflow-arch-defs-install/latest-qlf) > arch.tar.gz
|
||||
tar -C $INSTALL_DIR -xvf arch.tar.gz && rm arch.tar.gz
|
||||
conda install $CONDA_FLAGS -c litex-hub/label/main yosys="0.9_5266_g0fb4224e 20210301_104249_py37"
|
||||
conda install $CONDA_FLAGS -c litex-hub/label/main symbiflow-yosys-plugins="1.0.0_7_338_g93157fb=20210507_125510"
|
||||
conda install $CONDA_FLAGS -c litex-hub/label/main vtr-optimized="8.0.0_3614_gb3b34e77a 20210507_125510"
|
||||
conda install $CONDA_FLAGS -c litex-hub iverilog
|
||||
conda install $CONDA_FLAGS -c tfors gtkwave
|
||||
conda install $CONDA_FLAGS make lxml simplejson intervaltree git pip
|
||||
conda activate
|
||||
pip install python-constraint
|
||||
pip install serial
|
||||
pip install git+https://github.com/QuickLogic-Corp/ql_fasm@e5d0915
|
||||
conda deactivate
|
||||
setup_file=$INSTALL_DIR/setup.sh
|
||||
echo "export INSTALL_DIR=$INSTALL_DIR" >$setup_file
|
||||
chmod 755 $setup_file
|
||||
|
||||
# Adding symbiflow toolchain binaries to PATH
|
||||
echo "export PATH=\"\$INSTALL_DIR/quicklogic-arch-defs/bin:\$INSTALL_DIR/quicklogic-arch-defs/bin/python:\$PATH\"" >>$setup_file
|
||||
echo "source \"\$INSTALL_DIR/conda/etc/profile.d/conda.sh\"" >>$setup_file
|
||||
echo "conda activate" >>$setup_file
|
|
@ -0,0 +1,93 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2020-2022 F4PGA Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"}
|
||||
BIN_DIR_PATH=${BIN_DIR_PATH:="$F4PGA_ENV_BIN"}
|
||||
|
||||
OPTS=d:P:p:b:
|
||||
LONGOPTS=device:,part:,pcf:,bit:,
|
||||
|
||||
PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- "$@"`
|
||||
eval set -- "${PARSED_OPTS}"
|
||||
|
||||
DEVICE=""
|
||||
PART=""
|
||||
PCF=""
|
||||
BIT=""
|
||||
|
||||
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
|
||||
;;
|
||||
--)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z $DEVICE ]; then
|
||||
echo "Please provide device name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z $BIT ]; then
|
||||
echo "Please provide an input bistream file name"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Run fasm2bels
|
||||
if [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then
|
||||
|
||||
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"
|
||||
QCF_FILE="${BIT}.v.qcf"
|
||||
|
||||
if [ ! -z "{PCF}" ]; then
|
||||
PCF_ARGS="--input-pcf ${PCF}"
|
||||
else
|
||||
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}
|
||||
|
||||
else
|
||||
|
||||
echo "ERROR: Unsupported device '${DEVICE}' for fasm2bels"
|
||||
exit -1
|
||||
fi
|
|
@ -18,8 +18,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
OPTS=d:f:r:b:
|
||||
LONGOPTS=device:,fasm:,format:,bit:
|
||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"}
|
||||
OPTS=d:f:r:b:P:
|
||||
LONGOPTS=device:,fasm:,format:,bit:,part:
|
||||
|
||||
PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- "$@"`
|
||||
eval set -- "${PARSED_OPTS}"
|
||||
|
@ -28,6 +29,7 @@ DEVICE=""
|
|||
FASM=""
|
||||
BIT=""
|
||||
BIT_FORMAT="4byte"
|
||||
PART=""
|
||||
|
||||
while true; do
|
||||
case "$1" in
|
||||
|
@ -35,6 +37,7 @@ while true; do
|
|||
-f|--fasm) FASM=$2; shift 2;;
|
||||
-r|--format) BIT_FORMAT=$2; shift 2;;
|
||||
-b|--bit) BIT=$2; shift 2;;
|
||||
-P|--part) PART=$2; shift 2;;
|
||||
--) break;;
|
||||
esac
|
||||
done
|
||||
|
@ -56,4 +59,14 @@ fi
|
|||
|
||||
DB_ROOT="$F4PGA_ENV_SHARE"/fasm_database/${DEVICE}
|
||||
|
||||
`which qlf_fasm` --db-root ${DB_ROOT} --format ${BIT_FORMAT} --assemble $FASM $BIT
|
||||
# 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
|
||||
elif [[ "$DEVICE" =~ ^(ql-eos-s3|ql-pp3e)$ ]]; then
|
||||
qlfasm --dev-type ${DEVICE} ${FASM} ${BIT}
|
||||
else
|
||||
echo "ERROR: Unsupported device '${DEVICE}' for bitstream generation"
|
||||
exit -1
|
||||
fi
|
||||
|
|
|
@ -26,27 +26,74 @@ DEVICE=$5
|
|||
ARCH_DEF=$6
|
||||
CORNER=$7
|
||||
|
||||
if [[ "$DEVICE" =~ ^(qlf_k4n8_qlf_k4n8)$ ]];then
|
||||
DEVICE_1="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"
|
||||
PINMAPXML="pinmap_qlf_k6n10_gf12.xml"
|
||||
else
|
||||
DEVICE_1=${DEVICE}
|
||||
fi
|
||||
|
||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"}
|
||||
|
||||
PINMAP_XML=`realpath ${SHARE_DIR_PATH}/arch/${DEVICE_1}_${DEVICE_1}/${PINMAPXML}`
|
||||
|
||||
PROJECT=$(basename -- "$EBLIF")
|
||||
IOPLACE_FILE="${PROJECT%.*}_io.place"
|
||||
|
||||
python3 $(realpath "$F4PGA_ENV_BIN"/python/create_ioplace.py) \
|
||||
--pcf $PCF \
|
||||
--blif $EBLIF \
|
||||
--pinmap_xml $PINMAP_XML \
|
||||
--csv_file $PART \
|
||||
--net $NET \
|
||||
> ${IOPLACE_FILE}
|
||||
BIN_DIR_PATH=${BIN_DIR_PATH:="$F4PGA_ENV_BIN"}
|
||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"}
|
||||
|
||||
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}
|
||||
PINMAPXML="pinmap_qlf_k4n8_umc22.xml"
|
||||
elif [[ "$DEVICE" =~ ^(qlf_k6n10_qlf_k6n10)$ ]];then
|
||||
DEVICE_1="qlf_k6n10-qlf_k6n10_gf12"
|
||||
DEVICE_2=${DEVICE_1}
|
||||
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 ${BIN_DIR_PATH}/python/qlf_k4n8_create_ioplace.py`
|
||||
|
||||
${PYTHON3} ${IOGEN} --pcf $PCF --blif $EBLIF --pinmap_xml $PINMAP_XML --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"
|
||||
else
|
||||
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}`
|
||||
|
||||
IOGEN=`realpath ${BIN_DIR_PATH}/python/pp3_create_ioplace.py`
|
||||
PLACEGEN=`realpath ${BIN_DIR_PATH}/python/pp3_create_place_constraints.py`
|
||||
|
||||
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}
|
||||
|
||||
# EOS-S3 IOMUX configuration
|
||||
if [[ "$DEVICE" =~ ^(ql-eos-s3)$ ]]; then
|
||||
|
||||
IOMUXGEN=`realpath ${BIN_DIR_PATH}/python/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}
|
||||
fi
|
||||
|
||||
else
|
||||
echo "FIXME: Unsupported device '${DEVICE}'"
|
||||
exit -1
|
||||
fi
|
||||
|
|
|
@ -34,7 +34,7 @@ fi
|
|||
ARCH_DIR="$F4PGA_ENV_SHARE"/arch/${DEVICE_1}_${DEVICE_1}
|
||||
PINMAP_XML=${ARCH_DIR}/${PINMAPXML}
|
||||
|
||||
python3 "$F4PGA_ENV_BIN"/python/create_lib.py \
|
||||
`which python3` "$F4PGA_ENV_BIN"/python/create_lib.py \
|
||||
-n ${DEV}_0P72_SSM40 \
|
||||
-m fpga_top \
|
||||
-c $PART \
|
||||
|
|
|
@ -20,14 +20,14 @@ set -e
|
|||
|
||||
if [ -z $VPRPATH ]; then
|
||||
export VPRPATH="$F4PGA_ENV_BIN"
|
||||
export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH}
|
||||
export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH}
|
||||
fi
|
||||
|
||||
source ${VPRPATH}/vpr_common
|
||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||
parse_args $@
|
||||
|
||||
export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log
|
||||
|
||||
run_vpr --pack
|
||||
run_vpr --pack --write_block_usage block_usage.json
|
||||
|
||||
mv vpr_stdout.log pack.log
|
||||
|
|
|
@ -20,10 +20,10 @@ set -e
|
|||
|
||||
if [ -z $VPRPATH ]; then
|
||||
export VPRPATH="$F4PGA_ENV_BIN"
|
||||
export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH}
|
||||
export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH}
|
||||
fi
|
||||
|
||||
source ${VPRPATH}/vpr_common
|
||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||
parse_args $@
|
||||
|
||||
if [ -z $PCF ]; then
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
|
||||
set -e
|
||||
|
||||
BUILDDIR=build
|
||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"}
|
||||
|
||||
source "$F4PGA_ENV_BIN"/vpr_common
|
||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||
|
||||
VERSION="v2.0.1"
|
||||
|
||||
if [ ! -n $1 ]; then
|
||||
echo "Please enter a valid command: Refer help ql_symbiflow --help"
|
||||
exit 0
|
||||
exit 1
|
||||
elif [[ $1 == "-synth" || $1 == "-compile" ]]; then
|
||||
echo -e "----------------- \n"
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]];then
|
||||
|
@ -35,13 +35,14 @@ elif [[ $1 == "-h" || $1 == "--help" ]];then
|
|||
\t>ql_symbiflow -synth -src <source_dir path> -d <device> -P <pinmap csv file> -t <top module name> -v <verilog file/files> -p <pcf file>\n\
|
||||
To run synthesis, pack, place and route:\n\
|
||||
\t>ql_symbiflow -compile -src <source_dir path> -d <device> -P <pinmap csv file> -t <top module name> -v <verilog file/files> -p <pcf file> -P <pinmap csv file> -s <SDC file> \n\
|
||||
Device supported:qlf_k4n8" || exit
|
||||
Devices supported: ql-eos-s3, qlf_k4n8 \n\
|
||||
Support temporarily disabled for: ql-pp3, qlf_k6n10" || exit
|
||||
elif [[ $1 == "-v" || $1 == "--version" ]];then
|
||||
echo "Symbiflow Tool Version : ${VERSION}"
|
||||
exit
|
||||
exit 0
|
||||
else
|
||||
echo -e "Please provide a valid command : Refer -h/--help\n"
|
||||
exit
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
@ -61,8 +62,11 @@ JSON=""
|
|||
PNR_CORNER="slow"
|
||||
ANALYSIS_CORNER="slow"
|
||||
COMPILE_EXTRA_ARGS=()
|
||||
|
||||
BUILDDIR="build"
|
||||
DEVICE_CHECK="INVALID"
|
||||
OPT=""
|
||||
RUN_TILL=""
|
||||
|
||||
for arg in $@; do
|
||||
case $arg in
|
||||
-src|--source) OPT="src" ;;
|
||||
|
@ -80,6 +84,7 @@ for arg in $@; do
|
|||
-synth|-compile) OPT="synth" ;;
|
||||
-y|+incdir+*|+libext+*|+define+*) OPT="compile_xtra" ;;
|
||||
-f) OPT="options_file" ;;
|
||||
-build_dir) OPT="build_dir" ;;
|
||||
-h|--help) exit 0 ;;
|
||||
*)
|
||||
case $OPT in
|
||||
|
@ -135,6 +140,10 @@ for arg in $@; do
|
|||
options_file)
|
||||
COMPILE_EXTRA_ARGS+=("-f \"`realpath $arg`\" ")
|
||||
;;
|
||||
build_dir)
|
||||
BUILDDIR=$arg
|
||||
OPT=""
|
||||
;;
|
||||
*)
|
||||
echo "Refer help for more details: ql_symbiflow -h "
|
||||
exit 1
|
||||
|
@ -151,10 +160,20 @@ case ${DEVICE} in
|
|||
qlf_k4n8)
|
||||
DEVICE="${DEVICE}_${DEVICE}"
|
||||
FAMILY="qlf_k4n8"
|
||||
DEVICE_CHECK="VALID"
|
||||
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}'"
|
||||
|
@ -181,7 +200,7 @@ else
|
|||
if [ -f $SOURCE/v_list_tmp ];then
|
||||
rm -f $SOURCE/v_list_tmp
|
||||
fi
|
||||
if [ $VERILOG_FILES == "*.v" ];then
|
||||
if [ "$VERILOG_FILES" == "*.v" ];then
|
||||
VERILOG_FILES=`cd ${SOURCE};ls *.v`
|
||||
fi
|
||||
echo "$VERILOG_FILES" >${SOURCE}/v_list
|
||||
|
@ -202,30 +221,21 @@ else
|
|||
fi
|
||||
|
||||
if [[ $1 == "-compile" || $1 == "-post_verilog" ]]; then
|
||||
# Allow no PCF/pinmap for some devices
|
||||
if [[ ! "$DEVICE" =~ ^(qlf_k4n8_qlf_k4n8)$ ]]; then
|
||||
if [ -z "$PCF" ]; then
|
||||
echo "PCF file option is missing. Refer -h/--help"
|
||||
exit 1
|
||||
elif ! [ -f "$SOURCE/$PCF" ]; then
|
||||
echo "The pcf file: $PCF is missing at: $SOURCE"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if [ -z "$DEVICE" ]; then
|
||||
echo "DEVICE name is missing. Refer -h/--help"
|
||||
exit 1
|
||||
elif ! [[ "$DEVICE" =~ ^(qlf_k4n8_qlf_k4n8)$ ]]; then
|
||||
echo "Invalid Device name, supported qlf_k4n8"
|
||||
elif ! [[ "$DEVICE_CHECK" =~ ^(VALID)$ ]]; then
|
||||
echo "Invalid Device name, supported: ql-eos-s3, qlf_k4n8 \n\
|
||||
Support temporarily disabled for: qlf_k6n10"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$TOP" ]; then
|
||||
echo "TOP module name is missing. Refer -h/--help"
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$DEVICE" =~ ^(qlf_k4n8_qlf_k4n8)$ ]]; then
|
||||
if [[ "$DEVICE_CHECK" =~ ^(VALID)$ ]]; then
|
||||
if [ -z "$PART" ]; then
|
||||
if [ -n "$PCF" ];then
|
||||
if [[ -n "$PCF" && $USE_PINMAP -ne 0 ]]; then
|
||||
echo "Error: pcf file cannot be used without declaring PINMAP CSV file"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -272,12 +282,19 @@ if [ -f "$SOURCE/v_list_tmp" ]; then
|
|||
fi
|
||||
|
||||
# FIXME: Some devices do not have fasm2bels yet
|
||||
# FIXME: Some device do not support bitstream generation yet
|
||||
RUN_TILL=""
|
||||
if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then
|
||||
HAVE_FASM2BELS=0
|
||||
RUN_TILL="bit"
|
||||
else
|
||||
elif [[ "$DEVICE" =~ ^(qlf_k6n10.*)$ ]]; then
|
||||
HAVE_FASM2BELS=0
|
||||
RUN_TILL="route"
|
||||
elif [[ "$DEVICE" =~ ^(ql-eos-s3)$ ]]; then
|
||||
HAVE_FASM2BELS=1
|
||||
RUN_TILL="bit"
|
||||
else
|
||||
HAVE_FASM2BELS=0
|
||||
RUN_TILL="route"
|
||||
fi
|
||||
|
||||
|
@ -290,7 +307,6 @@ fi
|
|||
|
||||
export PCF_FILE=$PCF
|
||||
export JSON=$JSON
|
||||
export TOP_F=$TOP
|
||||
export PINMAP_FILE=$PINMAPCSV
|
||||
export MAX_CRITICALITY=$MAX_CRITICALITY
|
||||
|
||||
|
@ -302,7 +318,7 @@ else
|
|||
CURR_DIR="${PWD}/${SOURCE}"
|
||||
fi
|
||||
|
||||
if [ -n "$PART" ]; then
|
||||
if [[ -n "$PART" && $USE_PINMAP -ne 0 ]]; then
|
||||
if [[ -f $SOURCE/$PART ]];then
|
||||
CSV_PATH=`realpath $SOURCE/$PART`
|
||||
elif [[ -f $PART ]];then
|
||||
|
@ -327,7 +343,11 @@ elif [[ -f $PCF ]];then
|
|||
PCF_PATH=`realpath $PCF`
|
||||
fi
|
||||
|
||||
export PART=${CSV_PATH}
|
||||
if [[ $USE_PINMAP -ne 0 ]]; then
|
||||
export PART=${CSV_PATH}
|
||||
else
|
||||
export PART=${PART}
|
||||
fi
|
||||
export JSON=${JSON_PATH}
|
||||
export PCF_PATH=${PCF_PATH}
|
||||
|
||||
|
@ -337,8 +357,8 @@ LOG_FILE=${CURR_DIR}/${BUILDDIR}/${TOP}.log
|
|||
if [ -f "$SOURCE"/$PCF_FILE ];then
|
||||
PCF_MAKE="\${current_dir}/$PCF_FILE"
|
||||
else
|
||||
touch ${CURR_DIR}/build/${TOP}_dummy.pcf
|
||||
PCF_MAKE="\${current_dir}/build/${TOP}_dummy.pcf"
|
||||
touch ${CURR_DIR}/${BUILDDIR}/${TOP}_dummy.pcf
|
||||
PCF_MAKE="\${current_dir}/${BUILDDIR}/${TOP}_dummy.pcf"
|
||||
fi
|
||||
|
||||
PROCESS_SDC=$(realpath "$F4PGA_ENV_BIN"/python/process_sdc_constraints.py)
|
||||
|
@ -350,15 +370,15 @@ if ! [ -z "$SDC" ]; then
|
|||
SDC_MAKE="$SOURCE/$SDC"
|
||||
fi
|
||||
else
|
||||
touch ${CURR_DIR}/build/${TOP}_dummy.sdc
|
||||
SDC_MAKE="\${current_dir}/build/${TOP}_dummy.sdc"
|
||||
touch ${CURR_DIR}/${BUILDDIR}/${TOP}_dummy.sdc
|
||||
SDC_MAKE="\${current_dir}/${BUILDDIR}/${TOP}_dummy.sdc"
|
||||
fi
|
||||
|
||||
if ! [ -z "$CSV_PATH" ]; then
|
||||
CSV_MAKE=$CSV_PATH
|
||||
else
|
||||
touch ${CURR_DIR}/build/${TOP}_dummy.csv
|
||||
CSV_MAKE="\${current_dir}/build/${TOP}_dummy.csv"
|
||||
touch ${CURR_DIR}/${BUILDDIR}/${TOP}_dummy.csv
|
||||
CSV_MAKE="\${current_dir}/${BUILDDIR}/${TOP}_dummy.csv"
|
||||
fi
|
||||
|
||||
echo -e ".PHONY:\${BUILDDIR}\n
|
||||
|
@ -375,7 +395,7 @@ PNR_CORNER := $ANALYSIS_CORNER\n\
|
|||
PCF := $PCF_MAKE\n\
|
||||
PINMAP_CSV := $CSV_MAKE\n\
|
||||
SDC_IN := $SDC_MAKE\n\
|
||||
BUILDDIR := build\n\n\
|
||||
BUILDDIR := $BUILDDIR\n\n\
|
||||
SDC := \${current_dir}/\${BUILDDIR}/\${TOP}.sdc
|
||||
|
||||
all: \${BUILDDIR}/\${TOP}.${RUN_TILL}\n\
|
||||
|
@ -384,10 +404,11 @@ all: \${BUILDDIR}/\${TOP}.${RUN_TILL}\n\
|
|||
ifneq (\"\$(wildcard \$(HEX_FILES))\",\"\")\n\
|
||||
\$(shell cp \${current_dir}/*.hex \${BUILDDIR})\n\
|
||||
endif\n\
|
||||
cd \${BUILDDIR} && symbiflow_synth -t \${TOP} -v \${VERILOG} -F \${FAMILY} -d \${DEVICE} -p \${PCF} ${COMPILE_EXTRA_ARGS[*]} > $LOG_FILE 2>&1\n\
|
||||
cd \${BUILDDIR} && symbiflow_synth -t \${TOP} -v \${VERILOG} -F \${FAMILY} -d \${DEVICE} -p \${PCF} -P \${PART} ${COMPILE_EXTRA_ARGS[*]} > $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
\${BUILDDIR}/\${TOP}.sdc: \${BUILDDIR}/\${TOP}.eblif\n\
|
||||
python3 ${PROCESS_SDC} --sdc-in \${SDC_IN} --sdc-out \$@ --pcf \${PCF} --eblif \${BUILDDIR}/\${TOP}.eblif --pin-map \${PINMAP_CSV}\n\
|
||||
\n\
|
||||
\${BUILDDIR}/\${TOP}.net: \${BUILDDIR}/\${TOP}.eblif \${BUILDDIR}/\${TOP}.sdc\n\
|
||||
cd \${BUILDDIR} && symbiflow_pack -e \${TOP}.eblif -f \${FAMILY} -d \${DEVICE} -s \${SDC} -c \${PNR_CORNER} >> $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
|
@ -418,7 +439,11 @@ fi
|
|||
\n\
|
||||
\${BUILDDIR}/\${TOP}.fasm: \${BUILDDIR}/\${TOP_FINAL}.route\n\
|
||||
cd \${BUILDDIR} && symbiflow_write_fasm -e \${TOP_FINAL}.eblif -f \${FAMILY} -d \${DEVICE} -s \${SDC} -c \${PNR_CORNER} >> $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
" >>$MAKE_FILE
|
||||
|
||||
# Bitstream
|
||||
if [ "$FAMILY" == "qlf_k4n8" ]; then
|
||||
echo -e "\
|
||||
\${BUILDDIR}/\${TOP}.bit: \${BUILDDIR}/\${TOP}.fasm\n\
|
||||
cd \${BUILDDIR} && symbiflow_generate_bitstream -d \${FAMILY} -f \${TOP}.fasm -r 4byte -b \${TOP}.bit >> $LOG_FILE 2>&1\n\
|
||||
cd \${BUILDDIR} && symbiflow_generate_bitstream -d \${FAMILY} -f \${TOP}.fasm -r txt -b \${TOP}.bin >> $LOG_FILE 2>&1\n\
|
||||
|
@ -427,16 +452,43 @@ fi
|
|||
cd \${BUILDDIR} && symbiflow_generate_libfile \${PARTNAME} \${DEVICE} \${PNR_CORNER} >> $LOG_FILE 2>&1\n\
|
||||
" >>$MAKE_FILE
|
||||
|
||||
elif [ "$FAMILY" == "pp3" ]; then
|
||||
echo -e "\
|
||||
\${BUILDDIR}/\${TOP}.bit: \${BUILDDIR}/\${TOP}.fasm\n\
|
||||
cd \${BUILDDIR} && symbiflow_generate_bitstream -d \${DEVICE} -f \${TOP}.fasm -P \${PARTNAME} -b \${TOP}.bit >> $LOG_FILE 2>&1\n\
|
||||
" >>$MAKE_FILE
|
||||
fi
|
||||
|
||||
# EOS-S3 specific targets
|
||||
if [ "$DEVICE" == "ql-eos-s3" ]; then
|
||||
echo -e "\
|
||||
\${BUILDDIR}/\${TOP}_bit.h: \${BUILDDIR}/\${TOP}.bit\n\
|
||||
symbiflow_write_bitheader \$^ \$@ >> $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
\${BUILDDIR}/\${TOP}.bin: \${BUILDDIR}/\${TOP}.bit\n\
|
||||
symbiflow_write_binary \$^ \$@ >> $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
\${BUILDDIR}/\${TOP}.jlink: \${BUILDDIR}/\${TOP}.bit\n\
|
||||
symbiflow_write_jlink \$^ \$@ >> $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
\${BUILDDIR}/\${TOP}.openocd: \${BUILDDIR}/\${TOP}.bit\n\
|
||||
symbiflow_write_openocd \$^ \$@ >> $LOG_FILE 2>&1\n\
|
||||
\n\
|
||||
" >>$MAKE_FILE
|
||||
fi
|
||||
|
||||
# fasm2bels
|
||||
if [ "$HAVE_FASM2BELS" != 0 ]; then
|
||||
echo -e "\
|
||||
cd \${BUILDDIR} && symbiflow_write_fasm2bels -e \${TOP}.eblif -d \${DEVICE} -p \${PCF} -n \${TOP}.net -P \${PARTNAME}\n\
|
||||
\${BUILDDIR}/\${TOP}.bit.v: \${BUILDDIR}/\${TOP}.bit\n\
|
||||
cd \${BUILDDIR} && symbiflow_fasm2bels -b \${TOP}.bit -d \${DEVICE} -p \${PCF} -P \${PARTNAME} >> $LOG_FILE 2>&1\n\
|
||||
" >>$MAKE_FILE
|
||||
fi
|
||||
|
||||
echo -e "\
|
||||
clean:\n\
|
||||
rm -rf \${BUILDDIR}\n\
|
||||
" >>$MAKE_FILE
|
||||
" >>$MAKE_FILE
|
||||
|
||||
## Remove temporary files
|
||||
rm -f $SOURCE/f_list_temp $SOURCE/v_list_tmp $SOURCE/v_list
|
||||
|
@ -444,14 +496,31 @@ rm -f $SOURCE/f_list_temp $SOURCE/v_list_tmp $SOURCE/v_list
|
|||
## Make file Targets
|
||||
if [ $1 == "-synth" ]; then
|
||||
echo -e "Performing Synthesis "
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.eblif || exit
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.eblif || (cat $LOG_FILE && exit 1)
|
||||
elif [[ ! -z "$OUT" && $1 == "-compile" ]];then
|
||||
if [[ " ${OUT_ARR[@]} " =~ " post_verilog " ]];then
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.post_v || exit
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.post_v || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
if [ "$DEVICE" == "ql-eos-s3" ]; then
|
||||
if [[ " ${OUT_ARR[@]} " =~ " jlink " ]]; then
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.jlink || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
if [[ " ${OUT_ARR[@]} " =~ " openocd " ]]; then
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.openocd || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
if [[ " ${OUT_ARR[@]} " =~ " post_verilog " ]]; then
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.bit.v || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
if [[ " ${OUT_ARR[@]} " =~ " header " ]]; then
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}_bit.h || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
if [[ " ${OUT_ARR[@]} " =~ " binary " ]]; then
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.bin || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if [ $1 == "-compile" ]; then
|
||||
echo -e "Running Synth->Pack->Place->Route->FASM->bitstream"
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.${RUN_TILL} || exit
|
||||
cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.${RUN_TILL} || (cat $LOG_FILE && exit 1)
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -20,10 +20,9 @@ set -e
|
|||
|
||||
if [ -z $VPRPATH ]; then
|
||||
export VPRPATH="$F4PGA_ENV_BIN"
|
||||
export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH}
|
||||
fi
|
||||
|
||||
source ${VPRPATH}/vpr_common
|
||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||
parse_args $@
|
||||
|
||||
DESIGN=${EBLIF/.eblif/}
|
||||
|
@ -31,7 +30,9 @@ DESIGN=${EBLIF/.eblif/}
|
|||
[ ! -z "${JSON}" ] && JSON_ARGS="--json-constraints ${JSON}" || JSON_ARGS=
|
||||
[ ! -z "${PCF_PATH}" ] && PCF_ARGS="--pcf-constraints ${PCF_PATH}" || PCF_ARGS=
|
||||
|
||||
python3 "$F4PGA_ENV_BIN"/python/repacker/repack.py \
|
||||
export PYTHONPATH=$F4PGA_ENV_BIN/python:$PYTHONPATH
|
||||
|
||||
`which python3` "$F4PGA_ENV_BIN"/python/repacker/repack.py \
|
||||
--vpr-arch ${ARCH_DEF} \
|
||||
--repacking-rules ${ARCH_DIR}/${DEVICE_1}.repacking_rules.json \
|
||||
$JSON_ARGS \
|
||||
|
|
|
@ -20,14 +20,14 @@ set -e
|
|||
|
||||
if [ -z $VPRPATH ]; then
|
||||
export VPRPATH="$F4PGA_ENV_BIN"
|
||||
export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH}
|
||||
export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH}
|
||||
fi
|
||||
|
||||
source ${VPRPATH}/vpr_common
|
||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||
parse_args $@
|
||||
|
||||
export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log
|
||||
|
||||
run_vpr --route
|
||||
run_vpr --route --write_timing_summary timing_summary.json
|
||||
|
||||
mv vpr_stdout.log route.log
|
||||
|
|
|
@ -134,9 +134,13 @@ export SYNTH_JSON=${TOP}_io.json
|
|||
export OUT_SYNTH_V=${TOP}_synth.v
|
||||
export OUT_EBLIF=${TOP}.eblif
|
||||
export OUT_FASM_EXTRA=${TOP}_fasm_extra.fasm
|
||||
export PYTHON3=$(which python3)
|
||||
export UTILS_PATH=${VPRPATH}/python/
|
||||
|
||||
if [ -s $PCF ]; then
|
||||
export PCF_FILE=$PCF
|
||||
else
|
||||
export PCF_FILE=""
|
||||
fi
|
||||
|
||||
DEVICE_PATH="${SHARE_DIR_PATH}/arch/${DEVICE}_${DEVICE}"
|
||||
|
@ -174,6 +178,6 @@ if [ ! -z "${YOSYS_COMMANDS}" ]; then
|
|||
YOSYS_SCRIPT="$YOSYS_COMMANDS; $YOSYS_SCRIPT"
|
||||
fi
|
||||
|
||||
yosys -p "${YOSYS_SCRIPT}" -l $LOG
|
||||
python3 ${SPLIT_INOUTS} -i ${OUT_JSON} -o ${SYNTH_JSON}
|
||||
yosys -p "read_json $SYNTH_JSON; tcl ${CONV_TCL_PATH}"
|
||||
`which yosys` -p "${YOSYS_SCRIPT}" -l $LOG
|
||||
`which python3` ${SPLIT_INOUTS} -i ${OUT_JSON} -o ${SYNTH_JSON}
|
||||
`which yosys` -p "read_json $SYNTH_JSON; tcl ${CONV_TCL_PATH}"
|
||||
|
|
|
@ -16,6 +16,18 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_ENV_SHARE"}
|
||||
|
||||
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
|
||||
"
|
||||
fi
|
||||
|
||||
function parse_args {
|
||||
|
||||
OPTS=d:f:e:p:n:P:j:s:t:c:
|
||||
|
@ -109,40 +121,76 @@ 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`
|
||||
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
|
||||
|
||||
source ${VPR_CONFIG}
|
||||
|
||||
SDC_OPTIONS=""
|
||||
if [ ! -z $SDC ]
|
||||
then
|
||||
SDC_OPTIONS="--sdc_file $SDC"
|
||||
fi
|
||||
|
||||
vpr ${ARCH_DEF} \
|
||||
`which vpr` ${ARCH_DEF} \
|
||||
${EBLIF} \
|
||||
--read_rr_graph ${RR_GRAPH} \
|
||||
--device ${DEVICE_NAME} \
|
||||
${VPR_OPTIONS} \
|
||||
--read_rr_graph ${RR_GRAPH} \
|
||||
--read_placement_delay_lookup ${PLACE_DELAY} \
|
||||
--read_router_lookahead ${ROUTE_DELAY} \
|
||||
--read_placement_delay_lookup ${PLACE_DELAY} \
|
||||
${SDC_OPTIONS} \
|
||||
$@
|
||||
|
||||
|
@ -152,9 +200,7 @@ function run_vpr {
|
|||
function run_genfasm {
|
||||
set -e
|
||||
|
||||
source ${VPR_CONFIG}
|
||||
|
||||
genfasm ${ARCH_DEF} \
|
||||
`which genfasm` ${ARCH_DEF} \
|
||||
${EBLIF} \
|
||||
--device ${DEVICE_NAME} \
|
||||
${VPR_OPTIONS} \
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2020-2022 F4PGA Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
source $(dirname "$(readlink -f "$BASH_SOURCE")")/env
|
||||
|
||||
echo "Converting bitstream to flashable binary format"
|
||||
`which python3` -m quicklogic_fasm.bitstream_to_binary $@
|
9
f4pga/wrappers/sh/quicklogic/vpr_config.sh → f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh
Executable file → Normal file
9
f4pga/wrappers/sh/quicklogic/vpr_config.sh → f4pga/wrappers/sh/quicklogic/write_bitheader.f4pga.sh
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2020-2022 F4PGA Authors.
|
||||
#
|
||||
|
@ -16,4 +16,9 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
VPR_OPTIONS="@VPR_ARGS@"
|
||||
set -e
|
||||
|
||||
source $(dirname "$(readlink -f "$BASH_SOURCE")")/env
|
||||
|
||||
echo "Converting bitstream to C Header"
|
||||
`which python3` -m quicklogic_fasm.bitstream_to_header $@
|
|
@ -20,10 +20,10 @@ set -e
|
|||
|
||||
if [ -z $VPRPATH ]; then
|
||||
export VPRPATH="$F4PGA_ENV_BIN"
|
||||
export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH}
|
||||
export PYTHONPATH=${VPRPATH}/python:${PYTHONPATH}
|
||||
fi
|
||||
|
||||
source ${VPRPATH}/vpr_common
|
||||
source $(dirname "$0")/vpr_common.f4pga.sh
|
||||
parse_args "$@"
|
||||
|
||||
TOP="${EBLIF%.*}"
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2020-2022 F4PGA Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
source $(dirname "$(readlink -f "$BASH_SOURCE")")/env
|
||||
|
||||
echo "Converting bitstream to JLink script"
|
||||
`which python3` -m quicklogic_fasm.bitstream_to_jlink $@
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2020-2022 F4PGA Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
set -e
|
||||
|
||||
source $(dirname "$(readlink -f "$BASH_SOURCE")")/env
|
||||
|
||||
echo "Converting bitstream to OpenOCD script"
|
||||
`which python3` -m quicklogic_fasm.bitstream_to_openocd $@
|
Loading…
Reference in New Issue