pub struct Component {
pub name: Id,
pub signature: RRC<Cell>,
pub cells: IdList<Cell>,
pub groups: IdList<Group>,
pub static_groups: IdList<StaticGroup>,
pub comb_groups: IdList<CombGroup>,
pub continuous_assignments: Vec<Assignment<Nothing>>,
pub control: RRC<Control>,
pub attributes: Attributes,
pub is_comb: bool,
pub latency: Option<NonZeroU64>,
/* private fields */
}Expand description
In memory representation of a Component.
Fields§
§name: IdName 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.
static_groups: IdList<StaticGroup>Groups of assignment wires
comb_groups: IdList<CombGroup>Groups of assignment wires.
continuous_assignments: Vec<Assignment<Nothing>>The set of “continuous assignments”, i.e., assignments that are always active.
control: RRC<Control>The control program for this component.
attributes: AttributesAttributes for this component
is_comb: boolTrue iff component is combinational
latency: Option<NonZeroU64>(Optional) latency of component, if it is static
Implementations§
source§impl 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>>,
has_interface: bool,
is_comb: bool,
latency: Option<NonZeroU64>
) -> Selfwhere
S: Into<Id>,
pub fn new<S>( name: S, ports: Vec<PortDef<u64>>, has_interface: bool, is_comb: bool, latency: Option<NonZeroU64> ) -> Selfwhere S: Into<Id>,
Construct a new Component with the given name and ports.
- If
has_interfaceis true, then we do not add@goand@doneports. This will usually happen with the component is marked with [super::BoolAttr::Nointerface]. - If
is_combis set, then this is a combinational component and cannot usegrouporcontrolconstructs. - If
latencyis set, then this is a static component with the given latency. A combinational component cannot have a latency.
sourcepub fn get_groups(&self) -> &IdList<Group>
pub fn get_groups(&self) -> &IdList<Group>
gets the component’s groups
sourcepub fn get_static_groups(&self) -> &IdList<StaticGroup>
pub fn get_static_groups(&self) -> &IdList<StaticGroup>
gets the component’s static groups
sourcepub fn get_groups_mut(&mut self) -> &mut IdList<Group>
pub fn get_groups_mut(&mut self) -> &mut IdList<Group>
gets the component’s groups
sourcepub fn get_static_groups_mut(&mut self) -> &mut IdList<StaticGroup>
pub fn get_static_groups_mut(&mut self) -> &mut IdList<StaticGroup>
gets the component’s groups
sourcepub fn set_groups(&mut self, groups: IdList<Group>)
pub fn set_groups(&mut self, groups: IdList<Group>)
gets the component’s groups
sourcepub fn set_static_groups(&mut self, static_groups: IdList<StaticGroup>)
pub fn set_static_groups(&mut self, static_groups: IdList<StaticGroup>)
gets the component’s groups
sourcepub fn find_group<S>(&self, name: S) -> Option<RRC<Group>>where
S: Into<Id>,
pub fn find_group<S>(&self, name: S) -> Option<RRC<Group>>where S: Into<Id>,
Return a reference to the group with name if present.
sourcepub fn find_static_group<S>(&self, name: S) -> Option<RRC<StaticGroup>>where
S: Into<Id>,
pub fn find_static_group<S>(&self, name: S) -> Option<RRC<StaticGroup>>where S: Into<Id>,
Return a reference to the group with name if present.
sourcepub fn find_comb_group<S>(&self, name: S) -> Option<RRC<CombGroup>>where
S: Into<Id>,
pub fn find_comb_group<S>(&self, name: S) -> Option<RRC<CombGroup>>where S: Into<Id>,
Return a refernece to a combination group with name if present.
sourcepub fn find_cell<S>(&self, name: S) -> Option<RRC<Cell>>where
S: Into<Id>,
pub fn find_cell<S>(&self, name: S) -> Option<RRC<Cell>>where S: Into<Id>,
Return a reference to the cell with name if present.
sourcepub fn generate_name<S>(&mut self, prefix: S) -> Idwhere
S: Into<Id>,
pub fn generate_name<S>(&mut self, prefix: S) -> Idwhere S: Into<Id>,
Construct a non-conflicting name using the Component’s namegenerator.
sourcepub fn is_static(&self) -> bool
pub fn is_static(&self) -> bool
Check whether this is a static component. A static component is a component which has a latency field.
sourcepub fn for_each_static_assignment<F>(&mut self, f: F)where
F: FnMut(&mut Assignment<StaticTiming>),
pub fn for_each_static_assignment<F>(&mut self, f: F)where F: FnMut(&mut Assignment<StaticTiming>),
Apply function to all assignments within static groups.
sourcepub fn for_each_assignment<F>(&mut self, f: F)where
F: FnMut(&mut Assignment<Nothing>),
pub fn for_each_assignment<F>(&mut self, f: F)where F: FnMut(&mut Assignment<Nothing>),
Apply function on all non-static assignments contained within the component.
sourcepub fn iter_assignments<F>(&self, f: F)where
F: FnMut(&Assignment<Nothing>),
pub fn iter_assignments<F>(&self, f: F)where F: FnMut(&Assignment<Nothing>),
Iterate over all non-static assignments contained within the component.
sourcepub fn iter_static_assignments<F>(&self, f: F)where
F: FnMut(&Assignment<StaticTiming>),
pub fn iter_static_assignments<F>(&self, f: F)where F: FnMut(&Assignment<StaticTiming>),
Iterate over all static assignments contained within the component