pub struct Component {
pub name: Id,
pub signature: RRC<Cell>,
pub cells: IdList<Cell>,
pub groups: IdList<Group>,
pub comb_groups: IdList<CombGroup>,
pub continuous_assignments: Vec<Assignment>,
pub control: RRC<Control>,
pub attributes: Attributes,
/* private fields */
}
Expand description
In memory representation of a Component.
Fields
name: Id
Name of the component.
signature: RRC<Cell>
The input/output signature of this component.
cells: IdList<Cell>
The cells instantiated for this component.
groups: IdList<Group>
Groups of assignment wires.
comb_groups: IdList<CombGroup>
Groups of assignment wires.
continuous_assignments: Vec<Assignment>
The set of “continuous assignments”, i.e., assignments that are always active.
control: RRC<Control>
The control program for this component.
attributes: Attributes
Attributes for this component
Implementations
sourceimpl Component
impl Component
Builder methods for extracting and construction IR nodes. The naming scheme for methods is consistent:
- find_
: Returns a reference to the construct with the given name.
sourcepub fn new<S>(name: S, ports: Vec<PortDef<u64>>) -> Self where
S: AsRef<str>,
pub fn new<S>(name: S, ports: Vec<PortDef<u64>>) -> Self where
S: AsRef<str>,
Construct a new Component with the given name
and signature fields.
sourcepub fn find_group<S>(&self, name: &S) -> Option<RRC<Group>> where
S: Clone + AsRef<str>,
pub fn find_group<S>(&self, name: &S) -> Option<RRC<Group>> where
S: Clone + AsRef<str>,
Return a reference to the group with name
if present.
sourcepub fn find_comb_group<S>(&self, name: &S) -> Option<RRC<CombGroup>> where
S: Clone + AsRef<str>,
pub fn find_comb_group<S>(&self, name: &S) -> Option<RRC<CombGroup>> where
S: Clone + AsRef<str>,
Return a refernece to a combination group with name
if present.
sourcepub fn find_cell<S>(&self, name: &S) -> Option<RRC<Cell>> where
S: Clone + AsRef<str>,
pub fn find_cell<S>(&self, name: &S) -> Option<RRC<Cell>> where
S: Clone + AsRef<str>,
Return a reference to the cell with name
if present.
sourcepub fn generate_name<S>(&mut self, prefix: S) -> Id where
S: Into<Id> + ToString + Clone,
pub fn generate_name<S>(&mut self, prefix: S) -> Id where
S: Into<Id> + ToString + Clone,
Construct a non-conflicting name using the Component’s namegenerator.
sourcepub fn for_each_assignment<F>(&mut self, f: F) where
F: FnMut(&mut Assignment),
pub fn for_each_assignment<F>(&mut self, f: F) where
F: FnMut(&mut Assignment),
Apply function on all assignments contained within the component.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Component
impl !Send for Component
impl !Sync for Component
impl Unpin for Component
impl !UnwindSafe for Component
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more