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>