From e895b0755e2d08b008e23ced52ca1adfff3096b6 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Sun, 24 Apr 2022 17:47:18 +0200 Subject: [PATCH] move toolchain wrappers to repo f4pga Signed-off-by: Unai Martinez-Corral --- .github/ci/install.sh | 11 +- .github/workflows/Tests.yml | 21 +- .../common/cmake/quicklogic_install.cmake | 35 -- .../conda_build_install_package.sh | 46 -- quicklogic/common/toolchain_wrappers/env | 9 - .../common/toolchain_wrappers/ql_symbiflow | 483 ------------------ .../toolchain_wrappers/symbiflow_analysis | 25 - .../symbiflow_generate_bitstream | 62 --- .../symbiflow_generate_constraints | 30 -- .../symbiflow_generate_libfile | 25 - .../common/toolchain_wrappers/symbiflow_pack | 16 - .../common/toolchain_wrappers/symbiflow_place | 50 -- .../toolchain_wrappers/symbiflow_repack | 39 -- .../common/toolchain_wrappers/symbiflow_route | 16 - .../common/toolchain_wrappers/symbiflow_synth | 163 ------ .../toolchain_wrappers/symbiflow_write_fasm | 26 - .../common/toolchain_wrappers/vpr_common | 148 ------ .../common/toolchain_wrappers/vpr_config.sh | 1 - xc/common/cmake/install.cmake | 25 - .../symbiflow_generate_constraints | 42 -- xc/xc7/toolchain_wrappers/symbiflow_pack | 12 - xc/xc7/toolchain_wrappers/symbiflow_place | 22 - xc/xc7/toolchain_wrappers/symbiflow_route | 12 - xc/xc7/toolchain_wrappers/symbiflow_synth | 128 ----- .../symbiflow_write_bitstream | 79 --- .../toolchain_wrappers/symbiflow_write_fasm | 22 - .../symbiflow_write_xml_rr_graph | 11 - xc/xc7/toolchain_wrappers/vpr_common | 168 ------ 28 files changed, 20 insertions(+), 1707 deletions(-) delete mode 100644 quicklogic/common/toolchain_wrappers/conda_build_install_package.sh delete mode 100644 quicklogic/common/toolchain_wrappers/env delete mode 100644 quicklogic/common/toolchain_wrappers/ql_symbiflow delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_analysis delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_generate_bitstream delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_generate_constraints delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_generate_libfile delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_pack delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_place delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_repack delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_route delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_synth delete mode 100644 quicklogic/common/toolchain_wrappers/symbiflow_write_fasm delete mode 100644 quicklogic/common/toolchain_wrappers/vpr_common delete mode 100644 quicklogic/common/toolchain_wrappers/vpr_config.sh delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_generate_constraints delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_pack delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_place delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_route delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_synth delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_write_bitstream delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_write_fasm delete mode 100755 xc/xc7/toolchain_wrappers/symbiflow_write_xml_rr_graph delete mode 100644 xc/xc7/toolchain_wrappers/vpr_common diff --git a/.github/ci/install.sh b/.github/ci/install.sh index 6aa3c32279..e00335ab0d 100755 --- a/.github/ci/install.sh +++ b/.github/ci/install.sh @@ -23,6 +23,15 @@ cp environment.yml install/ echo "----------------------------------------" +heading "Install f4pga CLI through pip" +{ + pip3 install https://github.com/chipsalliance/f4pga/archive/main.zip#subdirectory=f4pga + export F4PGA_FAM=xc7 + export F4PGA_ENV_BIN="$(cd $(dirname "$0")/../../env/conda/envs/symbiflow_arch_def_base/bin; pwd)" + export F4PGA_ENV_SHARE="$(cd $(dirname "$0")/../../install/share/symbiflow; pwd)" +} +echo "----------------------------------------" + heading "Running installed toolchain tests" ( pushd build @@ -44,7 +53,7 @@ heading "Compressing install dir (creating packages)" du -ah install export GIT_HASH=$(git rev-parse --short HEAD) - tar -I "pixz" -cvf symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install bin share/symbiflow/techmaps share/symbiflow/scripts environment.yml + tar -I "pixz" -cvf symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install share/symbiflow/techmaps share/symbiflow/scripts environment.yml tar -I "pixz" -cvf symbiflow-arch-defs-benchmarks-${GIT_HASH}.tar.xz -C install benchmarks for device in $(ls install/share/symbiflow/arch) do diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 1c72b05dad..52aff48f31 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -17,15 +17,15 @@ jobs: fail-fast: false matrix: test: - - 'docs' - - 'testarch' - - 'tests' - - 'ice40' - - 'xc7' - - 'xc7-vendor' - - 'xc7a200t' - - 'xc7a200t-vendor' - - 'ql' + - docs + - testarch + - tests + - ice40 + - xc7 + - xc7-vendor + - xc7a200t + - xc7a200t-vendor + - ql name: ${{ matrix.test }} @@ -53,14 +53,13 @@ jobs: Install: + needs: Test container: ubuntu:bionic runs-on: - self-hosted - Linux - X64 - needs: Test - env: MAX_CORES: 80 GHA_EXTERNAL_DISK: "tools" diff --git a/quicklogic/common/cmake/quicklogic_install.cmake b/quicklogic/common/cmake/quicklogic_install.cmake index 016c41503b..fb61345b7f 100644 --- a/quicklogic/common/cmake/quicklogic_install.cmake +++ b/quicklogic/common/cmake/quicklogic_install.cmake @@ -23,31 +23,6 @@ function(DEFINE_QL_TOOLCHAIN_TARGET) return() endif () - set(WRAPPERS - env - ql_symbiflow - symbiflow_analysis - symbiflow_generate_bitstream - symbiflow_generate_constraints - symbiflow_generate_libfile - symbiflow_pack - symbiflow_place - symbiflow_repack - symbiflow_route - symbiflow_synth - symbiflow_write_fasm - ) - - # Export VPR arguments - list(JOIN VPR_BASE_ARGS " " VPR_BASE_ARGS) - string(JOIN " " VPR_ARGS ${VPR_BASE_ARGS} "--route_chan_width ${ROUTE_CHAN_WIDTH}" ${VPR_ARCH_ARGS}) - - set(VPR_CONFIG_TEMPLATE "${symbiflow-arch-defs_SOURCE_DIR}/quicklogic/common/toolchain_wrappers/vpr_config.sh") - set(VPR_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/vpr_config.sh") - configure_file(${VPR_CONFIG_TEMPLATE} "${VPR_CONFIG}" @ONLY) - - set(VPR_COMMON "${symbiflow-arch-defs_SOURCE_DIR}/quicklogic/common/toolchain_wrappers/vpr_common") - # Add cells.sim to all deps, so it is installed with make install get_file_target(CELLS_SIM_TARGET ${DEFINE_QL_TOOLCHAIN_TARGET_CELLS_SIM}) add_custom_target( @@ -56,16 +31,6 @@ function(DEFINE_QL_TOOLCHAIN_TARGET) DEPENDS ${DEFINE_QL_TOOLCHAIN_TARGET_CELLS_SIM} ) - set(TOOLCHAIN_WRAPPERS) - foreach(WRAPPER ${WRAPPERS}) - set(WRAPPER_PATH "${symbiflow-arch-defs_SOURCE_DIR}/quicklogic/common/toolchain_wrappers/${WRAPPER}") - list(APPEND TOOLCHAIN_WRAPPERS ${WRAPPER_PATH}) - endforeach() - - install(FILES ${TOOLCHAIN_WRAPPERS} ${VPR_COMMON} - DESTINATION bin - PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE) - install(FILES ${VPR_CONFIG} DESTINATION share/symbiflow/scripts/${FAMILY}) diff --git a/quicklogic/common/toolchain_wrappers/conda_build_install_package.sh b/quicklogic/common/toolchain_wrappers/conda_build_install_package.sh deleted file mode 100644 index a834b9f629..0000000000 --- a/quicklogic/common/toolchain_wrappers/conda_build_install_package.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -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=/\". \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 diff --git a/quicklogic/common/toolchain_wrappers/env b/quicklogic/common/toolchain_wrappers/env deleted file mode 100644 index 1e51c5b5da..0000000000 --- a/quicklogic/common/toolchain_wrappers/env +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -if [ -z $VPRPATH ]; then - export VPRPATH=$MYPATH - export PYTHONPATH=${VPRPATH}/python:${VPRPATH}/python/prjxray:${PYTHONPATH} -fi diff --git a/quicklogic/common/toolchain_wrappers/ql_symbiflow b/quicklogic/common/toolchain_wrappers/ql_symbiflow deleted file mode 100644 index 814d639a36..0000000000 --- a/quicklogic/common/toolchain_wrappers/ql_symbiflow +++ /dev/null @@ -1,483 +0,0 @@ -#!/bin/bash - -set -e - - -MYPATH=$(dirname "$(readlink -f "$BASH_SOURCE")") -BUILDDIR=build - -source ${MYPATH}/env -source ${VPRPATH}/vpr_common -VERSION="v2.0.1" - -if [ ! -n $1 ]; then -echo "Please enter a valid command: Refer help ql_symbiflow --help" -exit 0 -elif [[ $1 == "-synth" || $1 == "-compile" ]]; then -echo -e "----------------- \n" -elif [[ $1 == "-h" || $1 == "--help" ]];then -echo -e "\nBelow are the supported commands: \n\ - To synthesize and dump a eblif file:\n\ -\t>ql_symbiflow -synth -src -d -P -t -v -p \n\ - To run synthesis, pack, place and route:\n\ -\t>ql_symbiflow -compile -src -d -P -t -v -p -P -s \n\ -Device supported:qlf_k4n8" || exit -elif [[ $1 == "-v" || $1 == "--version" ]];then - echo "Symbiflow Tool Version : ${VERSION}" - exit -else -echo -e "Please provide a valid command : Refer -h/--help\n" -exit -fi - - -VERILOG_FILES=() -PCF="" -TOP="" -SOURCE="" -HELP="" -DEVICE="" -FAMILY="" -PART="" -SDC="" -OUT=() -ROUTE_FLAG0="" -MAX_CRITICALITY="0.0" -JSON="" -PNR_CORNER="slow" -ANALYSIS_CORNER="slow" -COMPILE_EXTRA_ARGS=() - -OPT="" -for arg in $@; do - case $arg in - -src|--source) - OPT="src" - ;; - -t|--top) - OPT="top" - ;; - -v|--verilog) - OPT="vlog" - ;; - -d|--device) - OPT="dev" - ;; - -p|--pcf) - OPT="pcf" - ;; - -P|--part) - OPT="part" - ;; - -j|--json) - OPT="json" - ;; - -s|--sdc) - OPT="sdc" - ;; - -r|--route_type) - OPT="route" - ;; - -pnr_corner) - OPT="pnr_corner" - ;; - -analysis_corner) - OPT="analysis_corner" - ;; - -dump) - OPT="dump" - ;; - -synth|-compile) - OPT="synth" - ;; - -y|+incdir+*|+libext+*|+define+*) - OPT="compile_xtra" - ;; - -f) - OPT="options_file" - ;; - -h|--help) - exit 0 - ;; - *) - case $OPT in - "src") - SOURCE=$arg - OPT="" - ;; - "top") - TOP=$arg - OPT="" - ;; - "vlog") - VERILOG_FILES+="$arg " - ;; - "dev") - DEVICE=$arg - OPT="" - ;; - "pcf") - PCF=$arg - OPT="" - ;; - "part") - PART=$arg - OPT="" - ;; - "json") - JSON=$arg - OPT="" - ;; - "sdc") - SDC=$arg - OPT="" - ;; - "route") - ROUTE_FLAG0="$arg" - ROUTE_FLAG0="${ROUTE_FLAG0,,}" - OPT="" - ;; - "pnr_corner") - PNR_CORNER=$arg - OPT="" - ;; - "analysis_corner") - ANALYSIS_CORNER=$arg - OPT="" - ;; - "dump") - OUT+="$arg " - ;; - "compile_xtra") - ;; - "options_file") - COMPILE_EXTRA_ARGS+=("-f \"`realpath $arg`\" ") - ;; - *) - echo "Refer help for more details: ql_symbiflow -h " - exit 1 - ;; - esac - ;; - esac - - if [ "$OPT" == "compile_xtra" ]; then - COMPILE_EXTRA_ARGS+=($arg) - fi - -done - -case ${DEVICE} in - qlf_k4n8) - DEVICE="${DEVICE}_${DEVICE}" - FAMILY="qlf_k4n8" - ;; - ql-eos-s3) - DEVICE="${DEVICE}" - FAMILY="pp3" - ;; - *) - echo "Unsupported device '${DEVICE}'" - exit 1 - ;; -esac - -##### Check if the source directory exists ##### -if [[ $1 == "-h" || $1 == "--help" ]];then - exit 1 -else - if [ -z "$SOURCE" ];then - SOURCE=$PWD - elif [ $SOURCE == "." ];then - SOURCE=$PWD - elif [ ! -d "$SOURCE" ];then - echo "Directory path $SOURCE DOES NOT exists. Please add absolute path" - exit 1 - fi - -if [[ $1 == "-h" || $1 == "--help" ]];then -exit 0 -else -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 -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 - -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" - 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 [ -z "$PART" ]; then - if [ -n "$PCF" ];then - echo "Error: pcf file cannot be used without declaring PINMAP CSV file" - exit 1 - fi - fi - fi - if [ -z "$ROUTE_FLAG0" ]; then - MAX_CRITICALITY="0.0" - elif ! [[ "$ROUTE_FLAG0" =~ ^(timing|congestion)$ ]]; then - echo "Invalid option name, supported timing/congestion" - exit 1 - else - if [ "$ROUTE_FLAG0" == "congestion" ]; then - MAX_CRITICALITY="0.99" - else - MAX_CRITICALITY="0.0" - fi - fi -fi - -if [ ! -z "$SOURCE" ];then - if [ ! -d $SOURCE/$BUILDDIR ]; then - mkdir -p $SOURCE/$BUILDDIR - fi -fi - -if [ ! -z "$OUT" ];then -OUT_ARR=($OUT) -fi - -for item in $VERILOG_FILES; -do -if ! [ -f $SOURCE/$item ]; then - echo "$item: verilog file does not exists at : $SOURCE" - exit 1 -elif [[ $item =~ ^/ ]]; then - echo "$item \\" >>$SOURCE/v_list_tmp -else - echo "\${current_dir}/$item \\" >>$SOURCE/v_list_tmp -fi -done - -if [ -f "$SOURCE/v_list_tmp" ]; then - truncate -s-2 "$SOURCE/v_list_tmp" - VERILOG_LIST=`cat ${SOURCE}/v_list_tmp` -fi - -# FIXME: Some devices do not have fasm2bels yet -RUN_TILL="" -if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then - HAVE_FASM2BELS=0 - RUN_TILL="bit" -else - HAVE_FASM2BELS=1 - RUN_TILL="route" -fi - -# For some devices do repacking between place and route -if [[ "$DEVICE" =~ ^(qlf_k4n8.*)$ ]]; then - TOP_FINAL=${TOP}.repacked -else - TOP_FINAL=${TOP} -fi - -export PCF_FILE=$PCF -export JSON=$JSON -export TOP_F=$TOP -export PINMAP_FILE=$PINMAPCSV -export MAX_CRITICALITY=$MAX_CRITICALITY -##### Create Makefile ##### - -if [[ $SOURCE =~ ^/ ]]; then - CURR_DIR="${SOURCE}" -else - CURR_DIR="${PWD}/${SOURCE}" -fi - -if [ -n "$PART" ]; then - if [[ -f $SOURCE/$PART ]];then - CSV_PATH=`realpath $SOURCE/$PART` - elif [[ -f $PART ]];then - CSV_PATH=`realpath $PART` - else - echo "invalid csv file/path" - exit 1 - fi -fi - -if [[ -f $SOURCE/$JSON ]];then - JSON_PATH=`realpath $SOURCE/$JSON` -elif [[ -f $JSON ]];then - JSON_PATH=`realpath $JSON` -else - JSON_PATH="" -fi - -if [[ -f $SOURCE/$PCF ]];then - PCF_PATH=`realpath $SOURCE/$PCF` -elif [[ -f $PCF ]];then - PCF_PATH=`realpath $PCF` -fi - -export PART=${CSV_PATH} -export JSON=${JSON_PATH} -export PCF_PATH=${PCF_PATH} - -MAKE_FILE=${CURR_DIR}/Makefile.symbiflow -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" -fi - -PROCESS_SDC=`realpath ${MYPATH}/python/process_sdc_constraints.py` -if ! [ -z "$SDC" ]; then - if ! [ -f "$SOURCE"/$SDC ];then - echo "The sdc file: $SDC is missing at: $SOURCE" - exit 1 - else - SDC_MAKE="$SOURCE/$SDC" - fi -else - touch ${CURR_DIR}/build/${TOP}_dummy.sdc - SDC_MAKE="\${current_dir}/build/${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" -fi - -echo -e ".PHONY:\${BUILDDIR}\n -current_dir := $CURR_DIR\n\ -TOP := $TOP\n\ -JSON := $JSON\n\ -TOP_FINAL := $TOP_FINAL\n\ -VERILOG := $VERILOG_LIST \n\ -PARTNAME := $PART\n\ -DEVICE := $DEVICE\n\ -FAMILY := $FAMILY\n\ -ANALYSIS_CORNER := $PNR_CORNER\n\ -PNR_CORNER := $ANALYSIS_CORNER\n\ -PCF := $PCF_MAKE\n\ -PINMAP_CSV := $CSV_MAKE\n\ -SDC_IN := $SDC_MAKE\n\ -BUILDDIR := build\n\n\ -SDC := \${current_dir}/\${BUILDDIR}/\${TOP}.sdc - -all: \${BUILDDIR}/\${TOP}.${RUN_TILL}\n\ -\n\ -\${BUILDDIR}/\${TOP}.eblif: \${VERILOG} \${PCF}\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\ -\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\ -\${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\ -\${BUILDDIR}/\${TOP}.place: \${BUILDDIR}/\${TOP}.net \${PCF}\n\ - cd \${BUILDDIR} && symbiflow_place -e \${TOP}.eblif -f \${FAMILY} -d \${DEVICE} -p \${PCF} -n \${TOP}.net -P \${PARTNAME} -s \${SDC} -c \${PNR_CORNER} >> $LOG_FILE 2>&1\n\ -" >$MAKE_FILE - -if [ "$TOP" != "$TOP_FINAL" ]; then - if [ -z "$JSON" ];then - echo -e "\ -\${BUILDDIR}/\${TOP_FINAL}.place: \${BUILDDIR}/\${TOP}.eblif \${BUILDDIR}/\${TOP}.net \${BUILDDIR}/\${TOP}.place\n\ - cd \${BUILDDIR} && symbiflow_repack -e \${TOP}.eblif -n \${TOP}.net -f \${FAMILY} -d \${DEVICE} -c \${PNR_CORNER} >> $LOG_FILE 2>&1\n\ - " >>$MAKE_FILE - else - echo -e "\ -\${BUILDDIR}/\${TOP_FINAL}.place: \${BUILDDIR}/\${TOP}.eblif \${BUILDDIR}/\${TOP}.net \${BUILDDIR}/\${TOP}.place\n\ - cd \${BUILDDIR} && symbiflow_repack -e \${TOP}.eblif -n \${TOP}.net -f \${FAMILY} -d \${DEVICE} -j \${JSON} -c \${PNR_CORNER} >> $LOG_FILE 2>&1\n\ - " >>$MAKE_FILE - fi -fi - - echo -e "\ -\${BUILDDIR}/\${TOP_FINAL}.route: \${BUILDDIR}/\${TOP_FINAL}.place\n\ - cd \${BUILDDIR} && symbiflow_route -e \${TOP_FINAL}.eblif -f \${FAMILY} -d \${DEVICE} -s \${SDC} -c \${PNR_CORNER} >> $LOG_FILE 2>&1\n\ -\n\ -\${BUILDDIR}/\${TOP}.post_v: \${BUILDDIR}/\${TOP_FINAL}.route\n\ - cd \${BUILDDIR} && symbiflow_analysis -e \${TOP_FINAL}.eblif -f \${FAMILY} -d \${DEVICE} -s \${SDC} -t \${TOP} -c \${ANALYSIS_CORNER} >> $LOG_FILE 2>&1\n\ -\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\ -\${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\ -\n\ -\${BUILDDIR}/\${DEVICE}.lib:\n\ - cd \${BUILDDIR} && symbiflow_generate_libfile \${PARTNAME} \${DEVICE} \${PNR_CORNER} >> $LOG_FILE 2>&1\n\ -" >>$MAKE_FILE - -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\ - " >>$MAKE_FILE -fi - -echo -e "\ -clean:\n\ - rm -rf \${BUILDDIR}\n\ -" >>$MAKE_FILE - -#### Remove temporary files ##### -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 -elif [[ ! -z "$OUT" && $1 == "-compile" ]];then - if [[ " ${OUT_ARR[@]} " =~ " post_verilog " ]];then - cd $SOURCE;make -f Makefile.symbiflow ${BUILDDIR}/${TOP}.post_v || exit - 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 - fi -fi - - -############################################################################################### - - diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_analysis b/quicklogic/common/toolchain_wrappers/symbiflow_analysis deleted file mode 100644 index 921873f5a6..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_analysis +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -source ${MYPATH}/env -source ${VPRPATH}/vpr_common - -parse_args $@ - -FIXUP_POST_SYNTHESIS=`realpath ${MYPATH}/python/vpr_fixup_post_synth.py` - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_analysis.log - -run_vpr --analysis --gen_post_synthesis_netlist on --verify_file_digests off - -mv vpr_stdout.log analysis.log - -python3 ${FIXUP_POST_SYNTHESIS} \ - --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 diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_generate_bitstream b/quicklogic/common/toolchain_wrappers/symbiflow_generate_bitstream deleted file mode 100644 index ef6347c7f2..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_generate_bitstream +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -OPTS=d:f:r:b: -LONGOPTS=device:,fasm:,format:,bit: - -PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- "$@"` -eval set -- "${PARSED_OPTS}" - -DEVICE="" -FASM="" -BIT="" -BIT_FORMAT="4byte" - -while true; do - case "$1" in - -d|--device) - DEVICE=$2 - shift 2 - ;; - -f|--fasm) - FASM=$2 - shift 2 - ;; - -r|--format) - BIT_FORMAT=$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 $FASM ]; then - echo "Please provide an input FASM file name" - exit 1 -fi - -if [ -z $BIT ]; then - echo "Please provide an output bistream file name" - exit 1 -fi - -QLF_FASM=`which qlf_fasm` - -DB_ROOT=`realpath ${MYPATH}/../share/symbiflow/fasm_database/${DEVICE}` - -${QLF_FASM} --db-root ${DB_ROOT} --format ${BIT_FORMAT} --assemble $FASM $BIT - diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_generate_constraints b/quicklogic/common/toolchain_wrappers/symbiflow_generate_constraints deleted file mode 100644 index 5275d14307..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_generate_constraints +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -PCF=$1 -EBLIF=$2 -NET=$3 -PART=$4 -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 - -PINMAP_XML=`realpath ${MYPATH}/../share/symbiflow/arch/${DEVICE_1}_${DEVICE_1}/${PINMAPXML}` -IOGEN=`realpath ${MYPATH}/python/create_ioplace.py` -PROJECT=$(basename -- "$EBLIF") -IOPLACE_FILE="${PROJECT%.*}_io.place" - -python3 ${IOGEN} --pcf $PCF --blif $EBLIF --pinmap_xml $PINMAP_XML --csv_file $PART --net $NET > ${IOPLACE_FILE} diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_generate_libfile b/quicklogic/common/toolchain_wrappers/symbiflow_generate_libfile deleted file mode 100644 index 0144650204..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_generate_libfile +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -PART=$1 -DEVICE=$2 -CORNER=$3 - -if [[ "$DEVICE" =~ ^(qlf_k4n8_qlf_k4n8)$ ]];then - DEVICE_1="qlf_k4n8-qlf_k4n8_umc22_$CORNER" - PINMAPXML="pinmap_qlf_k4n8_umc22.xml" - INTERFACEXML="interface-mapping_24x24.xml" - DEV="qlf_k4n8_umc22" -else - DEVICE_1=${DEVICE} -fi - -ARCH_DIR=`realpath ${MYPATH}/../share/symbiflow/arch/${DEVICE_1}_${DEVICE_1}` -PINMAP_XML=`realpath ${ARCH_DIR}/${PINMAPXML}` -INTF_XML=`realpath ${ARCH_DIR}/lib/${INTERFACEXML}` -CREATE_LIB=`realpath ${MYPATH}/python/create_lib.py` - -python3 ${CREATE_LIB} -n ${DEV}_0P72_SSM40 -m fpga_top -c $PART -x $INTF_XML -l ${DEV}_0P72_SSM40.lib -t ${ARCH_DIR}/lib diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_pack b/quicklogic/common/toolchain_wrappers/symbiflow_pack deleted file mode 100644 index 6982aa3733..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_pack +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -source ${MYPATH}/env -source ${VPRPATH}/vpr_common - -parse_args $@ - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log - -run_vpr --pack - -mv vpr_stdout.log pack.log diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_place b/quicklogic/common/toolchain_wrappers/symbiflow_place deleted file mode 100644 index 515cd5d0fc..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_place +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -source ${MYPATH}/env -source ${MYPATH}/vpr_common - -parse_args $@ - -if [ -z $PCF ]; then - echo "Please provide pcf file name" - exit 1 -fi - -if [ -z $NET ]; then - echo "Please provide net file name" - exit 1 -fi - -OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_place.log -PROJECT=$(basename -- "$EBLIF") - -# Generate IO constraints -if [ -s $PCF ]; then - echo "Generating constraints ..." - symbiflow_generate_constraints $PCF $EBLIF $NET $PART $DEVICE $ARCH_DEF $CORNER - - IOPLACE_FILE="${PROJECT%.*}_io.place" - PLACE_FILE="${PROJECT%.*}_constraints.place" - - if [ -f ${PLACE_FILE} ]; then - VPR_PLACE_FILE=${PLACE_FILE} - else - VPR_PLACE_FILE=${IOPLACE_FILE} - fi - -# Make a dummy empty constraint file -else - - PLACE_FILE="${PROJECT%.*}_constraints.place" - touch ${PLACE_FILE} - VPR_PLACE_FILE=${PLACE_FILE} - -fi - -run_vpr --fix_clusters ${VPR_PLACE_FILE} --place - -mv vpr_stdout.log place.log diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_repack b/quicklogic/common/toolchain_wrappers/symbiflow_repack deleted file mode 100644 index ef23e73609..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_repack +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -source ${MYPATH}/env -source ${VPRPATH}/vpr_common - -parse_args $@ - -REPACK=`realpath ${MYPATH}/python/repacker/repack.py` - -DESIGN=${EBLIF/.eblif/} -RULES=${ARCH_DIR}/${DEVICE_1}.repacking_rules.json - -JSON_ARGS= -if [ ! -z "${JSON}" ]; then - JSON_ARGS="--json-constraints ${JSON}" -fi - -PCF_ARGS= -if [ ! -z "${PCF_PATH}" ]; then - PCF_ARGS="--pcf-constraints ${PCF_PATH}" -fi - -python3 ${REPACK} \ - --vpr-arch ${ARCH_DEF} \ - --repacking-rules ${RULES} \ - $JSON_ARGS \ - $PCF_ARGS \ - --eblif-in ${DESIGN}.eblif \ - --net-in ${DESIGN}.net \ - --place-in ${DESIGN}.place \ - --eblif-out ${DESIGN}.repacked.eblif \ - --net-out ${DESIGN}.repacked.net \ - --place-out ${DESIGN}.repacked.place \ - --absorb_buffer_luts on \ - >repack.log 2>&1 diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_route b/quicklogic/common/toolchain_wrappers/symbiflow_route deleted file mode 100644 index 06bd12b923..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_route +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -source ${MYPATH}/env -source ${VPRPATH}/vpr_common - -parse_args $@ - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log - -run_vpr --route - -mv vpr_stdout.log route.log diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_synth b/quicklogic/common/toolchain_wrappers/symbiflow_synth deleted file mode 100644 index 61d2bb188c..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_synth +++ /dev/null @@ -1,163 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -SPLIT_INOUTS=`realpath ${MYPATH}/python/split_inouts.py` -CONVERT_OPTS=`realpath ${MYPATH}/python/convert_compile_opts.py` - -print_usage () { - echo "Usage: symbiflow_synth -v|--verilog " - echo " [-t|--top ]" - echo " [-F|--family ]" - echo " [-d|--device ]" - echo " [-P|--part ]" - echo " [-p|--pcf ]" - echo " [-y " - echo " [+libext+]" - echo " [+incdir+]" - echo " [+define+[=]]" - echo " [-f ]" - echo "" - exit 1 -} - -VERILOG_FILES=() -TOP="top" -DEVICE="" -FAMILY="" -PART="" -PCF="" -EXTRA_ARGS=() - -OPT="" -for arg in $@; do - case $arg in - -t|--top) - OPT="top" - ;; - -v|--verilog) - OPT="vlog" - ;; - -d|--device) - OPT="dev" - ;; - -F|--family) - OPT="family" - ;; - -P|--part) - OPT="part" - ;; - -p|--pcf) - OPT="pcf" - ;; - -y|-f|+incdir+*|+libext+*|+define+*) - OPT="xtra" - ;; - *) - case $OPT in - "top") - TOP=$arg - OPT="" - ;; - "vlog") - VERILOG_FILES+=($arg) - ;; - "dev") - DEVICE=$arg - OPT="" - ;; - "family") - FAMILY=$arg - OPT="" - ;; - "part") - PART=$arg - OPT="" - ;; - "pcf") - PCF=$arg - OPT="" - ;; - "xtra") - ;; - *) - print_usage - ;; - esac - ;; - esac - - if [ "$OPT" == "xtra" ]; then - EXTRA_ARGS+=($arg) - fi - -done - -if [ -z ${FAMILY} ]; then - echo "Please specify device family" - exit 1 -fi - -if [ ${#VERILOG_FILES[@]} -eq 0 ]; then - echo "Please provide at least one Verilog file" - exit 1 -fi - -PINMAPCSV="pinmap_${PART}.csv" - -export TECHMAP_PATH=`realpath ${MYPATH}/../share/symbiflow/techmaps/${FAMILY}` - -SYNTH_TCL_PATH=`realpath ${MYPATH}/../share/symbiflow/scripts/${FAMILY}/synth.tcl` -CONV_TCL_PATH=`realpath ${MYPATH}/../share/symbiflow/scripts/${FAMILY}/conv.tcl` - -export USE_ROI="FALSE" -export OUT_JSON=$TOP.json -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 - -if [ -s $PCF ]; then - export PCF_FILE=$PCF -fi - -DEVICE_PATH=`realpath ${MYPATH}/../share/symbiflow/arch/${DEVICE}_${DEVICE}` -export PINMAP_FILE=${DEVICE_PATH}/${PINMAPCSV} -if [ -d "${DEVICE_PATH}/cells" ]; then - export DEVICE_CELLS_SIM=`find ${DEVICE_PATH}/cells -name "*_sim.v"` - export DEVICE_CELLS_MAP=`find ${DEVICE_PATH}/cells -name "*_map.v"` -else - # pp3 family has different directory naming scheme - # the are named as ${DEVICE}_${PACKAGE} - # ${PACKAGE} is not known because it is not passed down in add_binary_toolchain_test - DEVICE_PATH=$(find $(realpath ${MYPATH}/../share/symbiflow/arch/) -type d -name "${DEVICE}*") - export PINMAP_FILE=${DEVICE_PATH}/${PINMAPCSV} - if [ -d "${DEVICE_PATH}/cells" ]; then - export DEVICE_CELLS_SIM=`find ${DEVICE_PATH}/cells -name "*_sim.v"` - export DEVICE_CELLS_MAP=`find ${DEVICE_PATH}/cells -name "*_map.v"` - else - export DEVICE_CELLS_SIM= - export DEVICE_CELLS_MAP= - fi -fi - -YOSYS_COMMANDS=`echo ${EXTRA_ARGS[*]} | python3 ${CONVERT_OPTS}` -YOSYS_COMMANDS="${YOSYS_COMMANDS//$'\n'/'; '}" - -LOG=${TOP}_synth.log - -YOSYS_SCRIPT="tcl ${SYNTH_TCL_PATH}" - -for f in ${VERILOG_FILES[*]}; do - YOSYS_SCRIPT="read_verilog ${f}; $YOSYS_SCRIPT" -done - -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}" diff --git a/quicklogic/common/toolchain_wrappers/symbiflow_write_fasm b/quicklogic/common/toolchain_wrappers/symbiflow_write_fasm deleted file mode 100644 index ec4f8561a5..0000000000 --- a/quicklogic/common/toolchain_wrappers/symbiflow_write_fasm +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -set -e - -MYPATH=`realpath $0` -MYPATH=`dirname ${MYPATH}` - -source ${MYPATH}/env -source ${VPRPATH}/vpr_common - -parse_args "$@" - -TOP="${EBLIF%.*}" -FASM_EXTRA=${TOP}_fasm_extra.fasm - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_fasm.log - -run_genfasm - -echo "FASM extra: $FASM_EXTRA" -if [ -f $FASM_EXTRA ]; then - echo "writing final fasm" - cat ${TOP}.fasm $FASM_EXTRA > tmp.fasm - mv tmp.fasm ${TOP}.fasm -fi - -mv vpr_stdout.log fasm.log diff --git a/quicklogic/common/toolchain_wrappers/vpr_common b/quicklogic/common/toolchain_wrappers/vpr_common deleted file mode 100644 index 43c7c87eee..0000000000 --- a/quicklogic/common/toolchain_wrappers/vpr_common +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/bash -function parse_args { - - 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} - - 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 - - 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 $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}" - elif [[ "$DEVICE" == "qlf_k6n10_qlf_k6n10" ]];then - DEVICE_1="qlf_k6n10-qlf_k6n10_gf12" - 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 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 - - export DEVICE_NAME=${DEVICE_1} - - export VPR_CONFIG=`realpath ${MYPATH}/../share/symbiflow/scripts/${FAMILY}/vpr_config.sh` -} - -function run_vpr { - set -e - - source ${VPR_CONFIG} - - SDC_OPTIONS="" - if [ ! -z $SDC ] - then - SDC_OPTIONS="--sdc_file $SDC" - fi - - vpr ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - --read_placement_delay_lookup ${PLACE_DELAY} \ - --read_router_lookahead ${ROUTE_DELAY} \ - ${SDC_OPTIONS} \ - $@ - - return $? -} - -function run_genfasm { - set -e - - source ${VPR_CONFIG} - - genfasm ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - $@ - - return $? -} diff --git a/quicklogic/common/toolchain_wrappers/vpr_config.sh b/quicklogic/common/toolchain_wrappers/vpr_config.sh deleted file mode 100644 index 385445bb37..0000000000 --- a/quicklogic/common/toolchain_wrappers/vpr_config.sh +++ /dev/null @@ -1 +0,0 @@ -VPR_OPTIONS="@VPR_ARGS@" diff --git a/xc/common/cmake/install.cmake b/xc/common/cmake/install.cmake index 2d80c0251b..bb52c3a92d 100644 --- a/xc/common/cmake/install.cmake +++ b/xc/common/cmake/install.cmake @@ -21,35 +21,10 @@ function(DEFINE_XC_TOOLCHAIN_TARGET) get_target_property_required(VPR env VPR) get_target_property_required(GENFASM env GENFASM) - - set(VPR_ARCH_ARGS ${DEFINE_XC_TOOLCHAIN_TARGET_VPR_ARCH_ARGS}) - set(ROUTE_CHAN_WIDTH ${DEFINE_XC_TOOLCHAIN_TARGET_ROUTE_CHAN_WIDTH}) - list(JOIN VPR_BASE_ARGS " " VPR_BASE_ARGS) - string(JOIN " " VPR_ARGS ${VPR_BASE_ARGS} "--route_chan_width ${ROUTE_CHAN_WIDTH}" ${VPR_ARCH_ARGS}) get_target_property_required(FAMILY ${ARCH} FAMILY) get_target_property_required(DOC_PRJ ${ARCH} DOC_PRJ) get_target_property_required(DOC_PRJ_DB ${ARCH} DOC_PRJ_DB) - set(WRAPPERS - symbiflow_generate_constraints - symbiflow_pack - symbiflow_place - symbiflow_route - symbiflow_synth - symbiflow_write_bitstream - symbiflow_write_fasm - vpr_common) - set(TOOLCHAIN_WRAPPERS) - - foreach(WRAPPER ${WRAPPERS}) - set(WRAPPER_PATH "${symbiflow-arch-defs_SOURCE_DIR}/xc/${FAMILY}/toolchain_wrappers/${WRAPPER}") - list(APPEND TOOLCHAIN_WRAPPERS ${WRAPPER_PATH}) - endforeach() - - install(FILES ${TOOLCHAIN_WRAPPERS} - DESTINATION bin - PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE) - # install python scripts install(FILES ${symbiflow-arch-defs_SOURCE_DIR}/utils/split_inouts.py diff --git a/xc/xc7/toolchain_wrappers/symbiflow_generate_constraints b/xc/xc7/toolchain_wrappers/symbiflow_generate_constraints deleted file mode 100755 index fa8899ec79..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_generate_constraints +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -set -e - -EBLIF=$1 -NET=$2 -PART=$3 -DEVICE=$4 -ARCH_DEF=$5 -PCF=$6 - -if [ ! -z $PCF ]; then - PCF_OPTS="--pcf $PCF" -fi - -DATABASE_DIR=${DATABASE_DIR:=$(prjxray-config)} - -SHARE_DIR_PATH=${SHARE_DIR_PATH:=$(realpath $(dirname "$0")/../share/symbiflow)} -VPR_GRID_MAP=${SHARE_DIR_PATH}/arch/${DEVICE}/vpr_grid_map.csv -PINMAP=${SHARE_DIR_PATH}/arch/${DEVICE}/${PART}/pinmap.csv -IOGEN=${SHARE_DIR_PATH}/scripts/prjxray_create_ioplace.py -CONSTR_GEN=${SHARE_DIR_PATH}/scripts/prjxray_create_place_constraints.py - -PROJECT=$(basename -- "$EBLIF") -IOPLACE_FILE="${PROJECT%.*}.ioplace" - -python3 ${IOGEN} \ - --blif $EBLIF \ - --map $PINMAP \ - --net $NET \ - $PCF_OPTS \ - > ${IOPLACE_FILE} - -python3 ${CONSTR_GEN} \ - --net $NET \ - --arch ${ARCH_DEF} \ - --blif $EBLIF \ - --vpr_grid_map ${VPR_GRID_MAP} \ - --input ${IOPLACE_FILE} \ - --db_root $DATABASE_DIR \ - --part $PART \ - > constraints.place diff --git a/xc/xc7/toolchain_wrappers/symbiflow_pack b/xc/xc7/toolchain_wrappers/symbiflow_pack deleted file mode 100755 index ed0f99a83a..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_pack +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source $(dirname $(realpath $0))/vpr_common -parse_args "$@" - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log - -run_vpr --pack - -mv vpr_stdout.log pack.log diff --git a/xc/xc7/toolchain_wrappers/symbiflow_place b/xc/xc7/toolchain_wrappers/symbiflow_place deleted file mode 100755 index ef24369be8..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_place +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source $(dirname $(realpath $0))/vpr_common -parse_args "$@" - -PCF=${PCF:=} - -if [ -z $NET ]; then - echo "Please provide net file name" - exit 1 -fi - -OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_place.log - -echo "Generating coinstrains ..." -symbiflow_generate_constraints $EBLIF $NET $PART $DEVICE $ARCH_DEF $PCF - -run_vpr --fix_clusters constraints.place --place - -mv vpr_stdout.log place.log diff --git a/xc/xc7/toolchain_wrappers/symbiflow_route b/xc/xc7/toolchain_wrappers/symbiflow_route deleted file mode 100755 index d67b197d56..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_route +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source $(dirname $(realpath $0))/vpr_common -parse_args "$@" - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_pack.log - -run_vpr --route - -mv vpr_stdout.log route.log diff --git a/xc/xc7/toolchain_wrappers/symbiflow_synth b/xc/xc7/toolchain_wrappers/symbiflow_synth deleted file mode 100755 index 34278b1d9d..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_synth +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env bash - -set -e - -export SHARE_DIR_PATH=${SHARE_DIR_PATH:=$(realpath $(dirname "$0")/../share/symbiflow)} -export TECHMAP_PATH=${SHARE_DIR_PATH}/techmaps/xc7_vpr/techmap - -export UTILS_PATH=${SHARE_DIR_PATH}/scripts -SYNTH_TCL_PATH=${UTILS_PATH}/xc7/synth.tcl - -VERILOG_FILES=() -XDC_FILES=() -TOP=top -DEVICE="*" -PART="" -SURELOG_CMD=() - -VERILOGLIST=0 -XDCLIST=0 -TOPNAME=0 -DEVICENAME=0 -PARTNAME=0 -SURELOG=0 - -for arg in $@; do - echo $arg - case "$arg" in - -t|--top) - echo "adding top" - VERILOGLIST=0 - XDCLIST=0 - TOPNAME=1 - DEVICENAME=0 - PARTNAME=0 - SURELOG=0 - ;; - -x|--xdc) - VERILOGLIST=0 - XDCLIST=1 - TOPNAME=0 - DEVICENAME=0 - PARTNAME=0 - SURELOG=0 - ;; - -v|--verilog) - VERILOGLIST=1 - XDCLIST=0 - TOPNAME=0 - DEVICENAME=0 - PARTNAME=0 - SURELOG=0 - ;; - -d|--device) - VERILOGLIST=0 - XDCLIST=0 - TOPNAME=0 - DEVICENAME=1 - PARTNAME=0 - SURELOG=0 - ;; - -p|--part) - VERILOGLIST=0 - XDCLIST=0 - TOPNAME=0 - DEVICENAME=0 - PARTNAME=1 - SURELOG=0 - ;; - -s|--surelog) - VERILOGLIST=0 - XDCLIST=0 - TOPNAME=0 - DEVICENAME=0 - PARTNAME=0 - SURELOG=1 - ;; - *) - if [ $VERILOGLIST -eq 1 ]; then - VERILOG_FILES+=($arg) - elif [ $XDCLIST -eq 1 ]; then - XDC_FILES+=($arg) - elif [ $TOPNAME -eq 1 ]; then - TOP=$arg - elif [ $DEVICENAME -eq 1 ]; then - DEVICE=$arg - elif [ $PARTNAME -eq 1 ]; then - PART=$arg - elif [ $SURELOG -eq 1 ]; then - SURELOG_CMD+=($arg) - else - echo "Usage: synth [-t|--top -v|--verilog [-x|--xdc ]" - echo " [-d|--device ] [-p|--part ] [-s|--surelog] " - echo "note: device and part parameters are required if xdc is passed" - exit 1 - fi - ;; - esac -done - -if [ ${#VERILOG_FILES[@]} -eq 0 ]; then - echo "Please provide at least one Verilog file" - exit 1 -fi - -DATABASE_DIR=${DATABASE_DIR:=$(prjxray-config)} - -export TOP=${TOP} -export USE_ROI="FALSE" -export INPUT_XDC_FILES=${XDC_FILES[*]} -export OUT_JSON=$TOP.json -export OUT_SDC=${TOP}.sdc -export SYNTH_JSON=${TOP}_io.json -export OUT_SYNTH_V=${TOP}_synth.v -export OUT_EBLIF=${TOP}.eblif -export PART_JSON=`realpath ${DATABASE_DIR}/$DEVICE/$PART/part.json` -export OUT_FASM_EXTRA=${TOP}_fasm_extra.fasm -export PYTHON3=${PYTHON3:=$(which python3)} - -LOG=${TOP}_synth.log - -if [ -z "$SURELOG_CMD" ]; then - yosys -p "tcl ${SYNTH_TCL_PATH}" -l $LOG ${VERILOG_FILES[*]} -else - yosys -p "plugin -i uhdm" -p "read_verilog_with_uhdm ${SURELOG_CMD[*]} ${VERILOG_FILES[*]}" -p "tcl ${SYNTH_TCL_PATH}" -l $LOG -fi - -python3 ${UTILS_PATH}/split_inouts.py -i ${OUT_JSON} -o ${SYNTH_JSON} -yosys -p "read_json $SYNTH_JSON; tcl ${UTILS_PATH}/xc7/conv.tcl" diff --git a/xc/xc7/toolchain_wrappers/symbiflow_write_bitstream b/xc/xc7/toolchain_wrappers/symbiflow_write_bitstream deleted file mode 100755 index a54e960376..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_write_bitstream +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -set -e - -echo "Writing bitstream ..." - -FRM2BIT="" -if [ ! -z ${FRAMES2BIT} ]; then - FRM2BIT="--frm2bit ${FRAMES2BIT}" -fi - -OPTS=d:f:b:p: -LONGOPTS=device:,fasm:,bit:,part: - -PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- $@` -eval set -- ${PARSED_OPTS} - -DEVICE="" -FASM="" -BIT="" -PART=xc7a35tcpg236-1 - -while true; do - case "$1" in - -d|--device) - DEVICE=$2 - shift 2 - ;; - -p|--part) - PART=$2 - shift 2 - ;; - -f|--fasm) - FASM=$2 - shift 2 - ;; - -b|--bit) - BIT=$2 - shift 2 - ;; - --) - break - ;; - esac -done - -DATABASE_DIR=${DATABASE_DIR:=$(prjxray-config)} - -if [ -z $DEVICE ]; then - # Try to find device name. Accept only when exactly one is found - PART_DIRS=(${DATABASE_DIR}/*/${PART}) - if [ ${#PART_DIRS[@]} -eq 1 ]; then - DEVICE=$(basename $(dirname "${PART_DIRS[0]}")) - else - echo "Please provide device name" - exit 1 - fi -fi - -DBROOT=`realpath ${DATABASE_DIR}/${DEVICE}` - -if [ -z $FASM ]; then - echo "Please provide fasm file name" - exit 1 -fi - -if [ -z $BIT ]; then - echo "Please provide bit file name" - exit 1 -fi - -xcfasm \ - --db-root ${DBROOT} \ - --part ${PART} \ - --part_file ${DBROOT}/${PART}/part.yaml \ - --sparse \ - --emit_pudc_b_pullup \ - --fn_in ${FASM} \ - --bit_out ${BIT} ${FRM2BIT} diff --git a/xc/xc7/toolchain_wrappers/symbiflow_write_fasm b/xc/xc7/toolchain_wrappers/symbiflow_write_fasm deleted file mode 100755 index e83cb688ae..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_write_fasm +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source $(dirname $(realpath $0))/vpr_common -parse_args "$@" - -TOP="${EBLIF%.*}" -FASM_EXTRA=${TOP}_fasm_extra.fasm - -export OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_fasm.log - -run_genfasm - -echo "FASM extra: $FASM_EXTRA" -if [ -f $FASM_EXTRA ]; then - echo "writing final fasm" - cat ${TOP}.fasm $FASM_EXTRA > tmp.fasm - mv tmp.fasm ${TOP}.fasm -fi - -mv vpr_stdout.log fasm.log diff --git a/xc/xc7/toolchain_wrappers/symbiflow_write_xml_rr_graph b/xc/xc7/toolchain_wrappers/symbiflow_write_xml_rr_graph deleted file mode 100755 index 93a3065a7e..0000000000 --- a/xc/xc7/toolchain_wrappers/symbiflow_write_xml_rr_graph +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e - -source $(dirname $(realpath $0))/vpr_common -parse_args "$@" - -OUT_NOISY_WARNINGS=noisy_warnings-${DEVICE}_place.log - -run_vpr_xml_rr_graph --pack - diff --git a/xc/xc7/toolchain_wrappers/vpr_common b/xc/xc7/toolchain_wrappers/vpr_common deleted file mode 100644 index 4f6d57c722..0000000000 --- a/xc/xc7/toolchain_wrappers/vpr_common +++ /dev/null @@ -1,168 +0,0 @@ -#!/usr/bin/env bash - -SHARE_DIR_PATH=${SHARE_DIR_PATH:=$(realpath $(dirname "$0")/../share/symbiflow)} - -if [ -z $VPR_OPTIONS ]; then - echo "Using default VPR options." - # These hardcoded default options are optimised for Xilinx 7 Series. - # See https://github.com/SymbiFlow/f4pga-arch-defs/blob/main/xc/common/cmake/arch_define.cmake#L65-L97 - VPR_OPTIONS=" - --max_router_iterations 500 - --routing_failure_predictor off - --router_high_fanout_threshold -1 - --constant_net_method route - --route_chan_width 500 - --router_heap bucket - --clock_modeling route - --place_delta_delay_matrix_calculation_method dijkstra - --place_delay_model delta - --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 - --acc_fac 0.7 - --astar_fac 1.8 - --initial_pres_fac 2.828 - --pres_fac_mult 1.2 - --check_rr_graph off - --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:calculate_average_switch - " -fi - -function parse_args { - - OPTS=d:e:p:n:P:s:a: - LONGOPTS=device:,eblif:,pcf:,net:,part:,sdc:,additional_vpr_options: - - PARSED_OPTS=`getopt --options=${OPTS} --longoptions=${LONGOPTS} --name $0 -- "$@"` - eval set -- "${PARSED_OPTS}" - - DEVICE="" - DEVICE_NAME="" - PART="" - EBLIF="" - PCF="" - NET="" - SDC="" - ADDITIONAL_VPR_OPTIONS="" - - while true; do - case "$1" in - -d|--device) - DEVICE=$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 - ;; - -s|--sdc) - SDC=$2 - shift 2 - ;; - -a|--additional_vpr_options) - ADDITIONAL_VPR_OPTIONS="$2" - shift 2 - ;; - --) - break - ;; - esac - done - - if [ -z $DEVICE ] && [ -n $PART ]; then - # Try to find device name. Accept only when exactly one is found - PART_DIRS=(${SHARE_DIR_PATH}/arch/*/${PART}) - if [ ${#PART_DIRS[@]} -eq 1 ]; then - DEVICE=$(basename $(dirname "${PART_DIRS[0]}")) - fi - fi - if [ -z $DEVICE ]; then - echo "Please provide device name" - exit 1 - fi - - if [ -z $EBLIF ]; then - echo "Please provide blif file name" - exit 1 - fi - - export DEVICE=$DEVICE - export EBLIF=$EBLIF - export PCF=$PCF - export NET=$NET - export SDC=$SDC - export VPR_OPTIONS="$VPR_OPTIONS $ADDITIONAL_VPR_OPTIONS" - - export ARCH_DIR=`realpath ${SHARE_DIR_PATH}/arch/$DEVICE` - export ARCH_DEF=${ARCH_DIR}/arch.timing.xml - export LOOKAHEAD=${ARCH_DIR}/rr_graph_${DEVICE}.lookahead.bin - export RR_GRAPH=${ARCH_DIR}/rr_graph_${DEVICE}.rr_graph.real.bin - export RR_GRAPH_XML=${ARCH_DIR}/rr_graph_${DEVICE}.rr_graph.real.xml - export PLACE_DELAY=${ARCH_DIR}/rr_graph_${DEVICE}.place_delay.bin - export DEVICE_NAME=`echo $DEVICE | sed -n 's/_/-/p'` -} - -function run_vpr { - set -e - - SDC_OPTIONS="" - if [ ! -z $SDC ] - then - SDC_OPTIONS="--sdc_file $SDC" - fi - - vpr ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - --read_router_lookahead ${LOOKAHEAD} \ - --read_placement_delay_lookup ${PLACE_DELAY} \ - ${SDC_OPTIONS} \ - $@ - - return $? -} - -function run_genfasm { - set -e - - genfasm ${ARCH_DEF} \ - ${EBLIF} \ - --device ${DEVICE_NAME} \ - ${VPR_OPTIONS} \ - --read_rr_graph ${RR_GRAPH} \ - $@ - - return $? -} - -function run_vpr_xml_rr_graph { - set -e - - vpr ${ARCH_DEF} \ - ${EBLIF} \ - --read_rr_graph ${RR_GRAPH} - --write_rr_graph ${RR_GRAPH_XML} - $@ - - return $? -}