Skip to content

Commit 54cb221

Browse files
.github:workflows: Add VHDL build and test workflow
Rename old workflow to fabric_gen_verilog. Add a workflow to build and simulate a VHDL fabric. Signed-off-by: Jonas K. <[email protected]>
1 parent a08bd26 commit 54cb221

File tree

5 files changed

+39
-9
lines changed

5 files changed

+39
-9
lines changed

.github/actions/prepare_FABulous_container/action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ inputs:
1414
description: 'Additional python packages to install'
1515
required: false
1616
default: ''
17-
install_GHDL:
18-
description: 'Install GHDL'
17+
install_GHDL_mcode:
18+
description: 'Install GHDL with mcode backend'
1919
required: false
2020
default: false
2121

@@ -31,7 +31,7 @@ runs:
3131
- name: Install GHDL mcode nightly
3232
# GHDL mcode is required to test our fabric.
3333
# The oss-cad-suite action installs GHDL, but with the LLVM backend, which is much slower for our simulation
34-
if: ${{ inputs.install_GHDL == true }}
34+
if: ${{ inputs.install_GHDL_mcode == true }}
3535
uses: ghdl/setup-ghdl@v1
3636
with:
3737
version: nightly

.github/workflows/fabric_gen.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: Test FABulous
1+
name: Test fabric generation
22

33
on: [push, pull_request]
44

55
jobs:
66
run_verilog_simulation_CLI:
7+
name: Run Verilog fabric generator flow and simulation with FABulous CLI
78
runs-on: ubuntu-latest
89
steps:
910
- uses: actions/checkout@v4
@@ -14,6 +15,7 @@ jobs:
1415
FABulous demo -fs ./demo/FABulous.tcl
1516
1617
run_verilog_simulation_makefile:
18+
name: Run Verilog fabric generator flow and simulation with FABulous makefile
1719
runs-on: ubuntu-latest
1820
steps:
1921
- uses: actions/checkout@v4
@@ -23,3 +25,27 @@ jobs:
2325
FABulous -c demo
2426
cd demo/Test
2527
make FAB_sim
28+
29+
run_vhdl_simulation_makefile:
30+
name: Run VHDL fabric generator flow and simulation with FABulous makefile
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: ./.github/actions/prepare_FABulous_container
35+
# with:
36+
# install_GHDL_mcode: true
37+
# GH composite workflwos do not support conditional steps yet. :(
38+
# https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md
39+
- name: Install GHDL mcode nightly
40+
# GHDL mcode is required to test our fabric.
41+
# The oss-cad-suite action installs GHDL, but with the LLVM backend, which is much slower for our simulation
42+
uses: ghdl/setup-ghdl@v1
43+
with:
44+
version: nightly
45+
backend: mcode
46+
investigate: true
47+
- name: Run fabric generator flow and simulation with FABulous makefile
48+
run: |
49+
FABulous -c demo_vhdl -w vhdl
50+
cd demo_vhdl/Test
51+
make full_sim

FABulous/fabric_files/FABulous_project_template_vhdl/Test/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ FABulous provides a simulation environment to test the fabric and the bitstream
55
For simple use cases, there is the `run_simulation command` in the FABulous shell.
66
For more complex use cases it can be useful to create an own flow, like the following example `make` based flow.
77

8-
98
Please make sure to use recent versions of (Yosys)[https://github.com/YosysHQ/yosys], (nextpnr-generic)[https://github.com/YosysHQ/nextpnr] (_not_ the old FABulous nextpnr fork)
10-
and (ghdl)[https://github.com/ghdl/ghdl] or use the (OSS-CAD-Suite)[https://github.com/YosysHQ/oss-cad-suite-build] which provides nightly builds of the necessary dependencies.
9+
and (GHDL with mcode backend)[https://github.com/ghdl/ghdl/releases] or use the (OSS-CAD-Suite)[https://github.com/YosysHQ/oss-cad-suite-build] which provides nightly builds of the necessary dependencies.
10+
11+
> [!NOTE]
12+
>
13+
>The OSS-CAD-Suite is providing GHDL only with LLVM backend, which increases the simulation speed for FABulous projects significantly.
14+
>We recommend using the latest GHDL with mcode backend for the best simulation performance.
1115
1216
Also, make sure you have the `make` package installed:
1317
```

FABulous/fabric_files/FABulous_project_template_vhdl/Test/sequential_16bit_en_tb.vhdl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ begin
157157
bitstream <= readmemh("bitstream.hex");
158158
wait for 100 ps;
159159
report "Bitstream loaded into memory array";
160-
-- resetn <= '1';
161-
-- wait for 100 ps;
162160
resetn <= '0';
163161
wait for 10000 ps;
164162
resetn <= '1';

docs/source/simulation/simulation.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ For more complex use cases it can be useful to create an own flow, like the foll
77

88

99
Please make sure to use recent versions of (Yosys)[https://github.com/YosysHQ/yosys], (nextpnr-generic)[https://github.com/YosysHQ/nextpnr] (_not_ the old FABulous nextpnr fork)
10-
and (iverilog)[https://github.com/steveicarus/iverilog] or use the (OSS-CAD-Suite)[https://github.com/YosysHQ/oss-cad-suite-build] which provides nightly builds of the necessary dependencies.
10+
and (GHDL with mcode backend)[https://github.com/ghdl/ghdl/releases] or use the (OSS-CAD-Suite)[https://github.com/YosysHQ/oss-cad-suite-build] which provides nightly builds of the necessary dependencies.
11+
12+
.. note:: The OSS-CAD-Suite is providing GHDL only with LLVM backend, which increases the simulation speed for FABulous projects significantly. We recommend using the latest GHDL with mcode backend for the best simulation performance.
1113

1214
Also, make sure you have the `make` package installed:
1315

0 commit comments

Comments
 (0)