Function rust_hdl::prelude::check_all

source ·
pub fn check_all(uut: &dyn Block) -> Result<(), CheckError>
Expand description

This is a helper function used to check a Block for connection, loops, and writes to the inputs.

use rust_hdl_core::prelude::*;

#[derive(LogicBlock, Default)]
struct Circuit {
   pub in1: Signal<In, Bit>,
   pub out1: Signal<Out, Bit>,
}

impl Logic for Circuit {
   #[hdl_gen]
   fn update(&mut self) {
        self.out1.next = !self.in1.val();
   }
}

let mut uut = Circuit::default();  uut.connect_all();
assert!(check_all(&uut).is_ok());