macro_rules! structure {
($builder:expr;) => { ... };
($builder:expr;
let $var:ident = prim $comp:ident( $($n:expr),* ); $($tail:tt)*) => { ... };
($builder:expr;
let $var:pat = constant($v:expr, $w:expr); $($tail:tt)*) => { ... };
}
Expand description
Add primitives and constants to the component and let
-bind the
references.
Example:
let builder = ir::Builder::from(&mut component, &sigs, validate);
structure!(builder;
let signal_on = constant(1, 32); // Define 32-bit constant 1.
let fsm_reg = prim std_reg(32); // Define 32-bit register.
)