From e9a520a17a00cfd268f8ee549340aaa297b63da5 Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Thu, 4 Aug 2022 04:23:37 +0200 Subject: [PATCH] f4pga: remove F4PGA_BIN_DIR and VPRPATH Signed-off-by: Unai Martinez-Corral --- .github/eos-s3_test.json | 8 ++--- .github/workflows/Pipeline.yml | 31 +++++-------------- .github/xc7_test.json | 6 ++-- docs/changes.yml | 3 +- f4pga/__init__.py | 3 +- f4pga/setup.py | 8 +++-- f4pga/wrappers/sh/__init__.py | 3 +- .../wrappers/sh/quicklogic/analysis.f4pga.sh | 1 - f4pga/wrappers/sh/quicklogic/env | 22 ------------- .../wrappers/sh/quicklogic/fasm2bels.f4pga.sh | 1 - f4pga/wrappers/sh/quicklogic/pack.f4pga.sh | 1 - f4pga/wrappers/sh/quicklogic/place.f4pga.sh | 1 - f4pga/wrappers/sh/quicklogic/repack.f4pga.sh | 1 - f4pga/wrappers/sh/quicklogic/route.f4pga.sh | 1 - f4pga/wrappers/sh/quicklogic/synth.f4pga.sh | 2 -- .../sh/quicklogic/write_fasm.f4pga.sh | 1 - 16 files changed, 23 insertions(+), 70 deletions(-) delete mode 100644 f4pga/wrappers/sh/quicklogic/env diff --git a/.github/eos-s3_test.json b/.github/eos-s3_test.json index 8838c7d..678099d 100644 --- a/.github/eos-s3_test.json +++ b/.github/eos-s3_test.json @@ -5,7 +5,7 @@ }, "dependencies": { "sources": [ - "eos-s3/btn_counter/btn_counter.v" + "btn_counter/btn_counter.v" ], "synth_log": "synth.log", "pack_log": "pack.log", @@ -14,9 +14,9 @@ "EOS3FF512-PDN64": { "default_target": "bitstream", "dependencies": { - "build_dir": "build/eos-s3", - "pcf": "eos-s3/btn_counter/chandalar.pcf", - "sdc-in": "eos-s3/btn_counter/dummy.sdc" + "build_dir": "build", + "pcf": "btn_counter/chandalar.pcf", + "sdc-in": "btn_counter/dummy.sdc" }, "values": { "part": "ql-eos-s3", diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index a91e5a2..a7481fb 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -112,31 +112,28 @@ jobs: - name: 🐍 Install f4pga (pip) run: | . ./.github/scripts/activate.sh - cd f4pga pip install . cd .. + - name: 🛠️ Clone f4pga-examples + run: git clone --recurse-submodules https://github.com/chipsalliance/f4pga-examples + # F4PGA - name: 🚧 [F4PGA] Test f4pga build if: matrix.flow == 'F4PGA' run: | . ./.github/scripts/activate.sh - - echo '::group::Clone f4pga-examples' - git clone --recurse-submodules https://github.com/chipsalliance/f4pga-examples - cd f4pga-examples - echo '::endgroup::' - - f4pga -vv build --flow ../.github/${{ matrix.fam }}_test.json + cd f4pga-examples/${{ matrix.fam }} + f4pga -vv build --flow ../../.github/${{ matrix.fam }}_test.json - name: '📤 Upload artifact: ${{ matrix.fam }} bitstream' if: matrix.flow == 'F4PGA' uses: actions/upload-artifact@v3 with: name: ${{ matrix.flow }}-${{ matrix.fam }}-Bitstream - path: f4pga-examples/build/${{ matrix.fam }}/top.bit + path: f4pga-examples/${{ matrix.fam }}/build/top.bit if-no-files-found: error # SymbiFlow @@ -145,20 +142,8 @@ jobs: if: matrix.flow == 'SymbiFlow' run: | . ./.github/scripts/activate.sh - - export F4PGA_BIN_DIR="${F4PGA_INSTALL_DIR}/${FPGA_FAM}"/bin/ - export F4PGA_SHARE_DIR="${F4PGA_INSTALL_DIR}/${FPGA_FAM}"/share/f4pga - export VPRPATH=$F4PGA_BIN_DIR - - echo '::group::Clone f4pga-examples' - git clone --recurse-submodules https://github.com/chipsalliance/f4pga-examples - cd f4pga-examples - echo '::endgroup::' - - cd ${{ matrix.fam }} - + cd f4pga-examples/${{ matrix.fam }} export F4PGA_USE_DEPRECATED=true - case '${{ matrix.fam }}' in xc7) TARGET="arty_35" make -C counter_test;; eos-s3) make -C btn_counter;; @@ -199,7 +184,6 @@ jobs: - name: 🐍 Install f4pga (pip) run: | . ./.github/scripts/activate.sh - cd f4pga pip install . cd .. @@ -207,7 +191,6 @@ jobs: - name: 🚦 Test Python wrappers run: | . ./.github/scripts/activate.sh - pip3 install -r ./test/requirements.txt pytest --verbose --capture=no -rA --color=yes test/ diff --git a/.github/xc7_test.json b/.github/xc7_test.json index 5d0fa4b..3f54412 100644 --- a/.github/xc7_test.json +++ b/.github/xc7_test.json @@ -5,7 +5,7 @@ }, "dependencies": { "sources": [ - "xc7/counter_test/counter.v" + "counter_test/counter.v" ], "synth_log": "synth.log", "pack_log": "pack.log" @@ -13,9 +13,9 @@ "XC7A35TCSG324-1": { "default_target": "bitstream", "dependencies": { - "build_dir": "build/xc7", + "build_dir": "build", "xdc": [ - "xc7/counter_test/arty.xdc" + "counter_test/arty.xdc" ] }, "values": { diff --git a/docs/changes.yml b/docs/changes.yml index af2bb1c..bf72eb4 100644 --- a/docs/changes.yml +++ b/docs/changes.yml @@ -36,7 +36,8 @@ description: | - Tarballs from f4pga-arch-defs now include usable environment and requirements files which allow bootstraping minimal Conda environments. - - The default share path does not include subdir 'install' by default. + - The default F4PGA_SHARE_DIR path does not include subdir 'install' by default. + - F4PGA_BIN_DIR and VPRPATH are not used anymore. 5: examples: 524dfb6e746b632fdeddc9d06d8a002a3c7a3118 diff --git a/f4pga/__init__.py b/f4pga/__init__.py index 538fe3b..fd51bcd 100755 --- a/f4pga/__init__.py +++ b/f4pga/__init__.py @@ -76,8 +76,7 @@ mypath = str(Path(__file__).resolve().parent) FPGA_FAM = environ.get('FPGA_FAM', 'xc7') -bin_dir_path = \ - environ.get('F4PGA_BIN_DIR', str(Path(sys_argv[0]).resolve().parent.parent)) +bin_dir_path = str(Path(sys_argv[0]).resolve().parent.parent) share_dir_path = \ environ.get('F4PGA_SHARE_DIR', str(Path(f'{install_dir}/{FPGA_FAM}/share/f4pga').resolve())) diff --git a/f4pga/setup.py b/f4pga/setup.py index b8bb5e2..50a65cf 100644 --- a/f4pga/setup.py +++ b/f4pga/setup.py @@ -87,11 +87,13 @@ setuptools_setup( ], package_dir={"f4pga": "."}, package_data={ - 'f4pga': ['*.json', 'platforms/*.json'], + 'f4pga': [ + '*.json', + 'platforms/*.json' + ], 'f4pga.wrappers.sh': [ 'xc7/*.f4pga.sh', - 'quicklogic/*.f4pga.sh', - 'quicklogic/env' + 'quicklogic/*.f4pga.sh' ] }, classifiers=[], diff --git a/f4pga/wrappers/sh/__init__.py b/f4pga/wrappers/sh/__init__.py index 7c4cf57..e0325b0 100644 --- a/f4pga/wrappers/sh/__init__.py +++ b/f4pga/wrappers/sh/__init__.py @@ -38,8 +38,7 @@ 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_BIN_DIR'] = f4pga_environ.get('F4PGA_BIN_DIR', str(F4PGA_INSTALL_DIR_PATH / FPGA_FAM / 'conda/bin')) -f4pga_environ['F4PGA_SHARE_DIR'] = f4pga_environ.get('F4PGA_SHARE_DIR', str(F4PGA_INSTALL_DIR_PATH / FPGA_FAM / 'install/share/f4pga')) +f4pga_environ['F4PGA_SHARE_DIR'] = f4pga_environ.get('F4PGA_SHARE_DIR', str(F4PGA_INSTALL_DIR_PATH / FPGA_FAM / 'share/f4pga')) def run_sh(script): diff --git a/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh b/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh index 77315ab..81adca8 100755 --- a/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/analysis.f4pga.sh @@ -18,7 +18,6 @@ set -e -source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/env b/f4pga/wrappers/sh/quicklogic/env deleted file mode 100644 index c2c5f81..0000000 --- a/f4pga/wrappers/sh/quicklogic/env +++ /dev/null @@ -1,22 +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 - -if [ -z $VPRPATH ]; then - export VPRPATH="$F4PGA_BIN_DIR" - export PYTHONPATH="${VPRPATH}/python:${PYTHONPATH}" -fi diff --git a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh index ca77997..69c502c 100755 --- a/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/fasm2bels.f4pga.sh @@ -19,7 +19,6 @@ set -e SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} -BIN_DIR_PATH=${BIN_DIR_PATH:="$F4PGA_BIN_DIR"} OPTS=d:P:p:b:v:o:q LONGOPTS=device:,part:,pcf:,bit:,out-verilog:,out-pcf:,out-qcf:, diff --git a/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh b/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh index 1267520..705a5ce 100755 --- a/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/pack.f4pga.sh @@ -18,7 +18,6 @@ set -e -source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/place.f4pga.sh b/f4pga/wrappers/sh/quicklogic/place.f4pga.sh index 7cb1950..f136d43 100755 --- a/f4pga/wrappers/sh/quicklogic/place.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/place.f4pga.sh @@ -18,7 +18,6 @@ set -e -source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh b/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh index 79a0d82..29a16c4 100755 --- a/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/repack.f4pga.sh @@ -18,7 +18,6 @@ set -e -source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/route.f4pga.sh b/f4pga/wrappers/sh/quicklogic/route.f4pga.sh index effbad2..6e832e7 100755 --- a/f4pga/wrappers/sh/quicklogic/route.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/route.f4pga.sh @@ -18,7 +18,6 @@ set -e -source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args $@ diff --git a/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh b/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh index d21683c..b872413 100755 --- a/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/synth.f4pga.sh @@ -18,8 +18,6 @@ set -e -source $(dirname "$0")/env - export SHARE_DIR_PATH=${SHARE_DIR_PATH:="$F4PGA_SHARE_DIR"} SPLIT_INOUTS=`realpath ${SHARE_DIR_PATH}/scripts/split_inouts.py` CONVERT_OPTS=`realpath ${SHARE_DIR_PATH}/scripts/convert_compile_opts.py` diff --git a/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh b/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh index 3e713dd..b7a503f 100755 --- a/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh +++ b/f4pga/wrappers/sh/quicklogic/write_fasm.f4pga.sh @@ -18,7 +18,6 @@ set -e -source $(dirname "$0")/env source $(dirname "$0")/vpr_common.f4pga.sh parse_args "$@"