Trait Block

Source
pub trait Block: Logic {
    // Required methods
    fn connect_all(&mut self);
    fn update_all(&mut self);
    fn has_changed(&self) -> bool;
    fn accept(&self, name: &str, probe: &mut dyn Probe);
}
Expand description

The Block trait is required for all circuitry that can be simulated by RustHDL. If you want to be able to simulate a circuit, the corresponding struct must impl Block. Normally, this is done via the #[derive(LogicBlock)] construct, and you will rarely, if ever, need to impl the Block trait yourself.

Required Methods§

Source

fn connect_all(&mut self)

Connects the internal signals of the circuit - used to initialize the circuit

Source

fn update_all(&mut self)

Propogate changes from inputs to outputs within the circuit

Source

fn has_changed(&self) -> bool

Returns true if anything in the circuit has changed (outputs or internal state)

Source

fn accept(&self, name: &str, probe: &mut dyn Probe)

The visitor pattern - allows a circuit to be probed by a Probe struct.

Implementations on Foreign Types§

Source§

impl<B: Block> Block for Vec<B>

Source§

fn connect_all(&mut self)

Source§

fn update_all(&mut self)

Source§

fn has_changed(&self) -> bool

Source§

fn accept(&self, name: &str, probe: &mut dyn Probe)

Source§

impl<B: Block, const P: usize> Block for [B; P]

Source§

fn connect_all(&mut self)

Source§

fn update_all(&mut self)

Source§

fn has_changed(&self) -> bool

Source§

fn accept(&self, name: &str, probe: &mut dyn Probe)

Implementors§

Source§

impl<D: Direction, T: Synth> Block for Signal<D, T>

Source§

impl<T: Synth> Block for Constant<T>

Source§

impl<U: Block> Block for TopWrap<U>