From faec0ea7828908bba3d5126b4d0d1ba93301115f Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Thu, 10 Dec 2020 14:35:19 -0700 Subject: [PATCH 01/23] Github action optimizations --- .dockerignore | 22 ++- .github/workflows/build.yml | 244 +++++++++++------------- .github/workflows/install_dependency.sh | 51 ----- .gitignore | 2 + docker/Dockerfile.base | 42 ++++ docker/Dockerfile.clang-6 | 2 + docker/Dockerfile.clang-8 | 2 + docker/Dockerfile.gcc-5 | 2 + docker/Dockerfile.gcc-6 | 2 + docker/Dockerfile.gcc-7 | 2 + docker/Dockerfile.gcc-8 | 2 + docker/Dockerfile.gcc-9 | 4 + docker/Dockerfile.run | 4 + docker/Dockerfile.test | 5 + 14 files changed, 196 insertions(+), 190 deletions(-) delete mode 100644 .github/workflows/install_dependency.sh create mode 100755 docker/Dockerfile.base create mode 100644 docker/Dockerfile.clang-6 create mode 100644 docker/Dockerfile.clang-8 create mode 100644 docker/Dockerfile.gcc-5 create mode 100644 docker/Dockerfile.gcc-6 create mode 100644 docker/Dockerfile.gcc-7 create mode 100644 docker/Dockerfile.gcc-8 create mode 100644 docker/Dockerfile.gcc-9 create mode 100644 docker/Dockerfile.run create mode 100644 docker/Dockerfile.test diff --git a/.dockerignore b/.dockerignore index 2e0e43deb..d6bfe66a2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,20 @@ -# Ignore everything -* \ No newline at end of file +abc +ace2 +build +cmake +CMakeLists.txt +deploy_key.enc +docker +Dockerfile +docs +libopenfpga +libs +LICENSE +openfpga +openfpga_flow +openfpga.sh +README.md +run_local.bat +run_local.sh +vpr +yosys diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a698695e..f4878b9eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,118 +21,52 @@ jobs: # Test the compilation compatibility linux_build: name: ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} - + runs-on: ubuntu-18.04 + container: ghcr.io/lnis-uofu/openfpga-buildenv-${{ matrix.config.cc}} # Branch on different OS and settings strategy: fail-fast: false matrix: config: - - { - name: "Build Compatibility: GCC-5 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-gcc5-build.7z", - os: ubuntu-18.04, - cc: "gcc-5", cxx: "g++-5" - } - - - { - name: "Build Compatibility: GCC-6 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-gcc6-build.7z", - os: ubuntu-18.04, - cc: "gcc-6", cxx: "g++-6" - } - - - { - name: "Build Compatibility: GCC-7 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-gcc7-build.7z", - os: ubuntu-18.04, - cc: "gcc-7", cxx: "g++-7" - } - - - { - name: "Build Compatibility: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8" - } - - - { - name: "Build Compatibility: GCC-9 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-gcc9-build.7z", - os: ubuntu-18.04, - cc: "gcc-9", cxx: "g++-9" - } - - - { - name: "Build Compatibility: Clang-6 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-clang6-build.7z", - os: ubuntu-18.04, - cc: "clang-6.0", cxx: "clang++-6.0" - } - - - { - name: "Build Compatibility: Clang-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-ubuntu-18.04-clang8-build.7z", - os: ubuntu-18.04, - cc: "clang-8", cxx: "clang++-8" - } - - - { - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-basic-tests-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8", - reg_script: "basic_reg_test.sh" - } - - - { - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-fpga-verilog-tests-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8", - reg_script: "fpga_verilog_reg_test.sh" - } - - - { - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-fpga-bitstream-tests-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8", - reg_script: "fpga_bitstream_reg_test.sh" - } - - - { - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-fpga-sdc-tests-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8", - reg_script: "fpga_sdc_reg_test.sh" - } - - - { - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)", - artifact: "OpenFPGA-fpga-spice-tests-ubuntu-18.04-gcc8-build.7z", - os: ubuntu-18.04, - cc: "gcc-8", cxx: "g++-8", - reg_script: "fpga_spice_reg_test.sh" - } - - + - name: "Build Compatibility: GCC-5 (Ubuntu 18.04)" + cc: gcc-5 + cxx: g++-5 + - name: "Build Compatibility: GCC-6 (Ubuntu 18.04)" + cc: gcc-6 + cxx: g++-6 + - name: "Build Compatibility: GCC-7 (Ubuntu 18.04)" + cc: gcc-7 + cxx: g++-7 + - name: "Build Compatibility: GCC-8 (Ubuntu 18.04)" + cc: gcc-8 + cxx: g++-8 + - name: "Build Compatibility: GCC-9 (Ubuntu 18.04)" + cc: gcc-9 + cxx: g++-9 + - name: "Build Compatibility: Clang-6 (Ubuntu 18.04)" + cc: clang-6.0 + cxx: clang++-6.0 + - name: "Build Compatibility: Clang-8 (Ubuntu 18.04)" + cc: clang-8 + cxx: clang++-8 # Define the steps to run the build job + env: + CC: ${{ matrix.config.cc }} + CXX: ${{ matrix.config.cxx }} + CCACHE_COMPRESS: "true" + CCACHE_COMPRESSLEVEL: "6" + CCACHE_MAXSIZE: "400M" + CCACHE_LOGFILE: ccache_log + CCACHE_DIR: /__w/OpenFPGA/.ccache steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 - - name: Install dependency - run: source ./.github/workflows/install_dependency.sh - - - name: Checkout CMake version - run: cmake --version - - - name: Checkout iVerilog version + - name: Dump tool versions run: | - iverilog -V - vvp -V + cmake --version + iverilog -V + vvp -V - name: Prepare ccache timestamp id: ccache_cache_timestamp @@ -144,58 +78,94 @@ jobs: - name: Create CMake build environment # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands - run: cmake -E make_directory ${{runner.workspace}}/build - - - name: ccache cache files + run: cmake -E make_directory build + + - name: Setup ccache uses: actions/cache@v2 with: - path: ${{runner.workspace}}/.ccache - key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + path: | + /__w/OpenFPGA/.ccache + key: ${{ matrix.config.cc }}-ccache-${{ github.ref}} restore-keys: | - ${{ matrix.config.name }}-ccache- - - # Set up the paths for ccache and control the size under 400MB - - name: Configure ccache - shell: cmake -P {0} - run: | - file(TO_CMAKE_PATH ${{runner.workspace}} ccache_basedir) - set(ENV{CCACHE_BASEDIR} "${ccache_basedir}") - set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache") - set(ENV{CCACHE_COMPRESS} "true") - set(ENV{CCACHE_COMPRESSLEVEL} "6") - set(ENV{CCACHE_MAXSIZE} "400M") - - execute_process(COMMAND ccache -p) - execute_process(COMMAND ccache -z) + ${{ matrix.config.cc }}-ccache- - name: Configure CMake # Use a bash shell so we can use the same syntax for environment variable # access regardless of the host operating system shell: bash - working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + working-directory: build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + # run: | - export CC=${{ matrix.config.cc }} - export CXX=${{ matrix.config.cxx }} - cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + ccache -p + ccache -z + cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE - name: Build - working-directory: ${{runner.workspace}}/build + working-directory: build shell: bash # Execute the build. You can specify a specific target with "--target " run: | - cmake --build . --config $BUILD_TYPE + cmake --build . --config $BUILD_TYPE # Check the cache size and see if it is over the limit - name: Check ccache size - shell: cmake -P {0} - run: | - execute_process(COMMAND ccache -s) - - - name: ${{matrix.config.name}} - if: contains(matrix.config.name, 'Regression Test') + run: ccache -s + - name: Upload artifact + uses: actions/upload-artifact@v2 + if: ${{ matrix.config.cc == 'gcc-8'}} + with: + name: openfpga + path: | + abc/abc + abc/libabc.a + ace2/ace + ace2/libace.a + openfpga/libopenfpga.a + openfpga/openfpga + vpr/libvpr.a + vpr/vpr + yosys/share/ + yosys/yosys + yosys/yosys-abc + yosys/yosys-config + yosys/yosys-filterlib + yosys/yosys-smtbmc + regression_tests: + name: Regression tests + runs-on: ubuntu-18.04 + container: ghcr.io/lnis-uofu/openfpga-buildenv-test + needs: linux_build + defaults: + run: shell: bash - # Execute the test. - run: source ./.github/workflows/${{matrix.config.reg_script}} + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + - name: Download a built artifacts + uses: actions/download-artifact@v2 + with: + name: openfpga + - name: chmod + run: | + chmod +x abc/abc + chmod +x ace2/ace + chmod +x openfpga/openfpga + chmod +x vpr/vpr + chmod +x yosys/yosys + chmod +x yosys/yosys-abc + chmod +x yosys/yosys-config + chmod +x yosys/yosys-filterlib + chmod +x yosys/yosys-smtbmc + - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" + run: source .github/workflows/basic_reg_test.sh + - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" + run: source .github/workflows/fpga_verilog_reg_test.sh + - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" + run: source .github/workflows/fpga_bitstream_reg_test.sh + - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" + run: source .github/workflows/fpga_sdc_reg_test.sh + - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" + run: source .github/workflows/fpga_spice_reg_test.sh diff --git a/.github/workflows/install_dependency.sh b/.github/workflows/install_dependency.sh deleted file mode 100644 index c4f70c29f..000000000 --- a/.github/workflows/install_dependency.sh +++ /dev/null @@ -1,51 +0,0 @@ -# Install all the dependency for OpenFPGA in Ubuntu-18.04 -sudo apt-get update -sudo apt-get install autoconf -sudo apt-get install automake -sudo apt-get install bash -sudo apt-get install bison -sudo apt-get install build-essential -sudo apt-get install cmake -sudo apt-get install ccache -sudo apt-get install ctags -sudo apt-get install curl -sudo apt-get install doxygen -sudo apt-get install flex -sudo apt-get install fontconfig -sudo apt-get install gdb -sudo apt-get install git -sudo apt-get install gperf -sudo apt-get install iverilog -sudo apt-get install libcairo2-dev -sudo apt-get install libevent-dev -sudo apt-get install libfontconfig1-dev -sudo apt-get install liblist-moreutils-perl -sudo apt-get install libncurses5-dev -sudo apt-get install libx11-dev -sudo apt-get install libxft-dev -sudo apt-get install libxml++2.6-dev -sudo apt-get install perl -sudo apt-get install python -sudo apt-get install python3-setuptools -sudo apt-get install python-lxml -sudo apt-get install texinfo -sudo apt-get install time -sudo apt-get install valgrind -sudo apt-get install zip -sudo apt-get install qt5-default -sudo apt-get install clang-format-7 -# Add all the supported compilers -sudo apt-get install g++-5 -sudo apt-get install gcc-5 -sudo apt-get install g++-6 -sudo apt-get install gcc-6 -sudo apt-get install g++-7 -sudo apt-get install gcc-7 -sudo apt-get install g++-8 -sudo apt-get install gcc-8 -sudo apt-get install g++-9 -sudo apt-get install gcc-9 -sudo apt-get install clang-6.0 -sudo apt-get install clang-8 -# Python dependencies -python3 -m pip install -r /home/runner/work/OpenFPGA/OpenFPGA/requirements.txt diff --git a/.gitignore b/.gitignore index 830a45dd3..4fdc97134 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,5 @@ build/ message.txt deploy_key +openfpga/openfpga +vpr/vpr diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base new file mode 100755 index 000000000..10af574f9 --- /dev/null +++ b/docker/Dockerfile.base @@ -0,0 +1,42 @@ +FROM ubuntu:18.04 +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y \ + autoconf \ + automake \ + bison \ + ccache \ + cmake \ + ctags \ + curl \ + doxygen \ + flex \ + fontconfig \ + gdb \ + git \ + gperf \ + iverilog \ + libc6-dev \ + libcairo2-dev \ + libevent-dev \ + libffi-dev \ + libfontconfig1-dev \ + liblist-moreutils-perl \ + libncurses5-dev \ + libreadline-dev \ + libx11-dev \ + libxft-dev \ + libxml++2.6-dev \ + make \ + perl \ + pkg-config \ + python3 \ + python3-setuptools \ + python3-lxml \ + python3-pip \ + qt5-default \ + texinfo \ + time \ + valgrind \ + zip +ADD requirements.txt requirements.txt +RUN python3 -m pip install -r requirements.txt diff --git a/docker/Dockerfile.clang-6 b/docker/Dockerfile.clang-6 new file mode 100644 index 000000000..06d8de846 --- /dev/null +++ b/docker/Dockerfile.clang-6 @@ -0,0 +1,2 @@ +FROM openfpga-buildenv-base +RUN apt-get update && apt-get install -y clang-format-7 clang-6.0 diff --git a/docker/Dockerfile.clang-8 b/docker/Dockerfile.clang-8 new file mode 100644 index 000000000..af7bb08b8 --- /dev/null +++ b/docker/Dockerfile.clang-8 @@ -0,0 +1,2 @@ +FROM openfpga-buildenv-base +RUN apt-get update && apt-get install -y clang-format-7 clang-8 diff --git a/docker/Dockerfile.gcc-5 b/docker/Dockerfile.gcc-5 new file mode 100644 index 000000000..84790fd6c --- /dev/null +++ b/docker/Dockerfile.gcc-5 @@ -0,0 +1,2 @@ +FROM openfpga-buildenv-base +RUN apt-get update && apt-get install -y gcc-5 g++-5 diff --git a/docker/Dockerfile.gcc-6 b/docker/Dockerfile.gcc-6 new file mode 100644 index 000000000..3b8ae6894 --- /dev/null +++ b/docker/Dockerfile.gcc-6 @@ -0,0 +1,2 @@ +FROM openfpga-buildenv-base +RUN apt-get update && apt-get install -y gcc-6 g++-6 diff --git a/docker/Dockerfile.gcc-7 b/docker/Dockerfile.gcc-7 new file mode 100644 index 000000000..7c86b9857 --- /dev/null +++ b/docker/Dockerfile.gcc-7 @@ -0,0 +1,2 @@ +FROM openfpga-buildenv-base +RUN apt-get update && apt-get install -y gcc-7 g++-7 diff --git a/docker/Dockerfile.gcc-8 b/docker/Dockerfile.gcc-8 new file mode 100644 index 000000000..58ea8c928 --- /dev/null +++ b/docker/Dockerfile.gcc-8 @@ -0,0 +1,2 @@ +FROM openfpga-buildenv-base +RUN apt-get update && apt-get install -y gcc-8 g++-8 diff --git a/docker/Dockerfile.gcc-9 b/docker/Dockerfile.gcc-9 new file mode 100644 index 000000000..a8822a993 --- /dev/null +++ b/docker/Dockerfile.gcc-9 @@ -0,0 +1,4 @@ +FROM openfpga-buildenv-base +RUN apt-get install -y software-properties-common +RUN add-apt-repository ppa:ubuntu-toolchain-r/test +RUN apt-get update && apt-get install -y gcc-9 g++-9 diff --git a/docker/Dockerfile.run b/docker/Dockerfile.run new file mode 100644 index 000000000..4f0fd646d --- /dev/null +++ b/docker/Dockerfile.run @@ -0,0 +1,4 @@ +FROM ubuntu:18.04 +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y \ + libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test new file mode 100644 index 000000000..23845714b --- /dev/null +++ b/docker/Dockerfile.test @@ -0,0 +1,5 @@ +FROM ubuntu:18.04 +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y \ + libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 +RUN apt-get install -y libdatetime-perl iverilog From d77aa19ae19732392854b5ca26fc2f1589861b73 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Thu, 10 Dec 2020 15:49:02 -0700 Subject: [PATCH 02/23] Run tests in parallel --- .github/workflows/build.yml | 30 +++++++++++++++++------------- docker/Dockerfile.test | 4 +++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4878b9eb..77554bbc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,9 +138,20 @@ jobs: runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-buildenv-test needs: linux_build - defaults: - run: - shell: bash + strategy: + fail-fast: false + matrix: + config: + - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" + script: basic_reg_test.sh + - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_verilog_reg_test.sh + - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_bitstream_reg_test.sh + - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_sdc_reg_test.sh + - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_spice_reg_test.sh steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 @@ -159,13 +170,6 @@ jobs: chmod +x yosys/yosys-config chmod +x yosys/yosys-filterlib chmod +x yosys/yosys-smtbmc - - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" - run: source .github/workflows/basic_reg_test.sh - - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" - run: source .github/workflows/fpga_verilog_reg_test.sh - - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" - run: source .github/workflows/fpga_bitstream_reg_test.sh - - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" - run: source .github/workflows/fpga_sdc_reg_test.sh - - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" - run: source .github/workflows/fpga_spice_reg_test.sh + - name: ${{matrix.config.name}} + shell: bash + run: source .github/workflows/${{matrix.config.script}} diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 23845714b..97321ac44 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -2,4 +2,6 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 -RUN apt-get install -y libdatetime-perl iverilog +RUN apt-get install -y libdatetime-perl iverilog python3-pip +ADD requirements.txt requirements.txt +RUN python3 -m pip install -r requirements.txt From e280b5b344d06312d2fe49d3ed3f2441b02f507e Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Tue, 22 Dec 2020 17:35:49 -0700 Subject: [PATCH 03/23] Add docker build workflow and fix submodule issues. --- .dockerignore | 1 + .github/workflows/docker.yml | 79 +++++++++++++++++++ .../workflows/install_dependencies_build.sh | 38 +++++++++ .../workflows/install_dependencies_runtime.sh | 2 + .../workflows/install_dependencies_test.sh | 2 + .github/workflows/install_dependency.sh | 53 ------------- .github/workflows/labeler.yml | 2 +- docker/Dockerfile.base | 43 ++-------- docker/Dockerfile.clang-6 | 2 +- docker/Dockerfile.clang-8 | 2 +- docker/Dockerfile.gcc-5 | 2 +- docker/Dockerfile.gcc-6 | 2 +- docker/Dockerfile.gcc-7 | 2 +- docker/Dockerfile.gcc-8 | 2 +- docker/Dockerfile.gcc-9 | 2 +- docker/Dockerfile.run | 4 +- docker/Dockerfile.test | 5 +- 17 files changed, 139 insertions(+), 104 deletions(-) create mode 100644 .github/workflows/docker.yml create mode 100644 .github/workflows/install_dependencies_build.sh create mode 100644 .github/workflows/install_dependencies_runtime.sh create mode 100644 .github/workflows/install_dependencies_test.sh delete mode 100644 .github/workflows/install_dependency.sh diff --git a/.dockerignore b/.dockerignore index d6bfe66a2..48dba644c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,6 +10,7 @@ docs libopenfpga libs LICENSE +Makefile openfpga openfpga_flow openfpga.sh diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..a378f4e4a --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,79 @@ +name: Build docker CI images +on: + - workflow_dispatch +jobs: + base_images: + name: Push Docker images + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - name: Build base + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.base + add_git_labels: true + push: true + tags: ghcr.io/lnis-uofu/openfpga-buildenv-base:latest + - name: Build test image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.test + add_git_labels: true + push: true + tags: ghcr.io/lnis-uofu/openfpga-buildenv-test:latest + - name: Build run time image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.run + add_git_labels: true + push: true + tags: ghcr.io/lnis-uofu/openfpga-buildenv-run:latest + compiler_images: + name: Build ${{ matrix.compiler }} compiler image + needs: base_images + runs-on: ubuntu-latest + strategy: + matrix: + compiler: + - gcc-5 + - gcc-6 + - gcc-7 + - gcc-8 + - gcc-9 + - clang-6 + - clang-8 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - name: Build ${{ matrix.compiler }} image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.${{ matrix.compiler }} + add_git_labels: true + push: true + tags: ghcr.io/lnis-uofu/openfpga-buildenv-${{ matrix.compiler }}:latest diff --git a/.github/workflows/install_dependencies_build.sh b/.github/workflows/install_dependencies_build.sh new file mode 100644 index 000000000..e81822b54 --- /dev/null +++ b/.github/workflows/install_dependencies_build.sh @@ -0,0 +1,38 @@ +apt-get update && apt-get install -y \ + autoconf \ + automake \ + bison \ + ccache \ + cmake \ + ctags \ + curl \ + doxygen \ + flex \ + fontconfig \ + gdb \ + git \ + gperf \ + iverilog \ + libc6-dev \ + libcairo2-dev \ + libevent-dev \ + libffi-dev \ + libfontconfig1-dev \ + liblist-moreutils-perl \ + libncurses5-dev \ + libreadline-dev \ + libx11-dev \ + libxft-dev \ + libxml++2.6-dev \ + make \ + perl \ + pkg-config \ + python3 \ + python3-setuptools \ + python3-lxml \ + python3-pip \ + qt5-default \ + texinfo \ + time \ + valgrind \ + zip diff --git a/.github/workflows/install_dependencies_runtime.sh b/.github/workflows/install_dependencies_runtime.sh new file mode 100644 index 000000000..7aafb31c6 --- /dev/null +++ b/.github/workflows/install_dependencies_runtime.sh @@ -0,0 +1,2 @@ +apt-get update && apt-get install -y \ + libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 diff --git a/.github/workflows/install_dependencies_test.sh b/.github/workflows/install_dependencies_test.sh new file mode 100644 index 000000000..9c416b8fd --- /dev/null +++ b/.github/workflows/install_dependencies_test.sh @@ -0,0 +1,2 @@ +apt-get update && apt-get install -y libdatetime-perl iverilog python3-pip \ + libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 diff --git a/.github/workflows/install_dependency.sh b/.github/workflows/install_dependency.sh deleted file mode 100644 index b20184fea..000000000 --- a/.github/workflows/install_dependency.sh +++ /dev/null @@ -1,53 +0,0 @@ -# Install all the dependency for OpenFPGA in Ubuntu-18.04 -sudo apt-get update -sudo apt-get install autoconf -sudo apt-get install automake -sudo apt-get install bash -sudo apt-get install bison -sudo apt-get install build-essential -sudo apt-get install cmake -sudo apt-get install ccache -sudo apt-get install ctags -sudo apt-get install curl -sudo apt-get install doxygen -sudo apt-get install flex -sudo apt-get install fontconfig -sudo apt-get install gdb -sudo apt-get install git -sudo apt-get install gperf -sudo apt-get install iverilog -sudo apt-get install libcairo2-dev -sudo apt-get install libevent-dev -sudo apt-get install libfontconfig1-dev -sudo apt-get install liblist-moreutils-perl -sudo apt-get install libncurses5-dev -sudo apt-get install libx11-dev -sudo apt-get install libxft-dev -sudo apt-get install libxml++2.6-dev -sudo apt-get install perl -sudo apt-get install python -sudo apt-get install python3-setuptools -sudo apt-get install python-lxml -sudo apt-get install tcllib -sudo apt-get install tcl8.6-dev -sudo apt-get install texinfo -sudo apt-get install time -sudo apt-get install valgrind -sudo apt-get install zip -sudo apt-get install qt5-default -sudo apt-get install clang-format-7 -# Add all the supported compilers -sudo apt-get install g++-5 -sudo apt-get install gcc-5 -sudo apt-get install g++-6 -sudo apt-get install gcc-6 -sudo apt-get install g++-7 -sudo apt-get install gcc-7 -sudo apt-get install g++-8 -sudo apt-get install gcc-8 -sudo apt-get install g++-9 -sudo apt-get install gcc-9 -sudo apt-get install clang-6.0 -sudo apt-get install clang-8 -# Python dependencies -python3 -m pip install -r /home/runner/work/OpenFPGA/OpenFPGA/requirements.txt diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 20a5e480d..808aaa18b 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,6 +1,6 @@ name: "Pull Request Labeler" on: -- pull_request_target + - pull_request_target jobs: triage: diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 10af574f9..c635bd4c0 100755 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -1,42 +1,9 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y \ - autoconf \ - automake \ - bison \ - ccache \ - cmake \ - ctags \ - curl \ - doxygen \ - flex \ - fontconfig \ - gdb \ - git \ - gperf \ - iverilog \ - libc6-dev \ - libcairo2-dev \ - libevent-dev \ - libffi-dev \ - libfontconfig1-dev \ - liblist-moreutils-perl \ - libncurses5-dev \ - libreadline-dev \ - libx11-dev \ - libxft-dev \ - libxml++2.6-dev \ - make \ - perl \ - pkg-config \ - python3 \ - python3-setuptools \ - python3-lxml \ - python3-pip \ - qt5-default \ - texinfo \ - time \ - valgrind \ - zip +RUN apt-get update && apt-get install software-properties-common -y +# 18.04 includes 2.17 but github requires 2.18+ to support submodules. +RUN add-apt-repository ppa:git-core/ppa +ADD .github/workflows/install_dependencies_build.sh install_dependencies_build.sh +RUN bash install_dependencies_build.sh ADD requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt diff --git a/docker/Dockerfile.clang-6 b/docker/Dockerfile.clang-6 index 06d8de846..a1b4d4bbe 100644 --- a/docker/Dockerfile.clang-6 +++ b/docker/Dockerfile.clang-6 @@ -1,2 +1,2 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get update && apt-get install -y clang-format-7 clang-6.0 diff --git a/docker/Dockerfile.clang-8 b/docker/Dockerfile.clang-8 index af7bb08b8..4224c869d 100644 --- a/docker/Dockerfile.clang-8 +++ b/docker/Dockerfile.clang-8 @@ -1,2 +1,2 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get update && apt-get install -y clang-format-7 clang-8 diff --git a/docker/Dockerfile.gcc-5 b/docker/Dockerfile.gcc-5 index 84790fd6c..78f037b68 100644 --- a/docker/Dockerfile.gcc-5 +++ b/docker/Dockerfile.gcc-5 @@ -1,2 +1,2 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get update && apt-get install -y gcc-5 g++-5 diff --git a/docker/Dockerfile.gcc-6 b/docker/Dockerfile.gcc-6 index 3b8ae6894..abb8e107b 100644 --- a/docker/Dockerfile.gcc-6 +++ b/docker/Dockerfile.gcc-6 @@ -1,2 +1,2 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get update && apt-get install -y gcc-6 g++-6 diff --git a/docker/Dockerfile.gcc-7 b/docker/Dockerfile.gcc-7 index 7c86b9857..4cf7c4074 100644 --- a/docker/Dockerfile.gcc-7 +++ b/docker/Dockerfile.gcc-7 @@ -1,2 +1,2 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get update && apt-get install -y gcc-7 g++-7 diff --git a/docker/Dockerfile.gcc-8 b/docker/Dockerfile.gcc-8 index 58ea8c928..33a5e911a 100644 --- a/docker/Dockerfile.gcc-8 +++ b/docker/Dockerfile.gcc-8 @@ -1,2 +1,2 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get update && apt-get install -y gcc-8 g++-8 diff --git a/docker/Dockerfile.gcc-9 b/docker/Dockerfile.gcc-9 index a8822a993..224277a9a 100644 --- a/docker/Dockerfile.gcc-9 +++ b/docker/Dockerfile.gcc-9 @@ -1,4 +1,4 @@ -FROM openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-buildenv-base RUN apt-get install -y software-properties-common RUN add-apt-repository ppa:ubuntu-toolchain-r/test RUN apt-get update && apt-get install -y gcc-9 g++-9 diff --git a/docker/Dockerfile.run b/docker/Dockerfile.run index 4f0fd646d..f682513a3 100644 --- a/docker/Dockerfile.run +++ b/docker/Dockerfile.run @@ -1,4 +1,4 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y \ - libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 +ADD .github/workflows/install_dependencies_runtime.sh install_dependencies_runtime.sh +RUN bash install_dependencies_runtime.sh diff --git a/docker/Dockerfile.test b/docker/Dockerfile.test index 97321ac44..39da4722d 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.test @@ -1,7 +1,6 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y \ - libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 -RUN apt-get install -y libdatetime-perl iverilog python3-pip +ADD .github/workflows/install_dependencies_test.sh install_dependencies_test.sh +RUN bash install_dependencies_test.sh ADD requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt From 6f42d0c7958b32ad4bcfb219ca785dd4da3b8759 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Tue, 22 Dec 2020 18:14:09 -0700 Subject: [PATCH 04/23] Add missing tcl dependencies --- .github/workflows/install_dependencies_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/install_dependencies_build.sh b/.github/workflows/install_dependencies_build.sh index e81822b54..3f6ef089e 100644 --- a/.github/workflows/install_dependencies_build.sh +++ b/.github/workflows/install_dependencies_build.sh @@ -32,6 +32,8 @@ apt-get update && apt-get install -y \ python3-lxml \ python3-pip \ qt5-default \ + tcllib \ + tcl8.6-dev \ texinfo \ time \ valgrind \ From cf022c63a14f8af993aba37fa7a755ff0478b52d Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Mon, 4 Jan 2021 11:31:14 -0700 Subject: [PATCH 05/23] Fix mismatch in clang 6 names. --- .github/workflows/docker.yml | 2 +- docker/{Dockerfile.clang-6 => Dockerfile.clang-6.0} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename docker/{Dockerfile.clang-6 => Dockerfile.clang-6.0} (100%) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a378f4e4a..5203c0e95 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -54,7 +54,7 @@ jobs: - gcc-7 - gcc-8 - gcc-9 - - clang-6 + - clang-6.0 - clang-8 steps: - name: Checkout diff --git a/docker/Dockerfile.clang-6 b/docker/Dockerfile.clang-6.0 similarity index 100% rename from docker/Dockerfile.clang-6 rename to docker/Dockerfile.clang-6.0 From 4efa5b98e877d852335cd9f282e9a498cc70c251 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Wed, 13 Jan 2021 13:58:20 -0700 Subject: [PATCH 06/23] Add docker distribution image. --- .dockerignore | 10 ++++++++++ .github/workflows/build.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/docker.yml | 11 ----------- docker/Dockerfile.run | 6 +++++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.dockerignore b/.dockerignore index 48dba644c..289b353cc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -19,3 +19,13 @@ run_local.bat run_local.sh vpr yosys + +!abc/abc +!ace2/ace +!openfpga/openfpga +!vpr/vpr +!yosys/yosys +!yosys/yosys-abc +!yosys/yosys-config +!yosys/yosys-filterlib +!yosys/yosys-smtbmc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e46d2648f..bb93d63b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -135,6 +135,34 @@ jobs: yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc + docker_distribution: + name: Build docker image for distribution + runs-on: ubuntu-latest + needs: linux_build + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + - name: Download a built artifacts + uses: actions/download-artifact@v2 + with: + name: openfpga + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.run + push: true + tags: ghcr.io/lnis-uofu/openfpga-run:latest regression_tests: name: Regression tests runs-on: ubuntu-18.04 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5203c0e95..b0249117f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -23,7 +23,6 @@ jobs: with: context: . file: ./docker/Dockerfile.base - add_git_labels: true push: true tags: ghcr.io/lnis-uofu/openfpga-buildenv-base:latest - name: Build test image @@ -31,17 +30,8 @@ jobs: with: context: . file: ./docker/Dockerfile.test - add_git_labels: true push: true tags: ghcr.io/lnis-uofu/openfpga-buildenv-test:latest - - name: Build run time image - uses: docker/build-push-action@v2 - with: - context: . - file: ./docker/Dockerfile.run - add_git_labels: true - push: true - tags: ghcr.io/lnis-uofu/openfpga-buildenv-run:latest compiler_images: name: Build ${{ matrix.compiler }} compiler image needs: base_images @@ -74,6 +64,5 @@ jobs: with: context: . file: ./docker/Dockerfile.${{ matrix.compiler }} - add_git_labels: true push: true tags: ghcr.io/lnis-uofu/openfpga-buildenv-${{ matrix.compiler }}:latest diff --git a/docker/Dockerfile.run b/docker/Dockerfile.run index f682513a3..f73aeec38 100644 --- a/docker/Dockerfile.run +++ b/docker/Dockerfile.run @@ -1,4 +1,8 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive -ADD .github/workflows/install_dependencies_runtime.sh install_dependencies_runtime.sh +COPY .github/workflows/install_dependencies_runtime.sh install_dependencies_runtime.sh RUN bash install_dependencies_runtime.sh +RUN mkdir /opt/openfpga +COPY abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/ +RUN cd /opt/openfpga && chmod +x abc ace openfpga vpr yosys yosys-abc yosys-config yosys-filterlib yosys-smtbmc +ENV PATH="/opt/openfpga:${PATH}" From 2b705ba17aa0f2544d22b2bb7d8ed59189796a64 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Wed, 13 Jan 2021 16:38:13 -0700 Subject: [PATCH 07/23] Add building a regression test image on master. --- .github/workflows/build.yml | 21 +++++++++++++---- .github/workflows/regression.yml | 39 ++++++++++++++++++++++++++++++++ docker/Dockerfile.regression | 5 ++++ 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/regression.yml create mode 100644 docker/Dockerfile.regression diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb93d63b3..182b79df7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,16 @@ name: linux_build # Run CI on -# - each push -# - each pull request -# - scheduled weekly +# - each push if no code has changed on: push: + paths: + - '**.c' + - '**.cc' + - '**.c\+\+' + - '**.cpp' + - '**.h' + - '**.hh' pull_request: schedule: - cron: '0 0 * * 0 ' # weekly @@ -137,6 +142,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution + if: ${{ github.ref == 'refs/heads/master'}} runs-on: ubuntu-latest needs: linux_build steps: @@ -156,13 +162,20 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - name: Build and push + - name: Build and push runtime image uses: docker/build-push-action@v2 with: context: . file: ./docker/Dockerfile.run push: true tags: ghcr.io/lnis-uofu/openfpga-run:latest + - name: Build and push test image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.test + push: true + tags: ghcr.io/lnis-uofu/openfpga-regression-tests:latest regression_tests: name: Regression tests runs-on: ubuntu-18.04 diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml new file mode 100644 index 000000000..5386463d2 --- /dev/null +++ b/.github/workflows/regression.yml @@ -0,0 +1,39 @@ +name: regression_tests + +# Run regressions on each push if no code has changed +on: + push: + paths-ignore: + - '**.c' + - '**.cc' + - '**.c\+\+' + - '**.cpp' + - '**.h' + - '**.hh' + +# Multiple job to tests +jobs: + regression_tests: + name: Regression tests + runs-on: ubuntu-18.04 + container: ghcr.io/lnis-uofu/openfpga-regression-tests:latest + strategy: + fail-fast: false + matrix: + config: + - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" + script: basic_reg_test.sh + - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_verilog_reg_test.sh + - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_bitstream_reg_test.sh + - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_sdc_reg_test.sh + - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_spice_reg_test.sh + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + - name: ${{matrix.config.name}} + shell: bash + run: source .github/workflows/${{matrix.config.script}} diff --git a/docker/Dockerfile.regression b/docker/Dockerfile.regression new file mode 100644 index 000000000..25ba2cbbd --- /dev/null +++ b/docker/Dockerfile.regression @@ -0,0 +1,5 @@ +FROM ghcr.io/lnis-uofu/openfpga-buildenv-test:latest +RUN mkdir /opt/openfpga +COPY abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/ +RUN cd /opt/openfpga && chmod +x abc ace openfpga vpr yosys yosys-abc yosys-config yosys-filterlib yosys-smtbmc +ENV PATH="/opt/openfpga:${PATH}" From effe86fb9edc1d10950941395e530767a9b13286 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Wed, 13 Jan 2021 17:16:39 -0700 Subject: [PATCH 08/23] Remove pull request trigger --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 182b79df7..b2995b3a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,6 @@ on: - '**.cpp' - '**.h' - '**.hh' - pull_request: schedule: - cron: '0 0 * * 0 ' # weekly From 5f613c46f78125b3c5948486f744ee4c157af062 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Wed, 20 Jan 2021 12:40:18 -0700 Subject: [PATCH 09/23] Switch code change check to a script --- .github/workflows/build.yml | 62 +++++++++++++++++++++++++------- .github/workflows/regression.yml | 39 -------------------- 2 files changed, 50 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/regression.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2995b3a2..4dfdbb6c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,9 @@ name: linux_build -# Run CI on -# - each push if no code has changed +# Run CI on push, PR, and weekly. on: push: - paths: - - '**.c' - - '**.cc' - - '**.c\+\+' - - '**.cpp' - - '**.h' - - '**.hh' + pull_request: schedule: - cron: '0 0 * * 0 ' # weekly @@ -22,8 +15,27 @@ env: # Multiple job to tests jobs: + change_detect: + name: "Detect code changes" + runs-on: ubuntu-18.04 + outputs: + source_modified: ${{ steps.changes.outputs.status_code != '0'}} + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: true + - name: Check for source code changes + id: changes + run: | + if ! git diff origin/master HEAD --name-status --exit-code -- . ':!openfpga_flow' ':!docs'; then + echo "::set-output name=status_code::$?" + fi # Test the compilation compatibility linux_build: + needs: change_detect + if: ${{needs.change_detect.outputs.source_modified || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-buildenv-${{ matrix.config.cc}} @@ -141,7 +153,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution - if: ${{ github.ref == 'refs/heads/master'}} + if: ${{ github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest needs: linux_build steps: @@ -175,8 +187,8 @@ jobs: file: ./docker/Dockerfile.test push: true tags: ghcr.io/lnis-uofu/openfpga-regression-tests:latest - regression_tests: - name: Regression tests + artifact_regression_tests: + name: Regression tests on code changes runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-buildenv-test needs: linux_build @@ -215,3 +227,29 @@ jobs: - name: ${{matrix.config.name}} shell: bash run: source .github/workflows/${{matrix.config.script}} + docker_regression_tests: + needs: change_detect + if: ${{ !needs.change_detect.outputs.source_modified }} + name: Regression tests against master artifacts + runs-on: ubuntu-18.04 + container: ghcr.io/lnis-uofu/openfpga-regression-tests:latest + strategy: + fail-fast: false + matrix: + config: + - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" + script: basic_reg_test.sh + - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_verilog_reg_test.sh + - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_bitstream_reg_test.sh + - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_sdc_reg_test.sh + - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" + script: fpga_spice_reg_test.sh + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + - name: ${{matrix.config.name}} + shell: bash + run: source .github/workflows/${{matrix.config.script}} diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml deleted file mode 100644 index 5386463d2..000000000 --- a/.github/workflows/regression.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: regression_tests - -# Run regressions on each push if no code has changed -on: - push: - paths-ignore: - - '**.c' - - '**.cc' - - '**.c\+\+' - - '**.cpp' - - '**.h' - - '**.hh' - -# Multiple job to tests -jobs: - regression_tests: - name: Regression tests - runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-regression-tests:latest - strategy: - fail-fast: false - matrix: - config: - - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" - script: basic_reg_test.sh - - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_verilog_reg_test.sh - - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_bitstream_reg_test.sh - - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_sdc_reg_test.sh - - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_spice_reg_test.sh - steps: - - name: Checkout OpenFPGA repo - uses: actions/checkout@v2 - - name: ${{matrix.config.name}} - shell: bash - run: source .github/workflows/${{matrix.config.script}} From f956f287922fa38f6c4d124dfb5dd0228440367a Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Wed, 20 Jan 2021 14:20:12 -0700 Subject: [PATCH 10/23] Update docker images, remove runtime/test split --- .github/workflows/build.yml | 47 +++++++++++-------- .github/workflows/docker.yml | 13 +++-- ...es_test.sh => install_dependencies_run.sh} | 0 .../workflows/install_dependencies_runtime.sh | 2 - docker/Dockerfile.clang-6.0 | 2 +- docker/Dockerfile.clang-8 | 2 +- docker/{Dockerfile.test => Dockerfile.env} | 2 +- docker/Dockerfile.gcc-5 | 2 +- docker/Dockerfile.gcc-6 | 2 +- docker/Dockerfile.gcc-7 | 2 +- docker/Dockerfile.gcc-8 | 2 +- docker/Dockerfile.gcc-9 | 2 +- ...ockerfile.regression => Dockerfile.master} | 2 +- docker/Dockerfile.run | 8 ---- 14 files changed, 42 insertions(+), 46 deletions(-) rename .github/workflows/{install_dependencies_test.sh => install_dependencies_run.sh} (100%) delete mode 100644 .github/workflows/install_dependencies_runtime.sh rename docker/{Dockerfile.test => Dockerfile.env} (68%) rename docker/{Dockerfile.regression => Dockerfile.master} (85%) delete mode 100644 docker/Dockerfile.run diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dfdbb6c7..5d7410a49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,13 @@ name: linux_build # Run CI on push, PR, and weekly. + on: - push: - pull_request: - schedule: - - cron: '0 0 * * 0 ' # weekly + workflow_dispatch: + # push: + # pull_request: + # schedule: + # - cron: '0 0 * * 0 ' # weekly # Environment variables env: @@ -29,8 +31,10 @@ jobs: - name: Check for source code changes id: changes run: | - if ! git diff origin/master HEAD --name-status --exit-code -- . ':!openfpga_flow' ':!docs'; then + if git diff origin/master HEAD --name-status --exit-code -- . ':!openfpga_flow' ':!docs'; then echo "::set-output name=status_code::$?" + else + echo "::set-output name=status_code::0" fi # Test the compilation compatibility linux_build: @@ -38,7 +42,7 @@ jobs: if: ${{needs.change_detect.outputs.source_modified || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-buildenv-${{ matrix.config.cc}} + container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} # Branch on different OS and settings strategy: fail-fast: false @@ -173,24 +177,17 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.CR_PAT }} - - name: Build and push runtime image + - name: Build and push master image uses: docker/build-push-action@v2 with: context: . - file: ./docker/Dockerfile.run + file: ./docker/Dockerfile.master push: true - tags: ghcr.io/lnis-uofu/openfpga-run:latest - - name: Build and push test image - uses: docker/build-push-action@v2 - with: - context: . - file: ./docker/Dockerfile.test - push: true - tags: ghcr.io/lnis-uofu/openfpga-regression-tests:latest + tags: ghcr.io/lnis-uofu/openfpga-master:latest artifact_regression_tests: name: Regression tests on code changes runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-buildenv-test + container: ghcr.io/lnis-uofu/openfpga-env needs: linux_build strategy: fail-fast: false @@ -229,10 +226,10 @@ jobs: run: source .github/workflows/${{matrix.config.script}} docker_regression_tests: needs: change_detect - if: ${{ !needs.change_detect.outputs.source_modified }} + #if: ${{ !needs.change_detect.outputs.source_modified }} name: Regression tests against master artifacts runs-on: ubuntu-18.04 - container: ghcr.io/lnis-uofu/openfpga-regression-tests:latest + container: ghcr.io/lnis-uofu/openfpga-master:latest strategy: fail-fast: false matrix: @@ -252,4 +249,14 @@ jobs: uses: actions/checkout@v2 - name: ${{matrix.config.name}} shell: bash - run: source .github/workflows/${{matrix.config.script}} + run: + ln -s /opt/openfpga/abc abc/abc + ln -s /opt/openfpga/ace ace2/ace + ln -s /opt/openfpga/openfpga openfpga/openfpga + ln -s /opt/openfpga/vpr vpr/vpr + ln -s /opt/openfpga/yosys yosys/yosys + ln -s /opt/openfpga/yosys-abc yosys/yosys-abc + ln -s /opt/openfpga/yosys-config yosys/yosys-config + ln -s /opt/openfpga/yosys-filterlib yosys/yosys-filterlib + ln -s /opt/openfpga/yosys-smtbmc yosys/yosys-smtbmc + source .github/workflows/${{matrix.config.script}} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b0249117f..82e6c687e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,6 +1,5 @@ name: Build docker CI images -on: - - workflow_dispatch +on: push jobs: base_images: name: Push Docker images @@ -24,14 +23,14 @@ jobs: context: . file: ./docker/Dockerfile.base push: true - tags: ghcr.io/lnis-uofu/openfpga-buildenv-base:latest - - name: Build test image + tags: ghcr.io/lnis-uofu/openfpga-build-base:latest + - name: Build environment image uses: docker/build-push-action@v2 with: context: . - file: ./docker/Dockerfile.test + file: ./docker/Dockerfile.env push: true - tags: ghcr.io/lnis-uofu/openfpga-buildenv-test:latest + tags: ghcr.io/lnis-uofu/openfpga-env:latest compiler_images: name: Build ${{ matrix.compiler }} compiler image needs: base_images @@ -65,4 +64,4 @@ jobs: context: . file: ./docker/Dockerfile.${{ matrix.compiler }} push: true - tags: ghcr.io/lnis-uofu/openfpga-buildenv-${{ matrix.compiler }}:latest + tags: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.compiler }}:latest diff --git a/.github/workflows/install_dependencies_test.sh b/.github/workflows/install_dependencies_run.sh similarity index 100% rename from .github/workflows/install_dependencies_test.sh rename to .github/workflows/install_dependencies_run.sh diff --git a/.github/workflows/install_dependencies_runtime.sh b/.github/workflows/install_dependencies_runtime.sh deleted file mode 100644 index 7aafb31c6..000000000 --- a/.github/workflows/install_dependencies_runtime.sh +++ /dev/null @@ -1,2 +0,0 @@ -apt-get update && apt-get install -y \ - libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 diff --git a/docker/Dockerfile.clang-6.0 b/docker/Dockerfile.clang-6.0 index a1b4d4bbe..6d7c36b3e 100644 --- a/docker/Dockerfile.clang-6.0 +++ b/docker/Dockerfile.clang-6.0 @@ -1,2 +1,2 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get update && apt-get install -y clang-format-7 clang-6.0 diff --git a/docker/Dockerfile.clang-8 b/docker/Dockerfile.clang-8 index 4224c869d..5a4a5f4ef 100644 --- a/docker/Dockerfile.clang-8 +++ b/docker/Dockerfile.clang-8 @@ -1,2 +1,2 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get update && apt-get install -y clang-format-7 clang-8 diff --git a/docker/Dockerfile.test b/docker/Dockerfile.env similarity index 68% rename from docker/Dockerfile.test rename to docker/Dockerfile.env index 39da4722d..4c111c3d4 100644 --- a/docker/Dockerfile.test +++ b/docker/Dockerfile.env @@ -1,6 +1,6 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive -ADD .github/workflows/install_dependencies_test.sh install_dependencies_test.sh +ADD .github/workflows/install_dependencies_run.sh install_dependencies_run.sh RUN bash install_dependencies_test.sh ADD requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt diff --git a/docker/Dockerfile.gcc-5 b/docker/Dockerfile.gcc-5 index 78f037b68..f1ee75572 100644 --- a/docker/Dockerfile.gcc-5 +++ b/docker/Dockerfile.gcc-5 @@ -1,2 +1,2 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get update && apt-get install -y gcc-5 g++-5 diff --git a/docker/Dockerfile.gcc-6 b/docker/Dockerfile.gcc-6 index abb8e107b..89ae008f2 100644 --- a/docker/Dockerfile.gcc-6 +++ b/docker/Dockerfile.gcc-6 @@ -1,2 +1,2 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get update && apt-get install -y gcc-6 g++-6 diff --git a/docker/Dockerfile.gcc-7 b/docker/Dockerfile.gcc-7 index 4cf7c4074..d7638677b 100644 --- a/docker/Dockerfile.gcc-7 +++ b/docker/Dockerfile.gcc-7 @@ -1,2 +1,2 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get update && apt-get install -y gcc-7 g++-7 diff --git a/docker/Dockerfile.gcc-8 b/docker/Dockerfile.gcc-8 index 33a5e911a..187a47623 100644 --- a/docker/Dockerfile.gcc-8 +++ b/docker/Dockerfile.gcc-8 @@ -1,2 +1,2 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get update && apt-get install -y gcc-8 g++-8 diff --git a/docker/Dockerfile.gcc-9 b/docker/Dockerfile.gcc-9 index 224277a9a..b6df13651 100644 --- a/docker/Dockerfile.gcc-9 +++ b/docker/Dockerfile.gcc-9 @@ -1,4 +1,4 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-base +FROM ghcr.io/lnis-uofu/openfpga-build-base RUN apt-get install -y software-properties-common RUN add-apt-repository ppa:ubuntu-toolchain-r/test RUN apt-get update && apt-get install -y gcc-9 g++-9 diff --git a/docker/Dockerfile.regression b/docker/Dockerfile.master similarity index 85% rename from docker/Dockerfile.regression rename to docker/Dockerfile.master index 25ba2cbbd..6bd366132 100644 --- a/docker/Dockerfile.regression +++ b/docker/Dockerfile.master @@ -1,4 +1,4 @@ -FROM ghcr.io/lnis-uofu/openfpga-buildenv-test:latest +FROM ghcr.io/lnis-uofu/openfpga-env RUN mkdir /opt/openfpga COPY abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/ RUN cd /opt/openfpga && chmod +x abc ace openfpga vpr yosys yosys-abc yosys-config yosys-filterlib yosys-smtbmc diff --git a/docker/Dockerfile.run b/docker/Dockerfile.run deleted file mode 100644 index f73aeec38..000000000 --- a/docker/Dockerfile.run +++ /dev/null @@ -1,8 +0,0 @@ -FROM ubuntu:18.04 -ENV DEBIAN_FRONTEND=noninteractive -COPY .github/workflows/install_dependencies_runtime.sh install_dependencies_runtime.sh -RUN bash install_dependencies_runtime.sh -RUN mkdir /opt/openfpga -COPY abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/ -RUN cd /opt/openfpga && chmod +x abc ace openfpga vpr yosys yosys-abc yosys-config yosys-filterlib yosys-smtbmc -ENV PATH="/opt/openfpga:${PATH}" From 8cca1c63c35abb83654b519fbad6cac1690ff4f2 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Thu, 21 Jan 2021 16:40:09 -0700 Subject: [PATCH 11/23] Fix dockerfile for master build to include yosys/share, and fix conditionals. --- .dockerignore | 1 + .github/workflows/build.yml | 43 ++++++++++--------- .github/workflows/docker.yml | 3 +- .github/workflows/install_dependencies_run.sh | 2 +- docker/Dockerfile.env | 5 ++- docker/Dockerfile.master | 13 ++++-- 6 files changed, 40 insertions(+), 27 deletions(-) diff --git a/.dockerignore b/.dockerignore index 289b353cc..b7ecbb929 100644 --- a/.dockerignore +++ b/.dockerignore @@ -29,3 +29,4 @@ yosys !yosys/yosys-config !yosys/yosys-filterlib !yosys/yosys-smtbmc +!yosys/share diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d7410a49..41c6e10a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,11 +3,10 @@ name: linux_build # Run CI on push, PR, and weekly. on: - workflow_dispatch: - # push: - # pull_request: - # schedule: - # - cron: '0 0 * * 0 ' # weekly + push: + pull_request: + schedule: + - cron: '0 0 * * 0 ' # weekly # Environment variables env: @@ -21,7 +20,8 @@ jobs: name: "Detect code changes" runs-on: ubuntu-18.04 outputs: - source_modified: ${{ steps.changes.outputs.status_code != '0'}} + # this is output as string, see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idoutputs + source_modified: ${{ steps.changes.outputs.status_code == '0' }} steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 @@ -32,14 +32,14 @@ jobs: id: changes run: | if git diff origin/master HEAD --name-status --exit-code -- . ':!openfpga_flow' ':!docs'; then - echo "::set-output name=status_code::$?" - else echo "::set-output name=status_code::0" + else + echo "::set-output name=status_code::$?" fi # Test the compilation compatibility linux_build: needs: change_detect - if: ${{needs.change_detect.outputs.source_modified || github.ref == 'refs/heads/master' }} + if: ${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} @@ -226,7 +226,7 @@ jobs: run: source .github/workflows/${{matrix.config.script}} docker_regression_tests: needs: change_detect - #if: ${{ !needs.change_detect.outputs.source_modified }} + if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-master:latest @@ -247,16 +247,19 @@ jobs: steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 + with: + submodules: true - name: ${{matrix.config.name}} shell: bash - run: - ln -s /opt/openfpga/abc abc/abc - ln -s /opt/openfpga/ace ace2/ace - ln -s /opt/openfpga/openfpga openfpga/openfpga - ln -s /opt/openfpga/vpr vpr/vpr - ln -s /opt/openfpga/yosys yosys/yosys - ln -s /opt/openfpga/yosys-abc yosys/yosys-abc - ln -s /opt/openfpga/yosys-config yosys/yosys-config - ln -s /opt/openfpga/yosys-filterlib yosys/yosys-filterlib - ln -s /opt/openfpga/yosys-smtbmc yosys/yosys-smtbmc + run: | + cp /opt/openfpga/abc/abc abc/abc + cp /opt/openfpga/ace2/ace ace2/ace + cp /opt/openfpga/openfpga openfpga/openfpga + cp /opt/openfpga/vpr/vpr vpr/vpr + cp /opt/openfpga/yosys/yosys yosys/yosys + cp /opt/openfpga/yosys/yosys-abc yosys/yosys-abc + cp /opt/openfpga/yosys/yosys-config yosys/yosys-config + cp /opt/openfpga/yosys/yosys-filterlib yosys/yosys-filterlib + cp /opt/openfpga/yosys/yosys-smtbmc yosys/yosys-smtbmc + cp -r /opt/openfpga/yosys/share yosys/share source .github/workflows/${{matrix.config.script}} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 82e6c687e..bfce9fc79 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,5 +1,6 @@ name: Build docker CI images -on: push +on: + - workflow_dispatch jobs: base_images: name: Push Docker images diff --git a/.github/workflows/install_dependencies_run.sh b/.github/workflows/install_dependencies_run.sh index 9c416b8fd..e6497d429 100644 --- a/.github/workflows/install_dependencies_run.sh +++ b/.github/workflows/install_dependencies_run.sh @@ -1,2 +1,2 @@ -apt-get update && apt-get install -y libdatetime-perl iverilog python3-pip \ +apt-get update && apt-get install -y libdatetime-perl iverilog python3-pip git \ libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 diff --git a/docker/Dockerfile.env b/docker/Dockerfile.env index 4c111c3d4..d41ee6aeb 100644 --- a/docker/Dockerfile.env +++ b/docker/Dockerfile.env @@ -1,6 +1,9 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install software-properties-common -y +# 18.04 includes 2.17 but github requires 2.18+ to support submodules. +RUN add-apt-repository ppa:git-core/ppa ADD .github/workflows/install_dependencies_run.sh install_dependencies_run.sh -RUN bash install_dependencies_test.sh +RUN bash install_dependencies_run.sh ADD requirements.txt requirements.txt RUN python3 -m pip install -r requirements.txt diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index 6bd366132..f2ad5c874 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -1,5 +1,10 @@ FROM ghcr.io/lnis-uofu/openfpga-env -RUN mkdir /opt/openfpga -COPY abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/ -RUN cd /opt/openfpga && chmod +x abc ace openfpga vpr yosys yosys-abc yosys-config yosys-filterlib yosys-smtbmc -ENV PATH="/opt/openfpga:${PATH}" +RUN mkdir /opt/openfpga /opt/openfpga/abc /opt/openfpga/ace2 /opt/openfpga/vpr /opt/openfpga/yosys +COPY openfpga/openfpga /opt/openfpga/openfpga +COPY abc/abc /opt/openfpga/abc/ +COPY ace2/ace /opt/openfpga/ace2/ +COPY vpr/vpr /opt/openfpga/vpr/ +COPY yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/yosys/ +COPY yosys/share /opt/openfpga/yosys/share +RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc +ENV PATH="/opt/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" From a6b97db31493b497db6fbfa396f2bfde33079dd6 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 10:16:44 -0700 Subject: [PATCH 12/23] Trigger master image build. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41c6e10a6..7528b109d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: # Test the compilation compatibility linux_build: needs: change_detect - if: ${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} + if: true #${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} @@ -157,7 +157,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution - if: ${{ github.ref == 'refs/heads/master' }} + if: true #${{ github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest needs: linux_build steps: @@ -226,7 +226,7 @@ jobs: run: source .github/workflows/${{matrix.config.script}} docker_regression_tests: needs: change_detect - if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} + if: false # ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-master:latest From 22144924fcf72135f62d405f2df86285610dd8b3 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 10:52:21 -0700 Subject: [PATCH 13/23] Restore conditionals. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7528b109d..41c6e10a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: # Test the compilation compatibility linux_build: needs: change_detect - if: true #${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} + if: ${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} @@ -157,7 +157,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution - if: true #${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest needs: linux_build steps: @@ -226,7 +226,7 @@ jobs: run: source .github/workflows/${{matrix.config.script}} docker_regression_tests: needs: change_detect - if: false # ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} + if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-master:latest From a45b9cb801023b082421126ab0a18b369b6e8397 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 15:30:01 -0700 Subject: [PATCH 14/23] Add OPENFPGA_PATH env variable to master dockerfile. --- docker/Dockerfile.master | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index f2ad5c874..807a9dd79 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -8,3 +8,5 @@ COPY yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/ COPY yosys/share /opt/openfpga/yosys/share RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc ENV PATH="/opt/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" +ENV OPENFPGA_PATH="/opt/openfpga:${PATH}" +WORKDIR /opt/openfpga \ No newline at end of file From bd57662a9e5d43847d0c8a22f1431a622b208698 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 15:37:45 -0700 Subject: [PATCH 15/23] Copy openfpga_flow into master image. --- .dockerignore | 1 + docker/Dockerfile.master | 1 + 2 files changed, 2 insertions(+) diff --git a/.dockerignore b/.dockerignore index b7ecbb929..9e7f0d3bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -30,3 +30,4 @@ yosys !yosys/yosys-filterlib !yosys/yosys-smtbmc !yosys/share +!openfpga_flow diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index 807a9dd79..90518c1eb 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -7,6 +7,7 @@ COPY vpr/vpr /opt/openfpga/vpr/ COPY yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/yosys/ COPY yosys/share /opt/openfpga/yosys/share RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc +COPY openfpga_flow /opt/openfpga/openfpga_flow ENV PATH="/opt/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" ENV OPENFPGA_PATH="/opt/openfpga:${PATH}" WORKDIR /opt/openfpga \ No newline at end of file From 40276ceaa4736438d71a6ec4609d5fc5f21b82c9 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 16:27:55 -0700 Subject: [PATCH 16/23] Move openfpga binary to matching location. --- .dockerignore | 3 --- .github/workflows/build.yml | 2 +- docker/Dockerfile.master | 8 ++++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9e7f0d3bb..becc94088 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,8 +12,6 @@ libs LICENSE Makefile openfpga -openfpga_flow -openfpga.sh README.md run_local.bat run_local.sh @@ -30,4 +28,3 @@ yosys !yosys/yosys-filterlib !yosys/yosys-smtbmc !yosys/share -!openfpga_flow diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41c6e10a6..e232c32ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -254,7 +254,7 @@ jobs: run: | cp /opt/openfpga/abc/abc abc/abc cp /opt/openfpga/ace2/ace ace2/ace - cp /opt/openfpga/openfpga openfpga/openfpga + cp /opt/openfpga/openfpga/openfpga openfpga/openfpga cp /opt/openfpga/vpr/vpr vpr/vpr cp /opt/openfpga/yosys/yosys yosys/yosys cp /opt/openfpga/yosys/yosys-abc yosys/yosys-abc diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index 90518c1eb..3ac9c07a1 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -1,6 +1,6 @@ FROM ghcr.io/lnis-uofu/openfpga-env -RUN mkdir /opt/openfpga /opt/openfpga/abc /opt/openfpga/ace2 /opt/openfpga/vpr /opt/openfpga/yosys -COPY openfpga/openfpga /opt/openfpga/openfpga +RUN mkdir /opt/openfpga /opt/openfpga/openfpga /opt/openfpga/abc /opt/openfpga/ace2 /opt/openfpga/vpr /opt/openfpga/yosys +COPY openfpga/openfpga /opt/openfpga/openfpga/openfpga COPY abc/abc /opt/openfpga/abc/ COPY ace2/ace /opt/openfpga/ace2/ COPY vpr/vpr /opt/openfpga/vpr/ @@ -8,6 +8,6 @@ COPY yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/ COPY yosys/share /opt/openfpga/yosys/share RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc COPY openfpga_flow /opt/openfpga/openfpga_flow -ENV PATH="/opt/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" +ENV PATH="/opt/openfpga/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" ENV OPENFPGA_PATH="/opt/openfpga:${PATH}" -WORKDIR /opt/openfpga \ No newline at end of file +WORKDIR /opt/openfpga From 25f8ea6e73306f530fe819278f1b45638c9a1c82 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 16:36:19 -0700 Subject: [PATCH 17/23] Fix chmod and env variables for test. --- .github/workflows/build.yml | 2 ++ docker/Dockerfile.master | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e232c32ae..e06bc5fae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -225,6 +225,8 @@ jobs: shell: bash run: source .github/workflows/${{matrix.config.script}} docker_regression_tests: + env: + OPENFPGA_PATH: /__w/OpenFPGA/OpenFPGA needs: change_detect if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index 3ac9c07a1..dfaf0e011 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -6,7 +6,7 @@ COPY ace2/ace /opt/openfpga/ace2/ COPY vpr/vpr /opt/openfpga/vpr/ COPY yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc /opt/openfpga/yosys/ COPY yosys/share /opt/openfpga/yosys/share -RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc +RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc COPY openfpga_flow /opt/openfpga/openfpga_flow ENV PATH="/opt/openfpga/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" ENV OPENFPGA_PATH="/opt/openfpga:${PATH}" From 2e947efc646d737d5ecf9d9a3bcc051d40dd2f18 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Fri, 22 Jan 2021 19:50:23 -0700 Subject: [PATCH 18/23] Add openfpga.sh and force a master build. --- .github/workflows/build.yml | 7 ++++--- docker/Dockerfile.master | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e06bc5fae..f59b4554f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ env: # Multiple job to tests jobs: change_detect: + if: false name: "Detect code changes" runs-on: ubuntu-18.04 outputs: @@ -39,7 +40,7 @@ jobs: # Test the compilation compatibility linux_build: needs: change_detect - if: ${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} + if: true #${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} @@ -157,7 +158,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution - if: ${{ github.ref == 'refs/heads/master' }} + if: true #${{ github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest needs: linux_build steps: @@ -228,7 +229,7 @@ jobs: env: OPENFPGA_PATH: /__w/OpenFPGA/OpenFPGA needs: change_detect - if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} + if: false #${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-master:latest diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index dfaf0e011..9ae9890cf 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -8,6 +8,7 @@ COPY yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/ COPY yosys/share /opt/openfpga/yosys/share RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga/openfpga vpr/vpr yosys/yosys yosys/yosys-abc yosys/yosys-config yosys/yosys-filterlib yosys/yosys-smtbmc COPY openfpga_flow /opt/openfpga/openfpga_flow +COPY openfpga.sh /opt/openfpga/openfpga.sh ENV PATH="/opt/openfpga/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" ENV OPENFPGA_PATH="/opt/openfpga:${PATH}" WORKDIR /opt/openfpga From cdb799c59f500543bb923cedc48b6848e5579e5f Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Mon, 25 Jan 2021 10:12:49 -0700 Subject: [PATCH 19/23] Reenable branch checks. --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f59b4554f..e06bc5fae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,6 @@ env: # Multiple job to tests jobs: change_detect: - if: false name: "Detect code changes" runs-on: ubuntu-18.04 outputs: @@ -40,7 +39,7 @@ jobs: # Test the compilation compatibility linux_build: needs: change_detect - if: true #${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} + if: ${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-build-${{ matrix.config.cc}} @@ -158,7 +157,7 @@ jobs: yosys/yosys-smtbmc docker_distribution: name: Build docker image for distribution - if: true #${{ github.ref == 'refs/heads/master' }} + if: ${{ github.ref == 'refs/heads/master' }} runs-on: ubuntu-latest needs: linux_build steps: @@ -229,7 +228,7 @@ jobs: env: OPENFPGA_PATH: /__w/OpenFPGA/OpenFPGA needs: change_detect - if: false #${{ !fromJSON(needs.change_detect.outputs.source_modified) }} + if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts runs-on: ubuntu-18.04 container: ghcr.io/lnis-uofu/openfpga-master:latest From a85a1cfb6d77c3884e934747ea8e77c3a6561768 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Mon, 25 Jan 2021 10:28:47 -0700 Subject: [PATCH 20/23] Merge changes from ganesh. --- .github/workflows/build.yml | 68 +++++++++---------- .github/workflows/install_dependencies_run.sh | 4 +- docker/Dockerfile.env | 4 +- docker/Dockerfile.master | 2 +- 4 files changed, 37 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e06bc5fae..cda44639c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,16 +193,11 @@ jobs: fail-fast: false matrix: config: - - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" - script: basic_reg_test.sh - - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_verilog_reg_test.sh - - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_bitstream_reg_test.sh - - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_sdc_reg_test.sh - - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_spice_reg_test.sh + - name: basic_reg_test + - name: fpga_verilog_reg_test + - name: fpga_bitstream_reg_test + - name: fpga_sdc_reg_test + - name: fpga_spice_reg_test steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 @@ -221,12 +216,18 @@ jobs: chmod +x yosys/yosys-config chmod +x yosys/yosys-filterlib chmod +x yosys/yosys-smtbmc - - name: ${{matrix.config.name}} + - name: ${{matrix.config.name}}_GCC-8_(Ubuntu 18.04) shell: bash - run: source .github/workflows/${{matrix.config.script}} + run: source openfpga.sh && source .github/workflows/${{matrix.config.name}}.sh + - name: Upload artifact + uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: failed_${{matrix.config.name}}_regression_log + retention-days: 1 + path: | + openfpga_flow/**/*.log docker_regression_tests: - env: - OPENFPGA_PATH: /__w/OpenFPGA/OpenFPGA needs: change_detect if: ${{ !fromJSON(needs.change_detect.outputs.source_modified) }} name: Regression tests against master artifacts @@ -236,32 +237,27 @@ jobs: fail-fast: false matrix: config: - - name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)" - script: basic_reg_test.sh - - name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_verilog_reg_test.sh - - name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_bitstream_reg_test.sh - - name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_sdc_reg_test.sh - - name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)" - script: fpga_spice_reg_test.sh + - name: basic_reg_test + - name: fpga_verilog_reg_test + - name: fpga_bitstream_reg_test + - name: fpga_sdc_reg_test + - name: fpga_spice_reg_test steps: - name: Checkout OpenFPGA repo uses: actions/checkout@v2 with: submodules: true - - name: ${{matrix.config.name}} + - name: ${{matrix.config.name}}_GCC-8_(Ubuntu 18.04) shell: bash run: | - cp /opt/openfpga/abc/abc abc/abc - cp /opt/openfpga/ace2/ace ace2/ace - cp /opt/openfpga/openfpga/openfpga openfpga/openfpga - cp /opt/openfpga/vpr/vpr vpr/vpr - cp /opt/openfpga/yosys/yosys yosys/yosys - cp /opt/openfpga/yosys/yosys-abc yosys/yosys-abc - cp /opt/openfpga/yosys/yosys-config yosys/yosys-config - cp /opt/openfpga/yosys/yosys-filterlib yosys/yosys-filterlib - cp /opt/openfpga/yosys/yosys-smtbmc yosys/yosys-smtbmc - cp -r /opt/openfpga/yosys/share yosys/share - source .github/workflows/${{matrix.config.script}} + bash .github/workflows/install_dependencies_run.sh + python3 -m pip install -r requirements.txt + rsync -am --exclude='openfpga_flow/**' /opt/openfpga/. . + source openfpga.sh && source .github/workflows/${{matrix.config.name}}.sh + - name: Upload artifact + uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: failed_${{matrix.config.name}}_regression_log + retention-days: 1 + path: openfpga_flow/**/*.log diff --git a/.github/workflows/install_dependencies_run.sh b/.github/workflows/install_dependencies_run.sh index e6497d429..2654f648c 100644 --- a/.github/workflows/install_dependencies_run.sh +++ b/.github/workflows/install_dependencies_run.sh @@ -1,2 +1,2 @@ -apt-get update && apt-get install -y libdatetime-perl iverilog python3-pip git \ - libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 +apt-get update && apt-get install --no-install-recommends -y libdatetime-perl iverilog python3-pip git \ + libc6 libffi6 libgcc1 libreadline7 libstdc++6 libtcl8.6 python3 zlib1g libbz2-1.0 rsync diff --git a/docker/Dockerfile.env b/docker/Dockerfile.env index d41ee6aeb..b0221231f 100644 --- a/docker/Dockerfile.env +++ b/docker/Dockerfile.env @@ -1,9 +1,9 @@ FROM ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install software-properties-common -y +RUN apt-get update && apt-get install --no-install-recommends software-properties-common -y # 18.04 includes 2.17 but github requires 2.18+ to support submodules. RUN add-apt-repository ppa:git-core/ppa ADD .github/workflows/install_dependencies_run.sh install_dependencies_run.sh RUN bash install_dependencies_run.sh ADD requirements.txt requirements.txt -RUN python3 -m pip install -r requirements.txt +RUN python3 -m pip install -r requirements.txt \ No newline at end of file diff --git a/docker/Dockerfile.master b/docker/Dockerfile.master index 9ae9890cf..866f8b51b 100644 --- a/docker/Dockerfile.master +++ b/docker/Dockerfile.master @@ -10,5 +10,5 @@ RUN cd /opt/openfpga && chmod +x abc/abc ace2/ace openfpga/openfpga vpr/vpr yosy COPY openfpga_flow /opt/openfpga/openfpga_flow COPY openfpga.sh /opt/openfpga/openfpga.sh ENV PATH="/opt/openfpga/openfpga:/opt/openfpga/yosys:/opt/openfpga/ace2:/opt/openfpga/abc:/opt/openfpga/vpr:${PATH}" -ENV OPENFPGA_PATH="/opt/openfpga:${PATH}" +ENV OPENFPGA_PATH="/opt/openfpga" WORKDIR /opt/openfpga From f26da9ad3432ec1358e710be10222dc04f591e00 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Mon, 25 Jan 2021 11:32:34 -0700 Subject: [PATCH 21/23] Add current master build file. --- .github/workflows/build_old.yml | 203 ++++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 .github/workflows/build_old.yml diff --git a/.github/workflows/build_old.yml b/.github/workflows/build_old.yml new file mode 100644 index 000000000..d9d057562 --- /dev/null +++ b/.github/workflows/build_old.yml @@ -0,0 +1,203 @@ +name: linux_build + +# Run CI on +# - each push +# - each pull request +# - scheduled weekly +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 0 ' # weekly + +# Environment variables +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + MAKEFLAGS: "-j8" + +# Multiple job to tests +jobs: + # Test the compilation compatibility + linux_build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + + # Branch on different OS and settings + strategy: + fail-fast: false + matrix: + config: + - { + name: "Build Compatibility: GCC-5 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-gcc5-build.7z", + os: ubuntu-18.04, + cc: "gcc-5", cxx: "g++-5" + } + + - { + name: "Build Compatibility: GCC-6 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-gcc6-build.7z", + os: ubuntu-18.04, + cc: "gcc-6", cxx: "g++-6" + } + + - { + name: "Build Compatibility: GCC-7 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-gcc7-build.7z", + os: ubuntu-18.04, + cc: "gcc-7", cxx: "g++-7" + } + + - { + name: "Build Compatibility: GCC-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-gcc8-build.7z", + os: ubuntu-18.04, + cc: "gcc-8", cxx: "g++-8" + } + + - { + name: "Build Compatibility: GCC-9 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-gcc9-build.7z", + os: ubuntu-18.04, + cc: "gcc-9", cxx: "g++-9" + } + + - { + name: "Build Compatibility: Clang-6 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-clang6-build.7z", + os: ubuntu-18.04, + cc: "clang-6.0", cxx: "clang++-6.0" + } + + - { + name: "Build Compatibility: Clang-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-ubuntu-18.04-clang8-build.7z", + os: ubuntu-18.04, + cc: "clang-8", cxx: "clang++-8" + } + + - { + name: "Basic Regression Tests: GCC-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-basic-tests-ubuntu-18.04-gcc8-build.7z", + os: ubuntu-18.04, + cc: "gcc-8", cxx: "g++-8", + reg_script: "basic_reg_test.sh" + } + + - { + name: "FPGA-Verilog Regression Tests: GCC-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-fpga-verilog-tests-ubuntu-18.04-gcc8-build.7z", + os: ubuntu-18.04, + cc: "gcc-8", cxx: "g++-8", + reg_script: "fpga_verilog_reg_test.sh" + } + + - { + name: "FPGA-Bitstream Regression Tests: GCC-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-fpga-bitstream-tests-ubuntu-18.04-gcc8-build.7z", + os: ubuntu-18.04, + cc: "gcc-8", cxx: "g++-8", + reg_script: "fpga_bitstream_reg_test.sh" + } + + - { + name: "FPGA-SDC Regression Tests: GCC-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-fpga-sdc-tests-ubuntu-18.04-gcc8-build.7z", + os: ubuntu-18.04, + cc: "gcc-8", cxx: "g++-8", + reg_script: "fpga_sdc_reg_test.sh" + } + + - { + name: "FPGA-SPICE Regression Tests: GCC-8 (Ubuntu 18.04)", + artifact: "OpenFPGA-fpga-spice-tests-ubuntu-18.04-gcc8-build.7z", + os: ubuntu-18.04, + cc: "gcc-8", cxx: "g++-8", + reg_script: "fpga_spice_reg_test.sh" + } + + + # Define the steps to run the build job + steps: + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + with: + submodules: true + + - name: Install dependency + run: source ./.github/workflows/install_dependency.sh + + - name: Checkout CMake version + run: cmake --version + + - name: Checkout iVerilog version + run: | + iverilog -V + vvp -V + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: Create CMake build environment + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all subsequent commands + run: cmake -E make_directory ${{runner.workspace}}/build + + - name: ccache cache files + uses: actions/cache@v2 + with: + path: ${{runner.workspace}}/.ccache + key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + restore-keys: | + ${{ matrix.config.name }}-ccache- + + # Set up the paths for ccache and control the size under 400MB + - name: Configure ccache + shell: cmake -P {0} + run: | + file(TO_CMAKE_PATH ${{runner.workspace}} ccache_basedir) + set(ENV{CCACHE_BASEDIR} "${ccache_basedir}") + set(ENV{CCACHE_DIR} "${ccache_basedir}/.ccache") + set(ENV{CCACHE_COMPRESS} "true") + set(ENV{CCACHE_COMPRESSLEVEL} "6") + set(ENV{CCACHE_MAXSIZE} "400M") + + execute_process(COMMAND ccache -p) + execute_process(COMMAND ccache -z) + + - name: Configure CMake + # Use a bash shell so we can use the same syntax for environment variable + # access regardless of the host operating system + shell: bash + working-directory: ${{runner.workspace}}/build + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. + # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 + run: | + export CC=${{ matrix.config.cc }} + export CXX=${{ matrix.config.cxx }} + cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + + - name: Build + working-directory: ${{runner.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: | + cmake --build . --config $BUILD_TYPE + + # Check the cache size and see if it is over the limit + - name: Check ccache size + shell: cmake -P {0} + run: | + execute_process(COMMAND ccache -s) + + - name: ${{matrix.config.name}} + if: contains(matrix.config.name, 'Regression Test') + shell: bash + # Execute the test. + run: source ./.github/workflows/${{matrix.config.reg_script}} From 9894693932f5d78644e91624021888b59499c6e4 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Mon, 25 Jan 2021 11:46:59 -0700 Subject: [PATCH 22/23] Fix dependency script reference in old build --- .github/workflows/build_old.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_old.yml b/.github/workflows/build_old.yml index d9d057562..1241f2736 100644 --- a/.github/workflows/build_old.yml +++ b/.github/workflows/build_old.yml @@ -126,15 +126,15 @@ jobs: submodules: true - name: Install dependency - run: source ./.github/workflows/install_dependency.sh + run: source ./.github/workflows/install_dependency_old.sh - name: Checkout CMake version - run: cmake --version + run: cmake --version - name: Checkout iVerilog version run: | - iverilog -V - vvp -V + iverilog -V + vvp -V - name: Prepare ccache timestamp id: ccache_cache_timestamp @@ -147,7 +147,7 @@ jobs: # Some projects don't allow in-source building, so create a separate build directory # We'll use this as our working directory for all subsequent commands run: cmake -E make_directory ${{runner.workspace}}/build - + - name: ccache cache files uses: actions/cache@v2 with: @@ -175,8 +175,8 @@ jobs: # access regardless of the host operating system shell: bash working-directory: ${{runner.workspace}}/build - # Note the current convention is to use the -S and -B options here to specify source - # and build directories, but this is only available with CMake 3.13 and higher. + # Note the current convention is to use the -S and -B options here to specify source + # and build directories, but this is only available with CMake 3.13 and higher. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12 run: | export CC=${{ matrix.config.cc }} @@ -188,7 +188,7 @@ jobs: shell: bash # Execute the build. You can specify a specific target with "--target " run: | - cmake --build . --config $BUILD_TYPE + cmake --build . --config $BUILD_TYPE # Check the cache size and see if it is over the limit - name: Check ccache size @@ -199,5 +199,5 @@ jobs: - name: ${{matrix.config.name}} if: contains(matrix.config.name, 'Regression Test') shell: bash - # Execute the test. + # Execute the test. run: source ./.github/workflows/${{matrix.config.reg_script}} From 50e4aac65036928edf5919329ad1384df4ab7714 Mon Sep 17 00:00:00 2001 From: Ashton Snelgrove Date: Mon, 25 Jan 2021 11:58:35 -0700 Subject: [PATCH 23/23] Fix dependency script reference in old build --- .github/workflows/install_dependency_old.sh | 53 +++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/install_dependency_old.sh diff --git a/.github/workflows/install_dependency_old.sh b/.github/workflows/install_dependency_old.sh new file mode 100644 index 000000000..b20184fea --- /dev/null +++ b/.github/workflows/install_dependency_old.sh @@ -0,0 +1,53 @@ +# Install all the dependency for OpenFPGA in Ubuntu-18.04 +sudo apt-get update +sudo apt-get install autoconf +sudo apt-get install automake +sudo apt-get install bash +sudo apt-get install bison +sudo apt-get install build-essential +sudo apt-get install cmake +sudo apt-get install ccache +sudo apt-get install ctags +sudo apt-get install curl +sudo apt-get install doxygen +sudo apt-get install flex +sudo apt-get install fontconfig +sudo apt-get install gdb +sudo apt-get install git +sudo apt-get install gperf +sudo apt-get install iverilog +sudo apt-get install libcairo2-dev +sudo apt-get install libevent-dev +sudo apt-get install libfontconfig1-dev +sudo apt-get install liblist-moreutils-perl +sudo apt-get install libncurses5-dev +sudo apt-get install libx11-dev +sudo apt-get install libxft-dev +sudo apt-get install libxml++2.6-dev +sudo apt-get install perl +sudo apt-get install python +sudo apt-get install python3-setuptools +sudo apt-get install python-lxml +sudo apt-get install tcllib +sudo apt-get install tcl8.6-dev +sudo apt-get install texinfo +sudo apt-get install time +sudo apt-get install valgrind +sudo apt-get install zip +sudo apt-get install qt5-default +sudo apt-get install clang-format-7 +# Add all the supported compilers +sudo apt-get install g++-5 +sudo apt-get install gcc-5 +sudo apt-get install g++-6 +sudo apt-get install gcc-6 +sudo apt-get install g++-7 +sudo apt-get install gcc-7 +sudo apt-get install g++-8 +sudo apt-get install gcc-8 +sudo apt-get install g++-9 +sudo apt-get install gcc-9 +sudo apt-get install clang-6.0 +sudo apt-get install clang-8 +# Python dependencies +python3 -m pip install -r /home/runner/work/OpenFPGA/OpenFPGA/requirements.txt