Enum calyx_frontend::ast::Control
source · [−]pub enum Control {
Show 13 variants
Seq {
stmts: Vec<Control>,
attributes: Attributes,
},
Par {
stmts: Vec<Control>,
attributes: Attributes,
},
If {
port: Port,
cond: Option<Id>,
tbranch: Box<Control>,
fbranch: Box<Control>,
attributes: Attributes,
},
While {
port: Port,
cond: Option<Id>,
body: Box<Control>,
attributes: Attributes,
},
Repeat {
num_repeats: u64,
body: Box<Control>,
attributes: Attributes,
},
Enable {
comp: Id,
attributes: Attributes,
},
Invoke {
comp: Id,
inputs: Vec<(Id, Atom)>,
outputs: Vec<(Id, Atom)>,
attributes: Attributes,
comb_group: Option<Id>,
ref_cells: Vec<(Id, Id)>,
},
StaticInvoke {
comp: Id,
inputs: Vec<(Id, Atom)>,
outputs: Vec<(Id, Atom)>,
attributes: Attributes,
ref_cells: Vec<(Id, Id)>,
comb_group: Option<Id>,
latency: Option<NonZeroU64>,
},
Empty {
attributes: Attributes,
},
StaticSeq {
stmts: Vec<Control>,
attributes: Attributes,
latency: Option<NonZeroU64>,
},
StaticPar {
stmts: Vec<Control>,
attributes: Attributes,
latency: Option<NonZeroU64>,
},
StaticIf {
port: Port,
tbranch: Box<Control>,
fbranch: Box<Control>,
attributes: Attributes,
latency: Option<NonZeroU64>,
},
StaticRepeat {
num_repeats: u64,
body: Box<Control>,
attributes: Attributes,
},
}
Expand description
Control AST nodes. Since enables and static enables are indistinguishable to the AST, there is single Control Enum for both Static and Dynamic Control
Variants
Seq
Fields
attributes: Attributes
Attributes
Represents sequential composition of control statements.
Par
Fields
attributes: Attributes
Attributes
Represents parallel composition of control statements.
If
Standard imperative if statement
While
Standard imperative while statement
Repeat
Static Repeat (essentially a bounded while loop w/o a condition)
Enable
Runs the control for a list of subcomponents.
Invoke
Invoke component with input/output assignments.
StaticInvoke
Fields
comp: Id
Name of the component to be invoked.
attributes: Attributes
Attributes
latency: Option<NonZeroU64>
(optional) latency. Latency can be inferred if not given.
Invoke component with input/output assignments.
Empty
Fields
attributes: Attributes
Attributes
Control statement that does nothing.
StaticSeq
Fields
stmts: Vec<Control>
List of Control
statements to run in sequence.
If not all of these stmts are static, we should error out
attributes: Attributes
Attributes
latency: Option<NonZeroU64>
Optional latency for the seq
Represents sequential composition of static control statements.
StaticPar
Fields
stmts: Vec<Control>
List of Control
statements to run in sequence.
If not all of these stmts are static, we should error out
attributes: Attributes
Attributes
latency: Option<NonZeroU64>
Optional latency for the par
Represents parallel composition of static control statements.
StaticIf
Fields
port: Port
Port that connects the conditional check.
attributes: Attributes
Attributes
latency: Option<NonZeroU64>
Optional latency; should be the longer of the two branches
Static if statement.
StaticRepeat
Static Repeat (essentially a bounded while loop w/o a condition)