[−][src]Struct kaze::Instance
An instance of a Module, created by the Module::instance method.
Examples
use kaze::*; let c = Context::new(); // Inner module (simple pass-through) let inner = c.module("Inner"); inner.output("o", inner.input("i", 32)); // Outer module (wraps a single `Inner` instance) let outer = c.module("Outer"); let inner_inst = outer.instance("inner_inst", "Inner"); inner_inst.drive_input("i", outer.input("i", 32)); outer.output("o", inner_inst.output("o"));
Implementations
impl<'a> Instance<'a>[src]
pub fn drive_input<S: Into<String>>(&'a self, name: S, i: &'a Signal<'a>)[src]
Drives the input of this Module Instance specified by name with the given Signal.
Panics
Panics if i is from a different Module than self, if name specifies an input that doesn't exist on this Instance's Module, if this input is already driven on this Instance, or if i's bit width differs from that of the input.
Examples
use kaze::*; let c = Context::new(); let inner = c.module("Inner"); inner.output("o", inner.input("i", 32)); let outer = c.module("Outer"); let inner_inst = outer.instance("inner_inst", "Inner"); // Drive inner_inst's "i" input with a 32-bit literal inner_inst.drive_input("i", outer.lit(0xfadebabeu32, 32));
pub fn output<S: Into<String>>(&'a self, name: S) -> &Signal<'a>[src]
Creates a Signal that represents this Instance's output called name.
Panics
Panics if name specifies an output that doesn't exist on this Instance's Module.
Examples
use kaze::*; let c = Context::new(); let inner = c.module("Inner"); inner.output("o", inner.lit(true, 1)); let outer = c.module("Outer"); let inner_inst = outer.instance("inner_inst", "Inner"); // Forward inner_inst's "o" output to a new output on outer with the same name outer.output("o", inner_inst.output("o"));
Trait Implementations
impl<'a> Eq for &'a Instance<'a>[src]
impl<'a> Hash for &'a Instance<'a>[src]
pub fn hash<H: Hasher>(&self, state: &mut H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'a> PartialEq<&'a Instance<'a>> for &'a Instance<'a>[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Instance<'a>[src]
impl<'a> !Send for Instance<'a>[src]
impl<'a> !Sync for Instance<'a>[src]
impl<'a> Unpin for Instance<'a>[src]
impl<'a> !UnwindSafe for Instance<'a>[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,