Skip to content

Commit 0a9203e

Browse files
authored
Fix bug in logic level calc (#95)
1 parent 934c1b9 commit 0a9203e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "safety-net"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
edition = "2024"
55
license = "MIT OR Apache-2.0"
66

src/graph.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ where
222222
return CombDepthResult::CombCycle;
223223
}
224224

225-
// Input nodes have depth 0
226-
if node.is_an_input() {
225+
// Input nodes and reg have depth 0
226+
if node.is_an_input() || node.get_instance_type().is_some_and(|inst| inst.is_seq()) {
227227
let r = CombDepthResult::Depth(0);
228228
results.insert(node.clone(), r);
229229
return r;
@@ -311,7 +311,14 @@ where
311311
}
312312

313313
for node in netlist.matches(|inst| inst.is_seq()) {
314-
results.insert(node.clone(), CombDepthResult::Depth(0));
314+
compute(
315+
node.clone(),
316+
netlist,
317+
&mut results,
318+
&mut critical_par,
319+
&mut critical_ends,
320+
&mut visiting,
321+
);
315322
for i in 0..node.get_num_input_ports() {
316323
if let Some(driver) = netlist.get_driver(node.clone(), i) {
317324
if driver.get_instance_type().is_some_and(|inst| inst.is_seq()) {

0 commit comments

Comments
 (0)