From 22003c2f49cac10d7f3c90d1a1507bcb05657cda Mon Sep 17 00:00:00 2001 From: Unai Martinez-Corral Date: Tue, 1 Mar 2022 20:37:47 +0100 Subject: [PATCH] ci: make examples env Signed-off-by: Unai Martinez-Corral --- .github/sftest.json | 2 +- .github/workflows/pyF4PGA.yml | 33 +++++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/sftest.json b/.github/sftest.json index 3870ace..6beeb02 100644 --- a/.github/sftest.json +++ b/.github/sftest.json @@ -5,7 +5,7 @@ }, "dependencies": { "sources": [ - "counter.v" + "xc7/counter_test/counter.v" ], "synth_log": "synth.log", "pack_log": "pack.log" diff --git a/.github/workflows/pyF4PGA.yml b/.github/workflows/pyF4PGA.yml index c3bccf1..95e23a4 100644 --- a/.github/workflows/pyF4PGA.yml +++ b/.github/workflows/pyF4PGA.yml @@ -17,15 +17,36 @@ jobs: # with: # submodules: recursive - - name: Test py4FPGA + - name: Prepare environment run: | - pip3 install -r f4pga/requirements.txt + sudo apt update -y + sudo apt install -y git wget xz-utils - PYTHONPATH=$(pwd)/f4pga python3 f4pga/sfbuild.py + git clone --recurse-submodules https://github.com/chipsalliance/f4pga-examples + cd f4pga-examples - PYTHONPATH=$(pwd)/f4pga python3 f4pga/sfbuild.py -h + 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: | - make env - PYTHONPATH=$(pwd)/f4pga python3 f4pga/sfbuild.py build --flow .github/sftest.json -t bitstream + cd f4pga-examples + + 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 + + pip install -r ../f4pga/requirements.txt + + PYTHONPATH=$(pwd)/../f4pga python3 ../f4pga/sfbuild.py build --flow ../.github/sftest.json -t bitstream