diff --git a/.github/workflows/run-mddbench.yml b/.github/workflows/run-mddbench.yml new file mode 100644 index 00000000000..b1bbde26afe --- /dev/null +++ b/.github/workflows/run-mddbench.yml @@ -0,0 +1,106 @@ +name: Build Yosys and run under mddbench + +on: [push, pull_request] + +jobs: + pre-job: + runs-on: ubuntu-latest + outputs: + should_skip: ${{ steps.skip_check.outputs.should_skip }} + steps: + - id: skip_check + uses: fkirc/skip-duplicate-actions@v5 + with: + paths_ignore: '["**/README.md", "docs/**", "guidelines/**", "tests/**", "examples/**"]' + # cancel previous builds if a new commit is pushed + cancel_others: 'true' + # only run on push *or* pull_request, not both + concurrent_skipping: 'same_content_newer' + + build-yosys: + runs-on: [self-hosted, linux, x64] + needs: [pre-job] + if: needs.pre_job.outputs.should_skip != 'true' + outputs: + yosys-key: ${{ steps.rte.outputs.yosys-key }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: true + + - name: Runtime environment + id: rte + run: | + echo "procs=$(nproc)" >> $GITHUB_ENV + echo "yosys-key=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Cache Yosys + id: cache-yosys + uses: actions/cache@v4 + with: + path: .local/yosys/ + key: linux-${{ steps.rte.outputs.yosys-key }} + + - name: Build Yosys + if: steps.cache-yosys.outputs.cache-hit != 'true' + run: | + make config-clang + echo "ENABLE_VERIFIC := 1" >> Makefile.conf + echo "ENABLE_VERIFIC_EDIF := 1" >> Makefile.conf + echo "ENABLE_VERIFIC_LIBERTY := 1" >> Makefile.conf + echo "ENABLE_VERIFIC_YOSYSHQ_EXTENSIONS := 1" >> Makefile.conf + echo "ENABLE_CCACHE := 1" >> Makefile.conf + make -j${{ env.procs }} ENABLE_LTO=1 + make install DESTDIR=${GITHUB_WORKSPACE}/.local/yosys PREFIX= + + - name: Configure mddbench + run: | + sed -i -e 's|{YOSYS_KEY}|'${{ env.YOSYS_KEY }}'|g' mddbench-config.yaml + + - name: Store mddbench-config + uses: actions/upload-artifact@v4 + with: + name: mddbench-config + path: mddbench-config.yaml + retention-days: 1 + + base: + runs-on: [self-hosted, linux, x64, long] + needs: [build-yosys, pre-job] + if: needs.pre_job.outputs.should_skip != 'true' + env: + YOSYS_KEY: ${{ needs.build-yosys.outputs.yosys-key }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + repository: https://github.com/YosysHQ/mddbench + submodules: recursive + + - name: Runtime environment + run: | + echo "procs=$(nproc)" >> $GITHUB_ENV + + - name: Restore Yosys + uses: actions/cache/restore@v4 + with: + path: .local/yosys/ + key: linux-${{ env.YOSYS_KEY }} + fail-on-cache-miss: true + + - name: Download mddbench-config + uses: actions/download-artifact@v4 + with: + name: mddbench-config + + - name: Setup mddbench + run: | + sed -e 's|{GITHUB_WORKSPACE}|'${GITHUB_WORKSPACE}'|g' < mddbench-config.yaml > config.yaml + pip install -r scripts/requirements.txt + + - name: Run mddbench + run: | + python3 -m scripts.mau_runner -j${{ env.procs }} -Eg --flowgroup=base + cat gh.md >> $GITHUB_STEP_SUMMARY diff --git a/mddbench-config.yaml b/mddbench-config.yaml new file mode 100644 index 00000000000..c7cd8847db0 --- /dev/null +++ b/mddbench-config.yaml @@ -0,0 +1,33 @@ +base: + benchmark_dirs: + - "benchmarks" + benchmarks: + ipcores-crc32: all + flows: + - [ yosys-{YOSYS_KEY}-none ] + +compat: + benchmark_dirs: + - "benchmarks" + - "benchmarks/beyond" + benchmarks: + # semi random assortment of benchmarks + epfl_comb: arith_square, arith_multiplier, arith_hyp, rand_arbiter + ipcores-cic: all + ipcores-crc32: all + ipcores-minerva: commit + ipcores-pwm256: all + r22sdf: basic64, convert64 + vtr_bench-freecores: aes_cipher, mips_16, ethmac + vtr_bench-koios: reduction_layer, robot_rl, softmax, spmv + vtr_bench-ultraembedded: mmc_core, ft60x_axi_core, soc_core + vtr_bench-verilog: diffeq2, stereovision3, mkPktMerge, ch_intrinsics, sha + xorgrid: base + flows: + - [ yosys-{YOSYS_KEY}-none ] + +tools: + all: + TOOL_DIR: {GITHUB_WORKSPACE}/.local/{name}/bin/ + # limit to 20 minutes + TIMEOUT: 1200