Skip to content

Commit

Permalink
synth: fix again when to step
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Dec 13, 2023
1 parent 8ec61f7 commit 5c750ee
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions synth/src/testbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,18 @@ impl Testbench {
assert!(conf.start < last_step_plus_one);

for step_id in conf.start..last_step_plus_one {
// if this is not the first step, we need to advance the simulation
if step_id > conf.start {
sim.step();
}

let range = self.step_range(step_id);
self.do_step(
step_id as StepInt,
sim,
&self.data[range],
&mut failures,
verbose,
step_id + 1 == last_step_plus_one,
);
// early exit
if !failures.is_empty() && conf.stop.at_first_fail {
Expand All @@ -208,7 +212,6 @@ impl Testbench {
words: &[Word],
failures: &mut Vec<Failure>,
verbose: bool,
is_last: bool,
) {
// apply inputs
let mut offset = 0;
Expand Down Expand Up @@ -263,11 +266,6 @@ impl Testbench {
}
offset += io.words;
}

if !is_last {
// advance the simulation
sim.step();
}
}

pub fn apply_constraints(
Expand Down

0 comments on commit 5c750ee

Please sign in to comment.