sv_parser_syntaxtree/behavioral_statements/
clocking_block.rs

1use crate::*;
2
3// -----------------------------------------------------------------------------
4
5#[derive(Clone, Debug, PartialEq, Node)]
6pub enum ClockingDeclaration {
7    Local(Box<ClockingDeclarationLocal>),
8    Global(Box<ClockingDeclarationGlobal>),
9}
10
11#[derive(Clone, Debug, PartialEq, Node)]
12pub struct ClockingDeclarationLocal {
13    pub nodes: (
14        Option<Default>,
15        Keyword,
16        Option<ClockingIdentifier>,
17        ClockingEvent,
18        Symbol,
19        Vec<ClockingItem>,
20        Keyword,
21        Option<(Symbol, ClockingIdentifier)>,
22    ),
23}
24
25#[derive(Clone, Debug, PartialEq, Node)]
26pub struct Default {
27    pub nodes: (Keyword,),
28}
29
30#[derive(Clone, Debug, PartialEq, Node)]
31pub struct ClockingDeclarationGlobal {
32    pub nodes: (
33        Keyword,
34        Keyword,
35        Option<ClockingIdentifier>,
36        ClockingEvent,
37        Symbol,
38        Keyword,
39        Option<(Symbol, ClockingIdentifier)>,
40    ),
41}
42
43#[derive(Clone, Debug, PartialEq, Node)]
44pub enum ClockingEvent {
45    Identifier(Box<ClockingEventIdentifier>),
46    Expression(Box<ClockingEventExpression>),
47}
48
49#[derive(Clone, Debug, PartialEq, Node)]
50pub struct ClockingEventIdentifier {
51    pub nodes: (Symbol, Identifier),
52}
53
54#[derive(Clone, Debug, PartialEq, Node)]
55pub struct ClockingEventExpression {
56    pub nodes: (Symbol, Paren<EventExpression>),
57}
58
59#[derive(Clone, Debug, PartialEq, Node)]
60pub enum ClockingItem {
61    Default(Box<ClockingItemDefault>),
62    Direction(Box<ClockingItemDirection>),
63    Assertion(Box<ClockingItemAssertion>),
64}
65
66#[derive(Clone, Debug, PartialEq, Node)]
67pub struct ClockingItemDefault {
68    pub nodes: (Keyword, DefaultSkew, Symbol),
69}
70
71#[derive(Clone, Debug, PartialEq, Node)]
72pub struct ClockingItemDirection {
73    pub nodes: (ClockingDirection, ListOfClockingDeclAssign, Symbol),
74}
75
76#[derive(Clone, Debug, PartialEq, Node)]
77pub struct ClockingItemAssertion {
78    pub nodes: (Vec<AttributeInstance>, AssertionItemDeclaration),
79}
80
81#[derive(Clone, Debug, PartialEq, Node)]
82pub enum DefaultSkew {
83    Input(Box<DefaultSkewInput>),
84    Output(Box<DefaultSkewOutput>),
85    InputOutput(Box<DefaultSkewInputOutput>),
86}
87
88#[derive(Clone, Debug, PartialEq, Node)]
89pub struct DefaultSkewInput {
90    pub nodes: (Keyword, ClockingSkew),
91}
92
93#[derive(Clone, Debug, PartialEq, Node)]
94pub struct DefaultSkewOutput {
95    pub nodes: (Keyword, ClockingSkew),
96}
97
98#[derive(Clone, Debug, PartialEq, Node)]
99pub struct DefaultSkewInputOutput {
100    pub nodes: (Keyword, ClockingSkew, Keyword, ClockingSkew),
101}
102
103#[derive(Clone, Debug, PartialEq, Node)]
104pub enum ClockingDirection {
105    Input(Box<ClockingDirectionInput>),
106    Output(Box<ClockingDirectionOutput>),
107    InputOutput(Box<ClockingDirectionInputOutput>),
108    Inout(Box<Keyword>),
109}
110
111#[derive(Clone, Debug, PartialEq, Node)]
112pub struct ClockingDirectionInput {
113    pub nodes: (Keyword, Option<ClockingSkew>),
114}
115
116#[derive(Clone, Debug, PartialEq, Node)]
117pub struct ClockingDirectionOutput {
118    pub nodes: (Keyword, Option<ClockingSkew>),
119}
120
121#[derive(Clone, Debug, PartialEq, Node)]
122pub struct ClockingDirectionInputOutput {
123    pub nodes: (Keyword, Option<ClockingSkew>, Keyword, Option<ClockingSkew>),
124}
125
126#[derive(Clone, Debug, PartialEq, Node)]
127pub struct ListOfClockingDeclAssign {
128    pub nodes: (List<Symbol, ClockingDeclAssign>,),
129}
130
131#[derive(Clone, Debug, PartialEq, Node)]
132pub struct ClockingDeclAssign {
133    pub nodes: (SignalIdentifier, Option<(Symbol, Expression)>),
134}
135
136#[derive(Clone, Debug, PartialEq, Node)]
137pub enum ClockingSkew {
138    Edge(Box<ClockingSkewEdge>),
139    DelayControl(Box<DelayControl>),
140}
141
142#[derive(Clone, Debug, PartialEq, Node)]
143pub struct ClockingSkewEdge {
144    pub nodes: (EdgeIdentifier, Option<DelayControl>),
145}
146
147#[derive(Clone, Debug, PartialEq, Node)]
148pub struct ClockingDrive {
149    pub nodes: (ClockvarExpression, Symbol, Option<CycleDelay>, Expression),
150}
151
152#[derive(Clone, Debug, PartialEq, Node)]
153pub enum CycleDelay {
154    Integral(Box<CycleDelayIntegral>),
155    Identifier(Box<CycleDelayIdentifier>),
156    Expression(Box<CycleDelayExpression>),
157}
158
159#[derive(Clone, Debug, PartialEq, Node)]
160pub struct CycleDelayIntegral {
161    pub nodes: (Symbol, IntegralNumber),
162}
163
164#[derive(Clone, Debug, PartialEq, Node)]
165pub struct CycleDelayIdentifier {
166    pub nodes: (Symbol, Identifier),
167}
168
169#[derive(Clone, Debug, PartialEq, Node)]
170pub struct CycleDelayExpression {
171    pub nodes: (Symbol, Paren<Expression>),
172}
173
174#[derive(Clone, Debug, PartialEq, Node)]
175pub struct Clockvar {
176    pub nodes: (HierarchicalIdentifier,),
177}
178
179#[derive(Clone, Debug, PartialEq, Node)]
180pub struct ClockvarExpression {
181    pub nodes: (Clockvar, Select),
182}