pub struct LogicArray { /* private fields */ }Expand description
A fixed-width vector of 4-state bits using VPI’s a_val/b_val
representation. Bit pairs encode 00=0, 10=1, 11=X, and 01=Z.
Implementations§
Source§impl LogicArray
impl LogicArray
Sourcepub fn from_vpi_words(words: &[(u32, u32)], width: usize) -> LogicArray
pub fn from_vpi_words(words: &[(u32, u32)], width: usize) -> LogicArray
Construct from VPI vector words in least-significant-word-first order.
Each tuple is (aval, bval). width preserves the exact signal width
when the final word uses fewer than 32 bits.
pub fn from_binstr(s: &str) -> LogicArray
pub fn from_bool(v: bool, width: usize) -> LogicArray
pub fn from_u8(v: u8, width: usize) -> LogicArray
pub fn from_u16(v: u16, width: usize) -> LogicArray
pub fn from_u32(v: u32, width: usize) -> LogicArray
pub fn from_u64(v: u64, width: usize) -> LogicArray
pub fn from_u128(v: u128, width: usize) -> LogicArray
pub fn from_bigint(v: &BigUint, width: usize) -> LogicArray
Sourcepub fn to_vpi_words(&self) -> Vec<(u32, u32)>
pub fn to_vpi_words(&self) -> Vec<(u32, u32)>
Return VPI vector words in least-significant-word-first order.
Each tuple is (aval, bval).
pub fn to_binstr(&self) -> String
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn is_resolvable(&self) -> bool
pub fn is_resolvable(&self) -> bool
Return true if the value is resolvable to a 2-state value (no X/Z bits).
Trait Implementations§
Source§impl Clone for LogicArray
impl Clone for LogicArray
Source§fn clone(&self) -> LogicArray
fn clone(&self) -> LogicArray
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogicArray
impl Debug for LogicArray
Source§impl Display for LogicArray
impl Display for LogicArray
impl Eq for LogicArray
Source§impl Index<usize> for LogicArray
Access bits least-significant-bit first, returning None out of bounds.
impl Index<usize> for LogicArray
Access bits least-significant-bit first, returning None out of bounds.
Source§impl PartialEq for LogicArray
impl PartialEq for LogicArray
impl StructuralPartialEq for LogicArray
Source§impl TryFrom<&LogicArray> for BigUint
impl TryFrom<&LogicArray> for BigUint
Source§type Error = ValueError
type Error = ValueError
The type returned in the event of a conversion error.
Source§fn try_from(v: &LogicArray) -> Result<BigUint, ValueError>
fn try_from(v: &LogicArray) -> Result<BigUint, ValueError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for LogicArray
impl RefUnwindSafe for LogicArray
impl Send for LogicArray
impl Sync for LogicArray
impl Unpin for LogicArray
impl UnsafeUnpin for LogicArray
impl UnwindSafe for LogicArray
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