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
Represents sequential composition of control statements.
Fields
attributes: AttributesAttributes
Par
Represents parallel composition of control statements.
Fields
attributes: AttributesAttributes
If
Standard imperative if statement
Fields
attributes: AttributesAttributes
While
Standard imperative while statement
Fields
attributes: AttributesAttributes
Repeat
Static Repeat (essentially a bounded while loop w/o a condition)
Fields
attributes: AttributesAttributes
Enable
Runs the control for a list of subcomponents.
Invoke
Invoke component with input/output assignments.
Fields
attributes: AttributesAttributes
StaticInvoke
Invoke component with input/output assignments.
Fields
attributes: AttributesAttributes
latency: Option<NonZeroU64>(optional) latency. Latency can be inferred if not given.
Empty
Control statement that does nothing.
Fields
attributes: AttributesAttributes
StaticSeq
Represents sequential composition of static control statements.
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: AttributesAttributes
latency: Option<NonZeroU64>Optional latency for the seq
StaticPar
Represents parallel composition of static control statements.
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: AttributesAttributes
latency: Option<NonZeroU64>Optional latency for the par
StaticIf
Static if statement.
Fields
attributes: AttributesAttributes
latency: Option<NonZeroU64>Optional latency; should be the longer of the two branches
StaticRepeat
Static Repeat (essentially a bounded while loop w/o a condition)
Implementations§
Source§impl Control
impl Control
pub fn empty() -> Control
pub fn get_attributes(&self) -> &Attributes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Control
impl RefUnwindSafe for Control
impl Send for Control
impl Sync for Control
impl Unpin for Control
impl UnwindSafe for Control
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more