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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
use crate::*;

// -----------------------------------------------------------------------------

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CovergroupDeclaration {
    pub nodes: (
        Keyword,
        CovergroupIdentifier,
        Option<Paren<Option<TfPortList>>>,
        Option<CoverageEvent>,
        Symbol,
        Vec<CoverageSpecOrOption>,
        Keyword,
        Option<(Symbol, CovergroupIdentifier)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CoverageSpecOrOption {
    Spec(Box<CoverageSpecOrOptionSpec>),
    Option(Box<CoverageSpecOrOptionOption>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverageSpecOrOptionSpec {
    pub nodes: (Vec<AttributeInstance>, CoverageSpec),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverageSpecOrOptionOption {
    pub nodes: (Vec<AttributeInstance>, CoverageOption, Symbol),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CoverageOption {
    Option(Box<CoverageOptionOption>),
    TypeOption(Box<CoverageOptionTypeOption>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverageOptionOption {
    pub nodes: (Keyword, Symbol, MemberIdentifier, Symbol, Expression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverageOptionTypeOption {
    pub nodes: (
        Keyword,
        Symbol,
        MemberIdentifier,
        Symbol,
        ConstantExpression,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CoverageSpec {
    CoverPoint(Box<CoverPoint>),
    CoverCross(Box<CoverCross>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CoverageEvent {
    ClockingEvent(Box<ClockingEvent>),
    Sample(Box<CoverageEventSample>),
    At(Box<CoverageEventAt>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverageEventSample {
    pub nodes: (Keyword, Keyword, Keyword, Paren<Option<TfPortList>>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverageEventAt {
    pub nodes: (Symbol, Paren<BlockEventExpression>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum BlockEventExpression {
    Or(Box<BlockEventExpressionOr>),
    Begin(Box<BlockEventExpressionBegin>),
    End(Box<BlockEventExpressionEnd>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BlockEventExpressionOr {
    pub nodes: (BlockEventExpression, Keyword, BlockEventExpression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BlockEventExpressionBegin {
    pub nodes: (Keyword, HierarchicalBtfIdentifier),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BlockEventExpressionEnd {
    pub nodes: (Keyword, HierarchicalBtfIdentifier),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum HierarchicalBtfIdentifier {
    HierarchicalTfIdentifier(Box<HierarchicalTfIdentifier>),
    HierarchicalBlockIdentifier(Box<HierarchicalBlockIdentifier>),
    Method(Box<HierarchicalBtfIdentifierMethod>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct HierarchicalBtfIdentifierMethod {
    pub nodes: (Option<HierarchicalIdentifierOrClassScope>, MethodIdentifier),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum HierarchicalIdentifierOrClassScope {
    HierarchicalIdentifier(Box<(HierarchicalIdentifier, Symbol)>),
    ClassScope(Box<ClassScope>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverPoint {
    pub nodes: (
        Option<(Option<DataTypeOrImplicit>, CoverPointIdentifier, Symbol)>,
        Keyword,
        Expression,
        Option<(Keyword, Paren<Expression>)>,
        BinsOrEmpty,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum BinsOrEmpty {
    NonEmpty(Box<BinsOrEmptyNonEmpty>),
    Empty(Box<Symbol>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrEmptyNonEmpty {
    pub nodes: (Brace<(Vec<AttributeInstance>, Vec<(BinsOrOptions, Symbol)>)>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum BinsOrOptions {
    CoverageOption(Box<CoverageOption>),
    Covergroup(Box<BinsOrOptionsCovergroup>),
    CoverPoint(Box<BinsOrOptionsCoverPoint>),
    SetCovergroup(Box<BinsOrOptionsSetCovergroup>),
    TransList(Box<BinsOrOptionsTransList>),
    Default(Box<BinsOrOptionsDefault>),
    DefaultSequence(Box<BinsOrOptionsDefaultSequence>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrOptionsCovergroup {
    pub nodes: (
        Option<Wildcard>,
        BinsKeyword,
        BinIdentifier,
        Option<Bracket<Option<CovergroupExpression>>>,
        Symbol,
        Brace<CovergroupRangeList>,
        Option<(Keyword, Paren<WithCovergroupExpression>)>,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct Wildcard {
    pub nodes: (Keyword,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrOptionsCoverPoint {
    pub nodes: (
        Option<Wildcard>,
        BinsKeyword,
        BinIdentifier,
        Option<Bracket<Option<CovergroupExpression>>>,
        Symbol,
        CoverPointIdentifier,
        Keyword,
        Paren<WithCovergroupExpression>,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrOptionsSetCovergroup {
    pub nodes: (
        Option<Wildcard>,
        BinsKeyword,
        BinIdentifier,
        Option<Bracket<Option<CovergroupExpression>>>,
        Symbol,
        SetCovergroupExpression,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrOptionsTransList {
    pub nodes: (
        Option<Wildcard>,
        BinsKeyword,
        BinIdentifier,
        Option<(Symbol, Symbol)>,
        Symbol,
        TransList,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrOptionsDefault {
    pub nodes: (
        BinsKeyword,
        BinIdentifier,
        Option<Bracket<Option<CovergroupExpression>>>,
        Symbol,
        Keyword,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsOrOptionsDefaultSequence {
    pub nodes: (
        BinsKeyword,
        BinIdentifier,
        Symbol,
        Keyword,
        Keyword,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum BinsKeyword {
    Bins(Box<Keyword>),
    IllegalBins(Box<Keyword>),
    IgnoreBins(Box<Keyword>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TransList {
    pub nodes: (List<Symbol, Paren<TransSet>>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TransSet {
    pub nodes: (List<Symbol, TransRangeList>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum TransRangeList {
    TransItem(Box<TransItem>),
    Asterisk(Box<TransRangeListAsterisk>),
    Arrow(Box<TransRangeListArrow>),
    Equal(Box<TransRangeListEqual>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TransRangeListAsterisk {
    pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TransRangeListArrow {
    pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TransRangeListEqual {
    pub nodes: (TransItem, Bracket<(Symbol, RepeatRange)>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct TransItem {
    pub nodes: (CovergroupRangeList,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum RepeatRange {
    CovergroupExpression(Box<CovergroupExpression>),
    Binary(Box<RepeatRangeBinary>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct RepeatRangeBinary {
    pub nodes: (CovergroupExpression, Symbol, CovergroupExpression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CoverCross {
    pub nodes: (
        Option<(CrossIdentifier, Symbol)>,
        Keyword,
        ListOfCrossItems,
        Option<(Keyword, Paren<Expression>)>,
        CrossBody,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct ListOfCrossItems {
    pub nodes: (CrossItem, Symbol, List<Symbol, CrossItem>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CrossItem {
    CoverPointIdentifier(Box<CoverPointIdentifier>),
    VariableIdentifier(Box<VariableIdentifier>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CrossBody {
    NonEmpty(Box<CrossBodyNonEmpty>),
    Empty(Box<Symbol>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CrossBodyNonEmpty {
    pub nodes: (Brace<Vec<CrossBodyItem>>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CrossBodyItem {
    FunctionDeclaration(Box<FunctionDeclaration>),
    BinsSelectionOrOption(Box<(BinsSelectionOrOption, Symbol)>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum BinsSelectionOrOption {
    Coverage(Box<BinsSelectionOrOptionCoverage>),
    Bins(Box<BinsSelectionOrOptionBins>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsSelectionOrOptionCoverage {
    pub nodes: (Vec<AttributeInstance>, CoverageOption),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsSelectionOrOptionBins {
    pub nodes: (Vec<AttributeInstance>, BinsSelection),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsSelection {
    pub nodes: (
        BinsKeyword,
        BinIdentifier,
        Symbol,
        SelectExpression,
        Option<(Keyword, Paren<Expression>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum SelectExpression {
    SelectCondition(Box<SelectCondition>),
    Not(Box<SelectExpressionNot>),
    And(Box<SelectExpressionAnd>),
    Or(Box<SelectExpressionOr>),
    Paren(Box<SelectExpressionParen>),
    With(Box<SelectExpressionWith>),
    CrossIdentifier(Box<CrossIdentifier>),
    CrossSet(Box<SelectExpressionCrossSet>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectExpressionNot {
    pub nodes: (Symbol, SelectCondition),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectExpressionAnd {
    pub nodes: (SelectExpression, Symbol, SelectExpression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectExpressionOr {
    pub nodes: (SelectExpression, Symbol, SelectExpression),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectExpressionParen {
    pub nodes: (Paren<SelectExpression>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectExpressionWith {
    pub nodes: (
        SelectExpression,
        Keyword,
        Paren<WithCovergroupExpression>,
        Option<(Keyword, IntegerCovergroupExpression)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectExpressionCrossSet {
    pub nodes: (
        CrossSetExpression,
        Option<(Keyword, IntegerCovergroupExpression)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SelectCondition {
    pub nodes: (
        Keyword,
        Paren<BinsExpression>,
        Option<(Keyword, Brace<CovergroupRangeList>)>,
    ),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum BinsExpression {
    VariableIdentifier(Box<VariableIdentifier>),
    CoverPoint(Box<BinsExpressionCoverPoint>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct BinsExpressionCoverPoint {
    pub nodes: (CoverPointIdentifier, Option<(Symbol, BinIdentifier)>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CovergroupRangeList {
    pub nodes: (List<Symbol, CovergroupValueRange>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub enum CovergroupValueRange {
    CovergroupExpression(Box<CovergroupExpression>),
    Binary(Box<CovergroupValueRangeBinary>),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CovergroupValueRangeBinary {
    pub nodes: (Bracket<(CovergroupExpression, Symbol, CovergroupExpression)>,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct WithCovergroupExpression {
    pub nodes: (CovergroupExpression,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct SetCovergroupExpression {
    pub nodes: (CovergroupExpression,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct IntegerCovergroupExpression {
    pub nodes: (CovergroupExpression,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CrossSetExpression {
    pub nodes: (CovergroupExpression,),
}

#[derive(Clone, Debug, PartialEq, Node)]
pub struct CovergroupExpression {
    pub nodes: (Expression,),
}