forked from enjoy-digital/litedram
-
Notifications
You must be signed in to change notification settings - Fork 1
276 lines (242 loc) · 10.2 KB
/
ci.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: ci
on: [push, pull_request]
env:
LITEX_BRANCH: antmicro/ddr5-support
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
pytest_args:
- 'test -k "not (Verilator or ddr5)"'
- 'test/test_lpddr4.py -k "Verilator"'
- 'test/test_lpddr5.py -k "Verilator"'
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v3
- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1.2
# Install Tools
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install wget build-essential python3 ninja-build -y
sudo apt-get install libevent-dev libjson-c-dev flex bison git -y
sudo apt-get install libfl-dev libfl2 zlib1g-dev python3-pip autoconf -y
pip3 install setuptools
pip3 install requests
pip3 install pexpect
pip3 install meson==0.62.0
pip3 install pytest==7.1.0
pip3 install numpy
- name: Install pytest-parallel
if: ${{ contains(matrix.pytest_args, 'not') }}
run: pip install pytest-parallel
# Install (n)Migen / LiteX / Cores
- name: Install LiteX
run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
python3 litex_setup.py init install --user
# temporary hack until merged to master
git -C ../litex remote add antmicro https://github.com/antmicro/litex.git
git -C ../litex fetch antmicro
git -C ../litex checkout $LITEX_BRANCH
git -C ../litex-boards checkout 6c05ddae1ba4d2b363e80001919e4682745cc3cf
# Install RISC-V GCC
- name: Install RISC-V GCC
run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
# python3 litex_setup.py gcc
curl -L https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.08/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14.tar.gz | tar -xzf -
mv riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14 ../riscv64-unknown-elf-gcc
sudo mkdir /usr/local/riscv
sudo cp -r $PWD/../riscv64-*/* /usr/local/riscv
# Build / Install Verilator
- name: Build Verilator
if: ${{ !contains(matrix.pytest_args, 'not') }}
run: |
sudo apt install help2man
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
git clone https://github.com/verilator/verilator
cd verilator
autoconf
./configure
make -j$(nproc)
sudo make install
# Install Project
- name: Install Project
run: python3 setup.py develop --user
# Test
- name: Run Tests
if: ${{ contains(matrix.pytest_args, 'not') }}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest ${{ matrix.pytest_args }} --verbose --workers auto
- name: Run Tests
if: ${{ !contains(matrix.pytest_args, 'not') }}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest ${{ matrix.pytest_args }} --verbose
test_ddr5:
runs-on: ubuntu-22.04
name: "DDR5 tests"
strategy:
fail-fast: false
matrix:
pytest_args:
- 'test/test_ddr5_phy.py'
- 'test/test_ddr5_rcd_core.py'
- 'test/test_ddr5_rcd_decoder.py'
- 'test/test_ddr5_rcd_actor_mrw.py'
- 'test/test_ddr5_rcd_sideband.py'
- 'test/test_ddr5_rdimm_regression.py'
- 'test/test_ddr5_rdimm_phy.py'
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v3
- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1.2
# Install Tools
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install wget build-essential python3 ninja-build -y
sudo apt-get install libevent-dev libjson-c-dev flex bison git -y
sudo apt-get install libfl-dev libfl2 zlib1g-dev python3-pip autoconf -y
pip3 install setuptools
pip3 install requests
pip3 install pexpect
pip3 install meson==0.62.0
pip3 install pytest==7.1.0
pip3 install numpy
- name: Install pytest-parallel
run: pip install pytest-parallel
# Install (n)Migen / LiteX / Cores
- name: Install LiteX
run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
python3 litex_setup.py init install --user
# temporary hack until merged to master
git -C ../litex remote add antmicro https://github.com/antmicro/litex.git
git -C ../litex fetch antmicro
git -C ../litex checkout $LITEX_BRANCH
git -C ../litex-boards checkout 6c05ddae1ba4d2b363e80001919e4682745cc3cf
# Install RISC-V GCC
- name: Install RISC-V GCC
run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
# python3 litex_setup.py gcc
curl -L https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.08/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14.tar.gz | tar -xzf -
mv riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14 ../riscv64-unknown-elf-gcc
sudo mkdir /usr/local/riscv
sudo cp -r $PWD/../riscv64-*/* /usr/local/riscv
# Install Project
- name: Install Project
run: python3 setup.py develop --user
- name: Run Tests
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest ${{ matrix.pytest_args }} --verbose --workers auto
test_ddr5_verilator:
runs-on: ubuntu-22.04
name: "DDR5 Verilator tests"
strategy:
fail-fast: false
matrix:
with_sub_channels:
- "true"
- "false"
dq_dqs_ratio:
- "4"
- "8"
module_in_rank:
- "1"
- "2"
include:
- with_sub_channels: "true"
rcd_mode: "pass_through"
- with_sub_channels: "true"
rcd_mode: "normal"
- dq_dqs_ratio: "8"
with_dm: "true"
- dq_dqs_ratio: "8"
with_dm: "false"
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v2
- name: Setup CCache
uses: hendrikmuhs/ccache-action@v1
# Install Tools
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install wget build-essential python3 ninja-build -y
sudo apt-get install libevent-dev libjson-c-dev flex bison git -y
sudo apt-get install libfl-dev libfl2 zlib1g-dev python3-pip autoconf -y
pip3 install setuptools
pip3 install requests
pip3 install pexpect
pip3 install meson==0.62.0
pip3 install pytest==7.1.0
# Install (n)Migen / LiteX / Cores
- name: Install LiteX
run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
python3 litex_setup.py init install --user
# temporary hack until merged to master
git -C ../litex remote add antmicro https://github.com/antmicro/litex.git
git -C ../litex fetch antmicro
git -C ../litex checkout $LITEX_BRANCH
git -C ../litex-boards checkout 6c05ddae1ba4d2b363e80001919e4682745cc3cf
# Install RISC-V GCC
- name: Install RISC-V GCC
run: |
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
# python3 litex_setup.py gcc
curl -L https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.08/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14.tar.gz | tar -xzf -
mv riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14 ../riscv64-unknown-elf-gcc
sudo mkdir /usr/local/riscv
sudo cp -r $PWD/../riscv64-*/* /usr/local/riscv
- name: Build Verilator
run: |
sudo apt install help2man
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
git clone https://github.com/verilator/verilator
cd verilator
autoconf
./configure
make -j$(nproc)
sudo make install
# Install Project
- name: Install Project
run: python3 setup.py develop --user
# RCD regression test
- name: Run Tests
if: ${{ matrix.rcd_mode == 'pass_through'}}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest test/test_ddr5_rdimm_regression.py -k ${{ format('test_ddr5_rcd_reg_sim_dq_dqs_ratio_{0}_modules_per_rank_{1}', matrix.dq_dqs_ratio, matrix.module_in_rank) }} --verbose
# RCD test
- name: Run Tests
if: ${{ matrix.rcd_mode == 'normal'}}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest test/test_ddr5_rdimm.py -k ${{ format('test_ddr5_rcd_sim_dq_dqs_ratio_{0}_modules_per_rank_{1}', matrix.dq_dqs_ratio, matrix.module_in_rank) }} --verbose
# NO RCD test
- name: Run Tests
if: ${{ matrix.rcd_mode != 'pass_through' && matrix.rcd_mode != 'normal' && matrix.dq_dqs_ratio != '8' }}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest test/test_ddr5.py -k ${{ format('test_ddr5_sim_dq_dqs_ratio_4_with_sub_channels_{0}_modules_per_rank_{1}', matrix.with_sub_channels, matrix.module_in_rank) }} --verbose
if: ${{ matrix.rcd_mode != 'pass_through' && matrix.rcd_mode != 'normal' && matrix.dq_dqs_ratio == '8' && matrix.with_dm }}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest test/test_ddr5.py -k ${{ format('test_ddr5_sim_dq_dqs_ratio_8_with_sub_channels_{0}_modules_per_rank_{1}_with_dm', matrix.with_sub_channels, matrix.module_in_rank) }} --verbose
if: ${{ matrix.rcd_mode != 'pass_through' && matrix.rcd_mode != 'normal' && matrix.dq_dqs_ratio == '8' && !matrix.with_dm }}
run: |
export PATH=/usr/local/riscv/bin:$PATH
pytest test/test_ddr5.py -k ${{ format('test_ddr5_sim_dq_dqs_ratio_8_with_sub_channels_{0}_modules_per_rank_{1}_without_dm', matrix.with_sub_channels, matrix.module_in_rank) }} --verbose