Module ports
Functions
- read_write_inout
Returns a pair of output/input ports to interact with an
inoutvalue.- read_write_items_inout
Returns a pair of output/input ports to interact with the items of an
inoutarray.
Entities
- new_mut_wire
Creates an standalone
invvalue.- read_mut_wire
Reads the current value of a
invvalue.
Implementations
impl<T> inv T
pub fn inspect(self) -> (T, Self)
Retrieves the contents of an inv wire alongside a copy of itself.
Most of the time port should be preferred, as it provides both directions at the same
place and those can be passed around wherever they are needed. But sometimes, passing the
forward value along through a deep hierarchy to where it is needed pollutes type signatures
for little benefit. As a practical solution, (inv T)::inspect can be used instead to tap
into an existing inv wire by connecting a new port to it, consuming it and getting both
the forward value and a fresh inv value.
Examples
let (fwd, back) = port();
let (new_fwd, new_back) = back.inspect();
set new_back = true;
assert fwd == true;
assert new_fwd == true;