Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colo gha #236

Merged
merged 5 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/filters.yml
Original file line number Diff line number Diff line change
@@ -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/**/*'
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: fpga-build
run-name: ${{ github.actor }} Building FPGA bitstreams
on:
[push]
jobs:
changes:
runs-on: self-hosted
permissions:
pull-requests: read
outputs:
cobble: ${{ steps.filter.outputs.cobble }}
buck2: ${{ steps.filter.outputs.buck2 }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/filters.yml

grapefruit:
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: buck path
run: echo "~/.cargo/bin:/opt/Xilinx/Vivado/2024.1/bin" >> "$GITHUB_PATH"
- name: Build grapefruit bitstream
run: buck2 build //hdl/projects/grapefruit:grapefruit --show-output
- uses: actions/upload-artifact@v4
with:
name: gfruit-image
path: "./buck-out/v2/gen/root/**/*"

bsv-streams:
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'
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: Build FPGAs
run: ./cobble build -v "//.*#bitstream"
working-directory: ./build
- name: backup build-dir
run: cp -R ./build /tmp/cobble_build_bkup
- uses: actions/upload-artifact@v4
with:
name: bsv-images
path: "./build/latest/**/*"
63 changes: 63 additions & 0 deletions .github/workflows/simulation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: simulation
run-name: ${{ github.actor }} running HDL simulations
on:
[push]
jobs:
changes:
runs-on: self-hosted
permissions:
pull-requests: read
outputs:
cobble: ${{ steps.filter.outputs.cobble }}
buck2: ${{ steps.filter.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: buck path
run: echo "~/.cargo/bin" >> "$GITHUB_PATH"
- 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 "//.*Test.*"
working-directory: ./build
- name: backup build-dir
run: cp -R ./build /tmp/cobble_build_bkup
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,11 @@ vivado*.log
# Yep, even ignore Vivado core dump logs!
*.log

# VUnit test results
**/*.xml

# DrawIO cruft
**/*.svg.bkp

# cobble local env
BUILD.vars
14 changes: 14 additions & 0 deletions BUILD.vars.gha
Original file line number Diff line number Diff line change
@@ -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"
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ but if you want to see a list of all available buck2 targets you can do: `buck2
To run a simulation, pick one of the testbench targets and `buck2 run <target>` you may do
`-- <vunit args>` if you need to pass arguments into VUnit.

### running all sims or sim regressions
We can use the build system to query for vunit simulation testbenches and have built a .bxl
that does this and gives you the command line options to run each one found:

`buck2 bxl //tools/vunit-sims.bxl:vunit_sim_gen`

If you'd like to run a regression run like the build machine does, you can pipe that into split
and use the shell to execute each line:

`buck2 bxl //tools/vunit-sims.bxl:vunit_sim_gen | while IFS= read -r line; do eval "$line" ; done`


## multitool
multitool is a collection of quality of live utilities built in-tree for regular use, but whose
function is small enough to not warrant a self-contained project.
Expand Down
15 changes: 0 additions & 15 deletions hdl/ip/vhd/ip_tests/BUCK

This file was deleted.

1 change: 1 addition & 0 deletions hdl/ip/vhd/memories/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ vhdl_unit(
srcs = glob(["sims/*.vhd"]),
deps = [
":dual_clock_simple_dpr",
"//hdl/ip/vhd/fifos:dcfifo_xpm",
"//hdl/ip/vhd/vunit_components:sim_gpio"
],
visibility = ['PUBLIC'],
Expand Down
65 changes: 0 additions & 65 deletions hdl/ip/vhd/vunit_components/qspi_controller/sims/qspi_vc_tb.vhd

This file was deleted.

43 changes: 0 additions & 43 deletions hdl/ip/vhd/vunit_components/qspi_controller/sims/qspi_vc_th.vhd

This file was deleted.

25 changes: 0 additions & 25 deletions hdl/projects/gimlet/sequencer/A1Block.bsv
Original file line number Diff line number Diff line change
Expand Up @@ -348,31 +348,6 @@ import PowerRail::*;

endmodule

module mkA1PowerDownA0InteractionTest(Empty);

Bench bench <- mkBench();

mkAutoFSM(seq
dynamicAssert(bench.a1_ok == False, "Expected sequencer in A2");
dynamicAssert(bench.seq_to_sp3_rsmrst_v3p3_l == 0, "Expected RSMRST_L asserted");
bench.power_up();
await(bench.a1_ok);
bench.a0_busy();
dynamicAssert(bench.seq_to_sp3_rsmrst_v3p3_l == 1, "Expected RSMRST_L de-asserted");
bench.power_down(); // Should not actually happen because A0 is busy
delay(200);
dynamicAssert(bench.a1_ok == True, "Expected a1_ok to still be asserted since it can't power down");
dynamicAssert(bench.seq_to_sp3_rsmrst_v3p3_l == 1, "Expected RSMRST_L still de-asserted");
bench.a0_idle();
delay(5);
dynamicAssert(bench.a1_ok == False, "Expected a1_ok to be de-asserted we can now power down");
dynamicAssert(bench.seq_to_sp3_rsmrst_v3p3_l == 0, "Expected RSMRST_L asserted");
dynamicAssert(bench.v3p3_s5.enabled == False, "Expected v3p3_s5_en de-asserted");
delay(200);
endseq);

endmodule

module mkA1MAPOTest(Empty);

Bench bench <- mkBench();
Expand Down
1 change: 0 additions & 1 deletion hdl/projects/gimlet/sequencer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ bluesim_tests('A1Tests',
'mkA1PowerUpTest',
'mkA1PowerDownTest',
'mkA1MAPOTest',
'mkA1PowerDownA0InteractionTest',
],
deps = [
':A1Block'
Expand Down
Loading