Primitive inv
Expand
Inverted version of a type where the T and inv T fields of a non-Data/port struct are changed.
Implementations
impl<T, #uint N> [inv T; N]
fn transpose(self) -> inv [T; N]
Transposes an array of inv values into an inv array.
This transformation preserves the low level signals behind the value, but presents them in
a new format that is easier to set.
Examples
let x = port();
let y = port();
let array_of_invs: [inv bool; 2] = [x.1, y.1];
let inv_array: inv [bool; 2] = array_of_invs.transpose();
set inv_array = [true, false];
assert x.0 == true;
assert y.0 == false;impl<T> inv T
pub fn inspect(&self) -> &T
Retrieves the contents of an inv wire.
Examples
let (fwd, back) = port();
let peek = back.inspect();
set back = true;
assert *peek == true;