pub struct CompileStatic { /* private fields */ }
Expand description

Compiles Static Islands

Implementations

Trait Implementations

Construct the visitor using information from the Context
Clear the data stored in the visitor. Called before traversing the next component by [ir::traversal::Visitor]. Read more
The name of a pass. Is used for identifying passes.
A short description of the pass.
Set of options that can be passed to the pass. The options contains a tuple of the option name and a description. Read more

Executed after visiting the children of a [ir::Static] node.

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;
  }
Executed before the traversal begins.
Executed after the traversal ends. This method is always invoked regardless of the Action returned from the children. Read more
Precondition for this pass to run on the program. If this function returns None, the pass triggers. Otherwise it aborts and logs the string as the reason. Read more
Transform the ir::Context before visiting the components.
Transform the ir::Context after visiting the components.
Define the iteration order in which components should be visited
Define the traversal over a component. Calls Visitor::start, visits each control node, and finally calls Visitor::finish. Read more
Run the visitor on a given program ir::Context. The function mutably borrows the control program in each component and traverses it. Read more
Build a Default implementation of this pass and call Visitor::do_pass using it. Read more
Executed before visiting the children of a ir::Seq node.
Executed after visiting the children of a ir::Seq node.
Executed before visiting the children of a ir::Par node.
Executed after visiting the children of a ir::Par node.
Executed before visiting the children of a ir::If node.
Executed after visiting the children of a ir::If node.
Executed after visiting the children of a ir::While node.
Executed before visiting the children of a ir::Repeat node.
Executed after visiting the children of a ir::Repeat node.
Executed after visiting the conetnts of an ir::StaticControl node.
Executed at an ir::Enable node.
Executed at an ir::StaticEnable node.
Executed before visiting the children of a ir::StaticIf node.
Executed after visiting the children of a ir::StaticIf node.
Executed before visiting the children of a ir::StaticRepeat node.
Executed after visiting the children of a ir::StaticRepeat node.
Executed at an ir::Invoke node.
Executed at a ir::StaticInvoke node.
Executed at an ir::Empty node.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.