Skip to main content

LogicHandle

Struct LogicHandle 

Source
pub struct LogicHandle { /* private fields */ }
Expand description

A value-bearing signal. Explicit get()/set() (mapping row 20 — cocotb 2.x itself moved off the .value property).

Implementations§

Source§

impl LogicHandle

Source

pub fn size(&self) -> u32

Source

pub fn get_bool(&self) -> Result<bool, ValueError>

Current boolean value, or Err if VPI does not supply it.

Source

pub fn get_u8(&self) -> Result<u8, ValueError>

Current unsigned 8-bit value, or Err if VPI does not supply it.

Source

pub fn get_u16(&self) -> Result<u16, ValueError>

Current unsigned 16-bit value, or Err if VPI does not supply it.

Source

pub fn get_u32(&self) -> Result<u32, ValueError>

Current unsigned 32-bit value, or Err if VPI does not supply it.

Source

pub fn get_u64(&self) -> Result<u64, ValueError>

Current unsigned 64-bit value, or Err if VPI does not supply it.

Source

pub fn get_u128(&self) -> Result<u128, ValueError>

Current unsigned 128-bit value, or Err if VPI does not supply it.

Source

pub fn get_bigint(&self) -> Result<BigUint, ValueError>

Current arbitrary-width unsigned value, or Err if VPI does not supply it.

Source

pub fn get_logic(&self) -> Result<LogicArray, ValueError>

Current four-state value, or Err if VPI does not supply it.

Source

pub fn get_binstr(&self) -> Result<String, ValueError>

Current four-state value formatted as an MSB-first binary string.

Source

pub fn is_high(&self) -> bool

Convenience for 1-bit signals: true iff the value is 1b1.

Source

pub fn is_low(&self) -> bool

Convenience for 1-bit signals: true iff the value is 1b0.

Source

pub fn set_bool(&self, v: bool)

Set the boolean value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_u8(&self, v: u8)

Set the unsigned 8-bit value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_u16(&self, v: u16)

Set the unsigned 16-bit value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_u32(&self, v: u32)

Set the unsigned 32-bit value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_u64(&self, v: u64)

Set the unsigned 64-bit value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_u128(&self, v: u128)

Set the unsigned 128-bit value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_bigint(&self, v: &BigUint)

Set the arbitrary-width unsigned value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_logic(&self, v: &LogicArray)

Set the four-state value to be applied at the next ReadWrite phase. The write is buffered and the last write wins, preserving order of distinct signals.

Source

pub fn set_bool_now(&self, v: bool)

Set the boolean value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_u8_now(&self, v: u8)

Set the unsigned 8-bit value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_u16_now(&self, v: u16)

Set the unsigned 16-bit value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_u32_now(&self, v: u32)

Set the unsigned 32-bit value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_u64_now(&self, v: u64)

Set the unsigned 64-bit value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_u128_now(&self, v: u128)

Set the unsigned 128-bit value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_bigint_now(&self, v: &BigUint)

Set the arbitrary-width unsigned value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Source

pub fn set_logic_now(&self, v: &LogicArray)

Set the four-state value immediately, skipping the write scheduler. The write is applied at once, but the ReadOnly rule is still enforced.

Trait Implementations§

Source§

impl Clone for LogicHandle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LogicHandle

Source§

impl Debug for LogicHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for LogicHandle

Source§

impl From<LogicHandle> for LogicHandle

Source§

fn from(raw: LogicHandle) -> Self

Converts to this type from the input type.
Source§

impl HandleBase for LogicHandle

Source§

fn name(&self) -> String

Get the name of the handle (without hierarchy)
Source§

fn full_name(&self) -> String

Get the full name of the handle (with hierarchy)
Source§

impl HandleEvent for LogicHandle

Source§

fn rising_edge(&self) -> Edge ⓘ

Get the rising edge event for this handle

Source§

fn falling_edge(&self) -> Edge ⓘ

Get the falling edge event for this handle

Source§

fn value_change(&self) -> Edge ⓘ

Get the value change event for this handle

Source§

impl PartialEq for LogicHandle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for LogicHandle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.