pub struct Port {
pub name: Id,
pub width: u64,
pub direction: Direction,
pub parent: PortParent,
pub attributes: Attributes,
}Expand description
Represents a port on a cell.
Fields§
§name: IdName of the port
width: u64Width of the port
direction: DirectionDirection of the port
parent: PortParentWeak pointer to this port’s parent
attributes: AttributesAttributes associated with this port.
Implementations§
Source§impl Port
impl Port
Sourcepub fn cell_parent(&self) -> RRC<Cell>
pub fn cell_parent(&self) -> RRC<Cell>
Sourcepub fn is_constant(&self, val: u64, width: u64) -> bool
pub fn is_constant(&self, val: u64, width: u64) -> bool
Checks if this port is a constant of value: val.
Sourcepub fn get_parent_name(&self) -> Id
pub fn get_parent_name(&self) -> Id
Gets name of parent object.
Sourcepub fn parent_is_comb(&self) -> bool
pub fn parent_is_comb(&self) -> bool
Checks if parent is combinational component
Sourcepub fn parent_is_protected(&self) -> bool
pub fn parent_is_protected(&self) -> bool
Checks if parent is a protected cell
Sourcepub fn parent_is_fsm(&self) -> bool
pub fn parent_is_fsm(&self) -> bool
Checks if the parent is an FSM. Assignments to these always need to be maintained.
Sourcepub fn get_attribute<A>(&self, attr: A) -> Option<u64>
pub fn get_attribute<A>(&self, attr: A) -> Option<u64>
Returns the value of an attribute if present
Sourcepub fn has_attribute<A>(&self, attr: A) -> bool
pub fn has_attribute<A>(&self, attr: A) -> bool
Returns true if the node has a specific attribute
Sourcepub fn type_equivalent(&self, other: &Port) -> bool
pub fn type_equivalent(&self, other: &Port) -> bool
Returns true if the widths, name, direction, and attributes of 2 ports match.
This is different than == equivalence, which only looks at parent and name.
Trait Implementations§
Source§impl GetAttributes for Port
impl GetAttributes for Port
Source§fn get_attributes(&self) -> &Attributes
fn get_attributes(&self) -> &Attributes
Returns an
Attributes instanceSource§fn get_mut_attributes(&mut self) -> &mut Attributes
fn get_mut_attributes(&mut self) -> &mut Attributes
Returns a mutable
Attributes instanceimpl Eq for Port
Auto Trait Implementations§
impl Freeze for Port
impl !RefUnwindSafe for Port
impl !Send for Port
impl !Sync for Port
impl Unpin for Port
impl !UnwindSafe for Port
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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