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: 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.
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: Attributes
Attributes for this component
is_comb: bool
True iff component is combinational
latency: Option<NonZeroU64>
(Optional) latency of component, if it is static
Implementations§
Source§impl Component
Builder methods for extracting and construction IR nodes.
The naming scheme for methods is consistent:
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>,
) -> Self
pub fn new<S>( name: S, ports: Vec<PortDef<u64>>, has_interface: bool, is_comb: bool, latency: Option<NonZeroU64>, ) -> Self
Construct a new Component with the given name
and ports.
- If
has_interface
is true, then we do not add@go
and@done
ports. This will usually happen with the component is marked with [super::BoolAttr::Nointerface]. - If
is_comb
is set, then this is a combinational component and cannot usegroup
orcontrol
constructs. - If
latency
is 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>>
pub fn find_group<S>(&self, name: S) -> Option<RRC<Group>>
Return a reference to the group with name
if present.
Sourcepub fn find_static_group<S>(&self, name: S) -> Option<RRC<StaticGroup>>
pub fn find_static_group<S>(&self, name: S) -> Option<RRC<StaticGroup>>
Return a reference to the group with name
if present.
Sourcepub fn find_comb_group<S>(&self, name: S) -> Option<RRC<CombGroup>>
pub fn find_comb_group<S>(&self, name: S) -> Option<RRC<CombGroup>>
Return a refernece to a combination group with name
if present.
Sourcepub fn find_cell<S>(&self, name: S) -> Option<RRC<Cell>>
pub fn find_cell<S>(&self, name: S) -> Option<RRC<Cell>>
Return a reference to the cell with name
if present.
Sourcepub fn find_guaranteed_cell<S>(&self, name: S) -> RRC<Cell>
pub fn find_guaranteed_cell<S>(&self, name: S) -> RRC<Cell>
Return a reference to the cell with name
if present.
Sourcepub fn generate_name<S>(&mut self, prefix: S) -> Id
pub fn generate_name<S>(&mut self, prefix: S) -> Id
Construct a non-conflicting name using the Component’s namegenerator.
Sourcepub fn is_structural(&self) -> bool
pub fn is_structural(&self) -> bool
Check whether this component is purely structural, i.e. has no groups or control
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)
pub fn for_each_static_assignment<F>(&mut self, f: F)
Apply function to all assignments within static groups.
Sourcepub fn for_each_assignment<F>(&mut self, f: F)
pub fn for_each_assignment<F>(&mut self, f: F)
Apply function on all non-static assignments contained within the component.
Sourcepub fn iter_assignments<F>(&self, f: F)
pub fn iter_assignments<F>(&self, f: F)
Iterate over all non-static assignments contained within the component.
Sourcepub fn iter_static_assignments<F>(&self, f: F)
pub fn iter_static_assignments<F>(&self, f: F)
Iterate over all static assignments contained within the component
Trait Implementations§
Source§impl GetMemInfo for Component
impl GetMemInfo for Component
fn get_mem_info(&self) -> Vec<MemInfo>
Auto Trait Implementations§
impl Freeze for Component
impl !RefUnwindSafe for Component
impl !Send for Component
impl !Sync for Component
impl Unpin for Component
impl !UnwindSafe for Component
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more