pub struct CalyxControl<T: CalyxControlType> { /* private fields */ }
Expand description
A wrapper around calyx_ir::Control
for scoped building.
Implementations§
Source§impl<T: CalyxControlType> CalyxControl<T>
impl<T: CalyxControlType> CalyxControl<T>
Sourcepub fn seq<F>(&mut self, f: F)
pub fn seq<F>(&mut self, f: F)
Opens a seq
context where f
is called. For instance,
fn add_seq(control: &mut CalyxControl, my_group: &CalyxGroup) {
control.seq(|s| {
s.enable(my_group);
});
}
produces the following calyx:
...
seq {
my_group;
}
...
Sourcepub fn par<F>(&mut self, f: F)
pub fn par<F>(&mut self, f: F)
Opens a par
context. See CalyxControl::seq
for details.
Sourcepub fn if_<F>(
&mut self,
port: CalyxPort,
cond: Option<CalyxCombGroup>,
true_f: F,
false_f: F,
)
pub fn if_<F>( &mut self, port: CalyxPort, cond: Option<CalyxCombGroup>, true_f: F, false_f: F, )
Opens an if
context. See CalyxControl::seq
for details.
Sourcepub fn while_<F>(&mut self, port: CalyxPort, cond: Option<CalyxCombGroup>, f: F)
pub fn while_<F>(&mut self, port: CalyxPort, cond: Option<CalyxCombGroup>, f: F)
Opens a while
context. See CalyxControl::seq
for details.
Source§impl CalyxControl<Sequential>
impl CalyxControl<Sequential>
Sourcepub fn enable_next(&mut self, group: &CalyxGroup)
pub fn enable_next(&mut self, group: &CalyxGroup)
Enables group
to run in sequence.
Sourcepub fn to_control(self) -> Control
pub fn to_control(self) -> Control
Unwraps the control builder.
Source§impl CalyxControl<Parallel>
impl CalyxControl<Parallel>
Sourcepub fn enable(&mut self, group: &CalyxGroup)
pub fn enable(&mut self, group: &CalyxGroup)
Enables group
to run in parallel.
Sourcepub fn to_control(self) -> Control
pub fn to_control(self) -> Control
Unwraps the control builder.
Trait Implementations§
Source§impl<T: CalyxControlType> Default for CalyxControl<T>
impl<T: CalyxControlType> Default for CalyxControl<T>
Auto Trait Implementations§
impl<T> Freeze for CalyxControl<T>
impl<T> !RefUnwindSafe for CalyxControl<T>
impl<T> !Send for CalyxControl<T>
impl<T> !Sync for CalyxControl<T>
impl<T> Unpin for CalyxControl<T>where
T: Unpin,
impl<T> !UnwindSafe for CalyxControl<T>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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