1use safety_net::{Gate, Netlist, dont_touch_filter};
2
3fn and_gate() -> Gate {
4 Gate::new_logical("AND".into(), vec!["A".into(), "B".into()], "Y".into())
5}
6
7fn main() {
8 let netlist = Netlist::new("example".to_string());
9
10 let a = netlist.insert_input("a".into());
12 let b = netlist.insert_input("b".into());
13
14 let instance = netlist
16 .insert_gate(and_gate(), "inst_0".into(), &[a, b])
17 .unwrap();
18
19 instance.set_attribute("dont_touch".to_string());
21 instance.expose_with_name("y".into());
22
23 for nr in dont_touch_filter(&netlist) {
24 println!("Don't touch: {nr}");
25 }
26}