pub struct Builder<'a> {
    pub component: &'a mut Component,
    /* private fields */
}
Expand description

IR builder. Uses internal references to the component to construct and validate constructs when needed. By default, assumes that the cells are being added by a pass and marks them with the @generated attribute.

In order to disable this behavior, call [ir::Builder::not_generated()].

Fields

component: &'a mut Component

Component for which this builder is constructing.

Implementations

Instantiate a new builder using for a component.

Enable the validation flag on a builder.

Disable the generated flag on the builder

Construct a new group and add it to the Component. The group is guaranteed to start with prefix. Returns a reference to the group.

Construct a new static group and add it to the Component. The group is guaranteed to start with prefix. Returns a reference to the group.

Construct a combinational group

Return reference for a constant cell associated with the (val, width) pair, building and adding it to the component if needed.. If the constant does not exist, it is added to the Context.

Consturcts a primitive cell of type primitive. The name of the cell is guaranteed to start with prefix. Adds this cell to the underlying component and returns a reference to the Cell.

For example:

// Construct a std_reg.
builder.add_primitive("fsm", "std_reg", vec![32]);

Result variant of [ir::Builder::add_primitive()].

Add a component instance to this component using its name and port signature.

Construct an assignment.

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.