diff --git a/.dockerignore b/.dockerignore index 2e0e43deb..becc94088 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,30 @@ -# Ignore everything -* \ No newline at end of file +abc +ace2 +build +cmake +CMakeLists.txt +deploy_key.enc +docker +Dockerfile +docs +libopenfpga +libs +LICENSE +Makefile +openfpga +README.md +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 +!yosys/share diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9d057562..cda44639c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,7 @@ name: linux_build -# Run CI on -# - each push -# - each pull request -# - scheduled weekly +# Run CI on push, PR, and weekly. + on: push: pull_request: @@ -18,123 +16,79 @@ env: # Multiple job to tests jobs: + change_detect: + name: "Detect code changes" + runs-on: ubuntu-18.04 + outputs: + # 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 + 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::0" + else + echo "::set-output name=status_code::$?" + fi # Test the compilation compatibility linux_build: + needs: change_detect + if: ${{ fromJSON(needs.change_detect.outputs.source_modified) || github.ref == 'refs/heads/master' }} name: ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} - + runs-on: ubuntu-18.04 + container: ghcr.io/lnis-uofu/openfpga-build-${{ 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 with: submodules: true - - 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 @@ -146,58 +100,164 @@ 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: 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 + docker_distribution: + name: Build docker image for distribution + if: ${{ github.ref == 'refs/heads/master' }} + 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 master image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.master + push: true + 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-env + needs: linux_build + strategy: + fail-fast: false + matrix: + config: + - 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 + - name: Download a built artifacts + uses: actions/download-artifact@v2 + with: + name: openfpga + - name: chmod run: | - execute_process(COMMAND ccache -s) - - - name: ${{matrix.config.name}} - if: contains(matrix.config.name, 'Regression Test') + 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: ${{matrix.config.name}}_GCC-8_(Ubuntu 18.04) shell: bash - # Execute the test. - run: source ./.github/workflows/${{matrix.config.reg_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: + needs: change_detect + 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 + strategy: + fail-fast: false + matrix: + config: + - 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}}_GCC-8_(Ubuntu 18.04) + shell: bash + run: | + 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/build_old.yml b/.github/workflows/build_old.yml new file mode 100644 index 000000000..1241f2736 --- /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_old.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}} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..bfce9fc79 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,68 @@ +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 + push: true + tags: ghcr.io/lnis-uofu/openfpga-build-base:latest + - name: Build environment image + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile.env + push: true + tags: ghcr.io/lnis-uofu/openfpga-env: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.0 + - 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 }} + push: true + tags: ghcr.io/lnis-uofu/openfpga-build-${{ 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..3f6ef089e --- /dev/null +++ b/.github/workflows/install_dependencies_build.sh @@ -0,0 +1,40 @@ +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 \ + tcllib \ + tcl8.6-dev \ + texinfo \ + time \ + valgrind \ + zip diff --git a/.github/workflows/install_dependencies_run.sh b/.github/workflows/install_dependencies_run.sh new file mode 100644 index 000000000..2654f648c --- /dev/null +++ b/.github/workflows/install_dependencies_run.sh @@ -0,0 +1,2 @@ +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/.github/workflows/install_dependency.sh b/.github/workflows/install_dependency_old.sh similarity index 100% rename from .github/workflows/install_dependency.sh rename to .github/workflows/install_dependency_old.sh 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/.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..c635bd4c0 --- /dev/null +++ b/docker/Dockerfile.base @@ -0,0 +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_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.0 b/docker/Dockerfile.clang-6.0 new file mode 100644 index 000000000..6d7c36b3e --- /dev/null +++ b/docker/Dockerfile.clang-6.0 @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..5a4a5f4ef --- /dev/null +++ b/docker/Dockerfile.clang-8 @@ -0,0 +1,2 @@ +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.env b/docker/Dockerfile.env new file mode 100644 index 000000000..b0221231f --- /dev/null +++ b/docker/Dockerfile.env @@ -0,0 +1,9 @@ +FROM ubuntu:18.04 +ENV DEBIAN_FRONTEND=noninteractive +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 \ No newline at end of file diff --git a/docker/Dockerfile.gcc-5 b/docker/Dockerfile.gcc-5 new file mode 100644 index 000000000..f1ee75572 --- /dev/null +++ b/docker/Dockerfile.gcc-5 @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..89ae008f2 --- /dev/null +++ b/docker/Dockerfile.gcc-6 @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..d7638677b --- /dev/null +++ b/docker/Dockerfile.gcc-7 @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..187a47623 --- /dev/null +++ b/docker/Dockerfile.gcc-8 @@ -0,0 +1,2 @@ +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 new file mode 100644 index 000000000..b6df13651 --- /dev/null +++ b/docker/Dockerfile.gcc-9 @@ -0,0 +1,4 @@ +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.master b/docker/Dockerfile.master new file mode 100644 index 000000000..866f8b51b --- /dev/null +++ b/docker/Dockerfile.master @@ -0,0 +1,14 @@ +FROM ghcr.io/lnis-uofu/openfpga-env +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/ +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/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" +WORKDIR /opt/openfpga