forked from lowRISC/opentitan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pattgen_testplan.hjson
249 lines (237 loc) · 8.6 KB
/
pattgen_testplan.hjson
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
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
{
name: "pattgen"
import_testplans: ["hw/dv/tools/dvsim/testplans/csr_testplan.hjson",
"hw/dv/tools/dvsim/testplans/alert_test_testplan.hjson",
"hw/dv/tools/dvsim/testplans/intr_test_testplan.hjson",
"hw/dv/tools/dvsim/testplans/stress_all_with_reset_testplan.hjson",
"hw/dv/tools/dvsim/testplans/tl_device_access_types_testplan.hjson",
"pattgen_sec_cm_testplan.hjson"],
testpoints: [
{
name: smoke
desc: '''
Smoke test for pattgen ip in which dut is randomly programmed
to generate random patterns on output channels.
Stimulus:
- Program the configuration registers of the output channels
- Randomly activate the output channels
- Re-program the configuration registers of the output channels once
completion interrupts are asserted
Checking:
- Check divided clock rate for the active channels
matching with the values of pre-divider registers
- Check generated pattern matching on the active channels
matching with the values of pattern data registers
- Check completion interrupts are asserted once a pattern
is completely generated on the active channels
'''
stage: V1
tests: ["pattgen_smoke"]
}
{
name: perf
desc: '''
Checking ip operation at min/max bandwidth
Stimulus:
- Program the pre-divider registers to high/low values (slow/fast data rate)
- Program the pattern data registers, the pattern length per output, and
repeat counter registers to high/low values
- Start and stop channels quickly
- Clear interrupts quickly
Checking:
- Ensure patterns are correctly generated
- Ensure interrupts are robust asserted and cleared (e.g. at the high data rate)
'''
stage: V2
tests: ["pattgen_perf"]
}
{
name: cnt_rollover
desc: '''
Checking ip operation with random counter values
Stimulus:
- Program the pre-divider and size registers to unconstraint random values
- Program the clk_cnt, bit_cnt and rep_cnt to values less than but close to
predivider and size registers, so that counting would take a reasonable
number of clock cycles
- include programming for corner cases
repeat programming a random number of times
- Start and stop channels quickly
- Clear interrupts quickly
Checking:
- Include functional cover point that rollover value is reached and counter is re-enabled:
- Ensure patterns are correctly generated
- Ensure interrupts are robust asserted and cleared (e.g. at the high data rate)
'''
stage: V2
tests: ["cnt_rollover"]
}
{
name: error
desc: '''
Reset then re-start the output channel on the fly.
Stimulus:
- Programm the configuration registers of the output channels
- Randomly re-enable the in progress output channels
- Re-program the configuration registers of the output channels
Checking:
- Ensure patterns are dropped when re-enabled
- Ensure the output channels get back normal after re-enable
'''
stage: V2
tests: ["pattgen_error"]
}
{
name: stress_all
desc: '''
Stress_all test is a random mix of all the test above except csr tests.
'''
stage: V2
tests: ["pattgen_stress_all"]
}
]
covergroups: [
{
name: pattgen_op_cg
desc: '''
Covers the ch0 pattern generation complete interrupt and event done.
Covers the ch1 pattern generation complete interrupt and event done.
'''
}
{
name: pattgen_counters_max_values_cg
desc: '''
Covers the initial and maximum counter values of the following:
- Initial and maximum values of clock divide counter
- Initial and maximum values of length counter
- Initial and maximum values of repetition counter
All valid combinations of the above will also be crossed.
'''
}
{
name: pattgen_ch0_cnt_reset_cg
desc: '''
Covers that ch0 counter values resets to zero when it reaches the assigned value.
It includes:
- Clock divide counter value
- Length counter value
- Repetition counter value
All valid combinations of the above will also be crossed.
'''
}
{
name: pattgen_ch1_cnt_reset_cg
desc: '''
Covers that ch1 counter values resets to zero when it reaches the assigned value.
It includes:
- Clock divide counter value
- Length counter value
- Repetition counter value
All valid combinations of the above will also be crossed.
'''
}
{
name: ctrl_cg
desc: '''
Covers that all valid enable and polarity settings
for the Pattgen control register have been tested.
Individual enable and polarity settings that will be covered include:
- Enable pattern generator functionality for Channel 0 (ENABLE_CH0)
- Enable pattern generator functionality for Channel 1 (ENABLE_CH1)
- Clock (pcl) polarity for Channel 0 (POLARITY_CH0)
- Clock (pcl) polarity for Channel 1 (POLARITY_CH1)
All valid combinations of the above will also be crossed.
'''
}
{
name: inter_cg
desc: '''
intr_cg is defined in cip_base_env_cov and
referenced in pattgen_scoreboard
'''
}
{
name: pattern_len_ch0_cg
desc: '''
Covers various Lengths of the channel0 seed pattern ranges,
to ensure that Pattgen can operate successfully
on different pattern lengths.
we will cover that an acceptable distribution of lengths has been seen,
and specifically cover some corner cases.
'''
}
{
name: pattern_len_ch1_cg
desc: '''
Similar to channel 0.
'''
}
{
name: pattern_reps_ch0_cg
desc: '''
Covers various numbers of channel repetitions of the channel0, to ensure that Pattgen
can operate successfully on different pattern lengths.
we will cover that an acceptable distribution of lengths has been seen,
and specifically cover all corner cases.
'''
}
{
name: pattern_reps_ch1_cg
desc: '''
Similar to channel 0.
'''
}
{
name: pattern_prediv_ch0_cg
desc: '''
Covers various numbers of clock divide ratios of the channel0, to ensure that Pattgen
can operate successfully on different clock divide ratios.
we will cover that an acceptable distribution of lengths has been seen,
and specifically cover corner cases.
'''
}
{
name: pattern_prediv_ch1_cg
desc: '''
Similar to channel 0.
'''
}
{
name: pattern_data_ch0_0_cg
desc: '''
Covers various data_0 values of the channel0 seed pattern ranges,
to ensure that Pattgen can operate successfully on different pattern lengths.
we will cover that an acceptable distribution of lengths has been seen,
and specifically cover corner cases. The covergroup takes data from
TL_UL scoreboard input
'''
}
{
name: pattern_data_ch0_1_cg
desc: '''
Similar to pattern_data_ch0_0_cg, except using data_1 values
'''
}
{
name: pattern_data_ch1_0_cg
desc: '''
Similar to pattern_data_ch0_0_cg.
'''
}
{
name: pattern_data_ch1_1_cg
desc: '''
Similar to pattern_data_ch0_1_cg.
'''
}
{
name: program_while_busy_cg
desc: '''
Program the DUT while pattern is being produced to insure current pattern is not being corrupt.
'''
}
]
}