diff --git a/.github/workflows/Pipeline.yml b/.github/workflows/Pipeline.yml index 36532a7..c8a08cf 100644 --- a/.github/workflows/Pipeline.yml +++ b/.github/workflows/Pipeline.yml @@ -21,12 +21,13 @@ on: jobs: + Docs: runs-on: ubuntu-latest name: '📓 Docs' steps: - - name: '🧰 Checkout' + - name: 🧰 Checkout uses: actions/checkout@v3 with: submodules: recursive @@ -62,28 +63,28 @@ jobs: git push -u origin +HEAD:gh-pages - Example: + Deprecated: runs-on: ubuntu-latest - name: '🐍 Example' strategy: fail-fast: false matrix: include: - { fam: xc7, example: counter_test } - { fam: eos-s3, example: btn_counter } + name: '🚦 Example (deprecated sh) | ${{ matrix.fam }}' env: F4PGA_INSTALL_DIR: /opt/f4pga F4PGA_FAM: ${{ matrix.fam }} steps: - - name: '🧰 Checkout' + - name: 🧰 Checkout uses: actions/checkout@v3 - - name: '🔧 Prepare environment' + - name: 🔧 Prepare environment run: ./.github/scripts/prepare_environment.sh - - name: '🐍 Install f4pga (pip)' + - name: 🐍 Install f4pga (pip) run: | . ./.github/scripts/activate.sh @@ -91,14 +92,14 @@ jobs: pip install --use-feature=in-tree-build . cd .. - - name: '🚧 Test f4pga-env' + - name: 🚧 Test f4pga-env run: | . ./.github/scripts/activate.sh echo "F4PGA_ENV_BIN=$(f4pga-env bin)" >> "$GITHUB_ENV" echo "F4PGA_ENV_SHARE=$(f4pga-env share)" >> "$GITHUB_ENV" - - name: '🚧 Test make example' + - name: 🚧 Test make example run: | . ./.github/scripts/activate.sh @@ -127,3 +128,47 @@ jobs: name: eos-s3-Bitstream path: f4pga-examples/eos-s3/btn_counter/build/top.bit if-no-files-found: error + + + pyF4PGA: + runs-on: ubuntu-latest + name: '🐍 Example' + env: + F4PGA_INSTALL_DIR: /opt/f4pga + F4PGA_FAM: xc7 + + steps: + + - name: 🧰 Checkout + uses: actions/checkout@v3 +# with: +# submodules: recursive + + - name: 🔧 Prepare environment + run: ./.github/scripts/prepare_environment.sh + + - name: 🐍 Install f4pga (pip) + run: | + . ./.github/scripts/activate.sh + + cd f4pga + pip install --use-feature=in-tree-build . + cd .. + + - name: 🚧 Test py4FPGA build + run: | + . ./.github/scripts/activate.sh + + cd f4pga-examples + f4pga build --flow ../.github/sftest.json -t bitstream + + - name: '📤 Upload artifact: Arty 35 bitstream' + uses: actions/upload-artifact@v3 + with: + name: arty_35-Bitstream-pyF4PGA + path: f4pga-examples/build/arty_35/top.bit + + - name: Test py4FPGA (PYTHONPATH) + run: | + PYTHONPATH=$(pwd) python3 f4pga/__init__.py + PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h diff --git a/.github/workflows/pyF4PGA.yml b/.github/workflows/pyF4PGA.yml deleted file mode 100644 index da498f8..0000000 --- a/.github/workflows/pyF4PGA.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: py4FPGA - -on: - push: - pull_request: - -jobs: - - - Test-pip: - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - - uses: actions/checkout@v2 -# with: -# submodules: recursive - - - name: Prepare environment - run: | - sudo apt update -y - sudo apt install -y git wget xz-utils - - git clone --recurse-submodules https://github.com/chipsalliance/f4pga-examples - cd f4pga-examples - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh - - export INSTALL_DIR=/opt/f4pga - - bash conda_installer.sh -u -b -p $INSTALL_DIR/xc7/conda - source "$INSTALL_DIR/xc7/conda/etc/profile.d/conda.sh" - conda env create -f xc7/environment.yml - - mkdir -p $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-install-5fa5e715.tar.xz | tar -xJC $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 $INSTALL_DIR/xc7/install - - - name: Test py4FPGA build - run: | - export INSTALL_DIR=/opt/f4pga - export PATH="$INSTALL_DIR/xc7/install/bin:$PATH"; - source "$INSTALL_DIR/xc7/conda/etc/profile.d/conda.sh" - - conda activate xc7 - - cd f4pga - pip install --use-feature=in-tree-build . - cd .. - - cd f4pga-examples - f4pga build --flow ../.github/sftest.json -t bitstream - - - name: Test py4FPGA (PYTHONPATH) - run: | - PYTHONPATH=$(pwd) python3 f4pga/__init__.py - PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h diff --git a/f4pga/__init__.py b/f4pga/__init__.py index a99dfe1..a9f7e84 100755 --- a/f4pga/__init__.py +++ b/f4pga/__init__.py @@ -57,7 +57,7 @@ SYMBICACHEPATH = '.symbicache' binpath = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(os.sys.argv[0])), '..')) mypath = str(Path(__file__).resolve().parent) -share_dir_path = os.path.realpath(f"{environ.get('INSTALL_DIR', '/usr/local')}/xc7/install/share/symbiflow") +share_dir_path = os.path.realpath(f"{environ.get('F4PGA_INSTALL_DIR', '/usr/local')}/xc7/install/share/symbiflow") class DependencyNotProducedException(Exception): dep_name: str