pub struct CompileStatic { /* private fields */ }
Expand description
Compiles Static Islands
Implementations§
Source§impl CompileStatic
impl CompileStatic
Sourcepub fn get_coloring(
&self,
tree_objects: &Vec<Node>,
sgroups: &[RRC<StaticGroup>],
control: &mut Control,
) -> HashMap<Id, Id>
pub fn get_coloring( &self, tree_objects: &Vec<Node>, sgroups: &[RRC<StaticGroup>], control: &mut Control, ) -> HashMap<Id, Id>
Creates a graph (one node per item in sgroup
where nodes are the sgroup
’s
names).
Use tree_objects
and control
to draw conflicts between any two nodes
that could be executing in parallel, and returns a greedy coloring of the
graph.
Trait Implementations§
Source§impl ConstructVisitor for CompileStatic
impl ConstructVisitor for CompileStatic
Source§fn from(ctx: &Context) -> CalyxResult<Self>
fn from(ctx: &Context) -> CalyxResult<Self>
Source§fn clear_data(&mut self)
fn clear_data(&mut self)
fn get_opts(ctx: &Context) -> LinkedHashMap<&'static str, ParseVal>where
Self: Named,
Source§impl Named for CompileStatic
impl Named for CompileStatic
Source§impl Visitor for CompileStatic
impl Visitor for CompileStatic
Source§fn start_static_control(
&mut self,
sc: &mut StaticControl,
comp: &mut Component,
sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_static_control( &mut self, sc: &mut StaticControl, comp: &mut Component, sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Executed after visiting the children of a [ir::Static] node.
Source§fn start_while(
&mut self,
s: &mut While,
comp: &mut Component,
sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_while( &mut self, s: &mut While, comp: &mut Component, sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
If while body is static, then we want to make sure that the while
body does not take the extra cycle incurred by the done condition
So we replace the while loop with enable
of a wrapper group
that sets the go signal of the static group in the while loop body high
(all static control should be compiled into static groups by
static_inliner
now). The done signal of the wrapper group should be
the condition that the fsm of the while body is %0 and the port signal
is 1’d0.
For example, we replace
wires {
static group A<1> {
...
}
...
}
control {
while l.out {
A;
}
}
with
wires {
group early_reset_A {
...
}
group while_wrapper_early_reset_A {
early_reset_A[go] = 1'd1;
while_wrapper_early_reset_A[done] = !l.out & fsm.out == 1'd0 ? 1'd1;
}
}
control {
while_wrapper_early_reset_A;
}
Source§fn start(
&mut self,
comp: &mut Component,
sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start( &mut self, comp: &mut Component, sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish(
&mut self,
comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish( &mut self, comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn precondition(_ctx: &Context) -> Option<String>where
Self: Sized,
fn precondition(_ctx: &Context) -> Option<String>where
Self: Sized,
Source§fn start_context(&mut self, _ctx: &mut Context) -> VisResult
fn start_context(&mut self, _ctx: &mut Context) -> VisResult
ir::Context
before visiting the components.Source§fn finish_context(&mut self, _ctx: &mut Context) -> VisResult
fn finish_context(&mut self, _ctx: &mut Context) -> VisResult
ir::Context
after visiting the components.Source§fn iteration_order() -> Orderwhere
Self: Sized,
fn iteration_order() -> Orderwhere
Self: Sized,
Source§fn traverse_component(
&mut self,
comp: &mut Component,
signatures: &LibrarySignatures,
components: &[Component],
) -> CalyxResult<()>where
Self: Sized,
fn traverse_component(
&mut self,
comp: &mut Component,
signatures: &LibrarySignatures,
components: &[Component],
) -> CalyxResult<()>where
Self: Sized,
Source§fn do_pass(&mut self, context: &mut Context) -> CalyxResult<()>
fn do_pass(&mut self, context: &mut Context) -> CalyxResult<()>
ir::Context
.
The function mutably borrows the control
program in each component and
traverses it. Read moreSource§fn do_pass_default(context: &mut Context) -> CalyxResult<Self>
fn do_pass_default(context: &mut Context) -> CalyxResult<Self>
Source§fn start_seq(
&mut self,
_s: &mut Seq,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_seq( &mut self, _s: &mut Seq, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_seq(
&mut self,
_s: &mut Seq,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_seq( &mut self, _s: &mut Seq, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn start_par(
&mut self,
_s: &mut Par,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_par( &mut self, _s: &mut Par, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_par(
&mut self,
_s: &mut Par,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_par( &mut self, _s: &mut Par, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn start_if(
&mut self,
_s: &mut If,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_if( &mut self, _s: &mut If, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_if(
&mut self,
_s: &mut If,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_if( &mut self, _s: &mut If, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_while(
&mut self,
_s: &mut While,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_while( &mut self, _s: &mut While, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn start_repeat(
&mut self,
_s: &mut Repeat,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_repeat( &mut self, _s: &mut Repeat, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_repeat(
&mut self,
_s: &mut Repeat,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_repeat( &mut self, _s: &mut Repeat, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_static_control(
&mut self,
_s: &mut StaticControl,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_static_control( &mut self, _s: &mut StaticControl, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn enable(
&mut self,
_s: &mut Enable,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn enable( &mut self, _s: &mut Enable, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn static_enable(
&mut self,
_s: &mut StaticEnable,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn static_enable( &mut self, _s: &mut StaticEnable, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn start_static_if(
&mut self,
_s: &mut StaticIf,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_static_if( &mut self, _s: &mut StaticIf, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_static_if(
&mut self,
_s: &mut StaticIf,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_static_if( &mut self, _s: &mut StaticIf, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn start_static_repeat(
&mut self,
_s: &mut StaticRepeat,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn start_static_repeat( &mut self, _s: &mut StaticRepeat, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn finish_static_repeat(
&mut self,
_s: &mut StaticRepeat,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn finish_static_repeat( &mut self, _s: &mut StaticRepeat, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
fn start_static_seq( &mut self, _s: &mut StaticSeq, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
fn finish_static_seq( &mut self, _s: &mut StaticSeq, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
fn start_static_par( &mut self, _s: &mut StaticPar, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
fn finish_static_par( &mut self, _s: &mut StaticPar, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn invoke(
&mut self,
_s: &mut Invoke,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn invoke( &mut self, _s: &mut Invoke, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Source§fn static_invoke(
&mut self,
_s: &mut StaticInvoke,
_comp: &mut Component,
_sigs: &LibrarySignatures,
_comps: &[Component],
) -> VisResult
fn static_invoke( &mut self, _s: &mut StaticInvoke, _comp: &mut Component, _sigs: &LibrarySignatures, _comps: &[Component], ) -> VisResult
Auto Trait Implementations§
impl Freeze for CompileStatic
impl !RefUnwindSafe for CompileStatic
impl !Send for CompileStatic
impl !Sync for CompileStatic
impl Unpin for CompileStatic
impl !UnwindSafe for CompileStatic
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