sv_parser_syntaxtree/instantiations/
generated_instantiation.rs

1use crate::*;
2
3// -----------------------------------------------------------------------------
4
5#[derive(Clone, Debug, PartialEq, Node)]
6pub struct GenerateRegion {
7    pub nodes: (Keyword, Vec<GenerateItem>, Keyword),
8}
9
10#[derive(Clone, Debug, PartialEq, Node)]
11pub struct LoopGenerateConstruct {
12    pub nodes: (
13        Keyword,
14        Paren<(
15            GenvarInitialization,
16            Symbol,
17            GenvarExpression,
18            Symbol,
19            GenvarIteration,
20        )>,
21        GenerateBlock,
22    ),
23}
24
25#[derive(Clone, Debug, PartialEq, Node)]
26pub struct GenvarInitialization {
27    pub nodes: (Option<Genvar>, GenvarIdentifier, Symbol, ConstantExpression),
28}
29
30#[derive(Clone, Debug, PartialEq, Node)]
31pub struct Genvar {
32    pub nodes: (Keyword,),
33}
34
35#[derive(Clone, Debug, PartialEq, Node)]
36pub enum GenvarIteration {
37    Assignment(Box<GenvarIterationAssignment>),
38    Prefix(Box<GenvarIterationPrefix>),
39    Suffix(Box<GenvarIterationSuffix>),
40}
41
42#[derive(Clone, Debug, PartialEq, Node)]
43pub struct GenvarIterationAssignment {
44    pub nodes: (GenvarIdentifier, AssignmentOperator, GenvarExpression),
45}
46
47#[derive(Clone, Debug, PartialEq, Node)]
48pub struct GenvarIterationPrefix {
49    pub nodes: (IncOrDecOperator, GenvarIdentifier),
50}
51
52#[derive(Clone, Debug, PartialEq, Node)]
53pub struct GenvarIterationSuffix {
54    pub nodes: (GenvarIdentifier, IncOrDecOperator),
55}
56
57#[derive(Clone, Debug, PartialEq, Node)]
58pub enum ConditionalGenerateConstruct {
59    If(Box<IfGenerateConstruct>),
60    Case(Box<CaseGenerateConstruct>),
61}
62
63#[derive(Clone, Debug, PartialEq, Node)]
64pub struct IfGenerateConstruct {
65    pub nodes: (
66        Keyword,
67        Paren<ConstantExpression>,
68        GenerateBlock,
69        Option<(Keyword, GenerateBlock)>,
70    ),
71}
72
73#[derive(Clone, Debug, PartialEq, Node)]
74pub struct CaseGenerateConstruct {
75    pub nodes: (
76        Keyword,
77        Paren<ConstantExpression>,
78        Vec<CaseGenerateItem>,
79        Keyword,
80    ),
81}
82
83#[derive(Clone, Debug, PartialEq, Node)]
84pub enum CaseGenerateItem {
85    Nondefault(Box<CaseGenerateItemNondefault>),
86    Default(Box<CaseGenerateItemDefault>),
87}
88
89#[derive(Clone, Debug, PartialEq, Node)]
90pub struct CaseGenerateItemNondefault {
91    pub nodes: (List<Symbol, ConstantExpression>, Symbol, GenerateBlock),
92}
93
94#[derive(Clone, Debug, PartialEq, Node)]
95pub struct CaseGenerateItemDefault {
96    pub nodes: (Keyword, Option<Symbol>, GenerateBlock),
97}
98
99#[derive(Clone, Debug, PartialEq, Node)]
100pub enum GenerateBlock {
101    GenerateItem(Box<GenerateItem>),
102    Multiple(Box<GenerateBlockMultiple>),
103}
104
105#[derive(Clone, Debug, PartialEq, Node)]
106pub struct GenerateBlockMultiple {
107    pub nodes: (
108        Option<(GenerateBlockIdentifier, Symbol)>,
109        Keyword,
110        Option<(Symbol, GenerateBlockIdentifier)>,
111        Vec<GenerateItem>,
112        Keyword,
113        Option<(Symbol, GenerateBlockIdentifier)>,
114    ),
115}
116
117#[derive(Clone, Debug, PartialEq, Node)]
118pub enum GenerateItem {
119    ModuleOrGenerateItem(Box<ModuleOrGenerateItem>),
120    InterfaceOrGenerateItem(Box<InterfaceOrGenerateItem>),
121    CheckerOrGenerateItem(Box<CheckerOrGenerateItem>),
122}