-
Notifications
You must be signed in to change notification settings - Fork 2
184 lines (164 loc) · 6.48 KB
/
dpi-examples.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Test DPI Examples
on:
push:
paths-ignore:
- README.md
pull_request:
workflow_dispatch:
inputs:
renode_git_repo:
description: 'Renode git repository'
required: true
default: https://github.com/renode/renode
renode_git_ref:
description: 'Renode git revision'
required: true
default: master
verilator_git_ref:
description: Reference to a Verilator commit
required: true
type: string
jobs:
run-prebuilt-sample:
name: "Build Renode and run a prebuilt sample"
strategy:
fail-fast: false
matrix:
config:
- runner: ubuntu-20.04
- runner: windows-latest
runs-on: ${{ matrix.config.runner }}
defaults:
run:
shell: bash
env:
RENODE_ARGS: -e "emulation RunFor \"20\"; quit"
steps:
- uses: actions/checkout@v3
- uses: ./.github/build-renode
with:
renode_git_repo: ${{ inputs.renode_git_repo || 'https://github.com/renode/renode' }}
renode_git_ref: ${{ inputs.renode_git_ref || 'master' }}
- name: Run Renode
run: renode ${{ env.RENODE_ARGS }} samples/axi_fastvdma_prebuilt/platform.resc
build-verilator-linux:
uses: ./.github/workflows/build-verilator.yml
with:
runner: ubuntu-20.04
verilator_git_ref: ${{ inputs.verilator_git_ref || 'v5.018' }}
build-verilator-windows:
uses: ./.github/workflows/build-verilator.yml
with:
runner: windows-latest
verilator_git_ref: ${{ inputs.verilator_git_ref || 'v5.018' }}
build-fastvdma-sample:
name: Build FastVDMA sample
strategy:
matrix:
bus_width: [8, 16, 32, 64]
runs-on: ubuntu-latest
env:
FASTVDMA_GIT_REF: 0172db9fb0e3873af418941ecc0151241666350a
FASTVDMA_DIR: ${{ github.workspace }}/fastvdma
SAMPLE_DIR: ${{ github.workspace }}/samples/axi_fastvdma
CUSTOM_SAMPLE_NAME: axi_fastvdma-${{ matrix.bus_width }}
CUSTOM_SAMPLE_DIR: ${{ github.workspace }}/samples/axi_fastvdma-${{ matrix.bus_width }}
steps:
- name: Checkout the renode-dpi-examples repository
uses: actions/checkout@v3
- name: Clone the FastVDMA repository
uses: actions/checkout@v3
with:
repository: antmicro/fastvdma
ref: ${{ env.FASTVDMA_GIT_REF }}
path: fastvdma
- name: Add the Scala SBT packages repository
run: |
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
- name: Install dependencies
run: >
sudo apt update
&& sudo apt-get install -y --no-install-recommends
default-jdk
default-jre
sbt
- name: Build HDL
run: |
cp -R ${{ env.SAMPLE_DIR }} ${{ env.CUSTOM_SAMPLE_DIR}}
CONFIG_FILE=${{ env.CUSTOM_SAMPLE_DIR }}/config_${{ matrix.bus_width }}.json
jq --argjson width ${{ matrix.bus_width }} \
'.readDataWidth = $width | .writeDataWidth = $width' \
${{ env.SAMPLE_DIR }}/config_base.json > $CONFIG_FILE
cd ${{ env.FASTVDMA_DIR }}
make verilog CONFIG_FILE=$CONFIG_FILE
cp DMATop*.v ${{ env.CUSTOM_SAMPLE_DIR }}/DMATop.v
sed -i 's/DMATopAXI_AXIL_AXI/DMATop/' ${{ env.CUSTOM_SAMPLE_DIR }}/DMATop.v
- name: Clean up the custom sample dir
run: |
cd ${{ env.CUSTOM_SAMPLE_DIR }}
rm *_linux.*
rm config_base.json
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.CUSTOM_SAMPLE_NAME }}
path: ${{ env.CUSTOM_SAMPLE_DIR }}
run-sample:
name: Run sample
needs: [build-fastvdma-sample, build-verilator-linux, build-verilator-windows]
strategy:
fail-fast: false
matrix:
sample:
- directory_name: axi_ram
- directory_name: axi_ram
custom_cmake_args: -DAXI_DATA_WIDTH=64
custom_robot_args: --variable=BUS_WIDTH:64
- directory_name: axi_ram
custom_cmake_args: -DAXI_DATA_WIDTH=32
custom_robot_args: --variable=BUS_WIDTH:32
- directory_name: axi_ram
custom_cmake_args: -DAXI_DATA_WIDTH=16
custom_robot_args: --variable=BUS_WIDTH:16
- directory_name: axi_ram
custom_cmake_args: -DAXI_DATA_WIDTH=8
custom_robot_args: --variable=BUS_WIDTH:8
- directory_name: axi_fastvdma
- directory_name: axi_fastvdma-64
custom_artifact: true
custom_cmake_args: -DAXI_DATA_WIDTH=64
custom_robot_args: --variable=BUS_WIDTH:64
- directory_name: axi_fastvdma-32
custom_artifact: true
custom_cmake_args: -DAXI_DATA_WIDTH=32
custom_robot_args: --variable=BUS_WIDTH:32
- directory_name: axi_fastvdma-16
custom_artifact: true
custom_cmake_args: -DAXI_DATA_WIDTH=16
custom_robot_args: --variable=BUS_WIDTH:16
- directory_name: axi_fastvdma-8
custom_artifact: true
custom_cmake_args: -DAXI_DATA_WIDTH=8
custom_robot_args: --variable=BUS_WIDTH:8
- directory_name: apb3_completer_mem
- directory_name: apb3_requester_synth
- directory_name: apb3_standalone
- directory_name: ahb_mem
- directory_name: ahb_dma
config:
- runner: ubuntu-20.04
verilator_artifact: ${{ needs.build-verilator-linux.outputs.verilator_artifact }}
- runner: windows-latest
verilator_artifact: ${{ needs.build-verilator-windows.outputs.verilator_artifact }}
uses: ./.github/workflows/run-sample.yml
with:
sample: ${{ matrix.sample.directory_name }}
custom_artifact: ${{ matrix.sample.custom_artifact || false }}
custom_cmake_args: ${{ matrix.sample.custom_cmake_args || '' }}
custom_robot_args: ${{ matrix.sample.custom_robot_args || '' }}
runner: ${{ matrix.config.runner }}
verilator_artifact: ${{ matrix.config.verilator_artifact }}
renode_git_repo: ${{ inputs.renode_git_repo || 'https://github.com/renode/renode' }}
renode_git_ref: ${{ inputs.renode_git_ref || 'master' }}