Struct libreda_sta::models::clock_tag::ClockId
source · pub struct ClockId { /* private fields */ }Expand description
Compact ID for marking signals with a clock.
Identifier for clocks, generated clocks, propagated clocks, inverted clocks, etc. This struct is a wrapper around a 32-bit integer. It is used as an efficient marker to associate nets with a clock source.
Implementations§
source§impl ClockId
impl ClockId
sourcepub fn new(storage_index: u32) -> Self
pub fn new(storage_index: u32) -> Self
Create a new clock ID from the index of the clock. The index is a ‘pointer’ to the specification of the clock. The ID is used to annotate signals in order to link them to a clock source. The ID does not only store this index but also keeps track of other properties such as on which clock events the signal can change.
sourcepub fn storage_index(&self) -> usize
pub fn storage_index(&self) -> usize
Get the index into the array of clocks. Points to the detailed description of the corresponding clock.
sourcepub fn is_inverted(&self) -> bool
pub fn is_inverted(&self) -> bool
Check if this ID refers to an inverted version of the clock.
sourcepub fn is_clock(&self) -> bool
pub fn is_clock(&self) -> bool
Test if this signal is marked as a clock signal. This flag gets cleared when a clock signal passes through a clock input of a sequential cell to a data output.
sourcepub fn set_clock(&mut self, is_clock: bool)
pub fn set_clock(&mut self, is_clock: bool)
Define if this signal is a clock or just a clocked signal otherwise.
sourcepub fn is_sensitive_on_edge(&self, edge_type: RiseFall) -> bool
pub fn is_sensitive_on_edge(&self, edge_type: RiseFall) -> bool
For actual signals: Test if the signal can change on the given edge type of the associated clock. For required signals: Test if the constraint applies to the given edge type of the associated clock.
sourcepub fn set_edge_sensitivity(&mut self, edge_type: RiseFall, can_change: bool)
pub fn set_edge_sensitivity(&mut self, edge_type: RiseFall, can_change: bool)
For actual signals: Define if the signal annotated with this ID can change on the given clock edge.
Trait Implementations§
source§impl Ord for ClockId
impl Ord for ClockId
source§impl PartialEq for ClockId
impl PartialEq for ClockId
source§impl PartialOrd for ClockId
impl PartialOrd for ClockId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Copy for ClockId
impl Eq for ClockId
impl StructuralPartialEq for ClockId
Auto Trait Implementations§
impl Freeze for ClockId
impl RefUnwindSafe for ClockId
impl Send for ClockId
impl Sync for ClockId
impl Unpin for ClockId
impl UnwindSafe for ClockId
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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>
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