diff --git a/.github/filters.yml b/.github/filters.yml new file mode 100644 index 00000000..ee0eaa37 --- /dev/null +++ b/.github/filters.yml @@ -0,0 +1,20 @@ +cobble: + - 'tools/site_cobble/**/*' + - 'vnd/**/*' + - 'hdl/ip/bsv/**/*' + - 'hdl/projects/ecp5_evn/**/*' + - 'hdl/projects/gimlet/**/*' + - 'hdl/projects/icestick/**/*' + - 'hdl/projects/ignitionlet/**/*' + - 'hdl/projects/psc/**/*' + - 'hdl/projects/sidecar/**/*' + - 'hdl/projects/ulx3s/**/*' + +buck2: + - 'vnd/xpm/**/*' + - 'prelude/**/*' + - 'toolchains/**/*' + - 'hdl/ip/toolchains/**/*' + - 'tools/**/*' + - 'hdl/ip/vhd/**/*' + - 'hdl/projects/grapefruit/**/*' \ No newline at end of file diff --git a/.github/workflows/simulation.yml b/.github/workflows/simulation.yml new file mode 100644 index 00000000..421341bf --- /dev/null +++ b/.github/workflows/simulation.yml @@ -0,0 +1,61 @@ +name: simulation +run-name: ${{ github.actor }} running HDL simulations +on: + [push] +jobs: + changes: + runs-on: self-hosted + permissions: + pull-requests: read + outputs: + cobble: ${{ steps.changed_files.outputs.cobble }} + buck2: ${{ steps.changed_files.outputs.buck2 }} + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: .github/filters.yml + + vunit-sim: + needs: changes + if: ${{ needs.changes.outputs.buck2 == 'true' }} + runs-on: self-hosted + steps: + - run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Update pip reqs + run : python3 -m pip install --upgrade -r tools/requirements.txt --break-system-packages + - name: Run VUnit tests + run: buck2 bxl //tools/vunit-sims.bxl:vunit_sim_gen | while IFS= read -r line; do eval "$line" ; done + + bsv-sim: + # needs: changes + # if: ${{ needs.changes.outputs.cobble == 'true' }} + runs-on: self-hosted + steps: + - run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: 'true' + fetch-depth: 0 + - name: Update pip reqs + run : python3 -m pip install --upgrade -r tools/requirements.txt --break-system-packages + - name: Env setup + run: cp BUILD.vars.gha BUILD.vars && echo "/opt/bsc-2022.01/bin" >> "$GITHUB_PATH" + - name: Restore build-dir + run: if [ -d /tmp/cobble_build_bkup ]; then cp -R /tmp/cobble_build_bkup ./build; else mkdir ./build; fi + - name: cobble init + run: ../vnd/cobble/cobble init .. --reinit + working-directory: ./build + - name: Run BSIM tests + run: ./cobble bluesim_test "//.*SchmittRegTest.*" + working-directory: ./build + - name: backup build-dir + run: cp -R ./build /tmp/cobble_build_bkup \ No newline at end of file diff --git a/.github/workflows/vunit.yml b/.github/workflows/vunit.yml deleted file mode 100644 index 8164c37c..00000000 --- a/.github/workflows/vunit.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: vunit -run-name: ${{ github.actor }} is testing out GitHub Actions -on: - [push] -jobs: - Run-sim: - runs-on: self-hosted - steps: - - run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - with: - submodules: 'true' - - name: Update pip reqs - run : python3 -m pip install --upgrade -r tools/requirements.txt --break-system-packages - - name: Run VUnit tests - run: buck2 bxl //tools/vunit-sims.bxl:vunit_sim_gen | while IFS= read -r line; do eval "$line" ; done - \ No newline at end of file diff --git a/BUILD.vars.gha b/BUILD.vars.gha new file mode 100644 index 00000000..d9e6ab6b --- /dev/null +++ b/BUILD.vars.gha @@ -0,0 +1,14 @@ +[bluespec] +prefix = "/opt/bsc-2022.01" +bin = "/opt/bsc-2022.01/bin/bsc" +libdir = "/opt/bsc-2022.01/lib/" + +[yosys] +bin = "/opt/oss-cad-suite-20240513/bin/yosys" +libdir = "/opt/oss-cad-suite-20240513/share/yosys" + +[nextpnr] +ecp5 = "/opt/oss-cad-suite-20240513/bin/nextpnr-ecp5" +ecp5_pack = "/opt/oss-cad-suite-20240513/bin/ecppack" +ice40 = "/opt/oss-cad-suite-20240513/bin/nextpnr-ice40" +ice40_pack = "/opt/oss-cad-suite-20240513/bin/icepack"