Skip to content

Commit

Permalink
[difftest] add check for issue index conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed Oct 17, 2024
1 parent dd7e1e5 commit 13d71bb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
8 changes: 4 additions & 4 deletions difftest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions difftest/offline_t1emu/src/json_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ impl JsonEventRunner for SpikeRunner {
return Ok(());
}

self.commit_queue.iter().for_each(|old_se| {
assert_eq!(
old_se.issue_idx, issue.idx as u8,
"[{cycle}] Issue: new issue_idx={} ({}) should not be equal to any old event in commit_queue issue_idx={} ({}), check if the old event is retired in time",
issue.idx,
old_se.issue_idx,
se.describe_insn(),
old_se.describe_insn()
);
});

se.issue_idx = issue.idx as u8;

info!(
Expand Down
11 changes: 11 additions & 0 deletions difftest/offline_t1rocketemu/src/json_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,17 @@ impl JsonEventRunner for SpikeRunner {

se.issue_idx = idx as u8;

self.commit_queue.iter().for_each(|old_se| {
assert_eq!(
old_se.issue_idx, se.issue_idx,
"[{cycle}] Issue: new issue_idx={} ({}) should not be equal to any old event in commit_queue issue_idx={} ({}), check if the old event is retired in time",
se.issue_idx,
old_se.issue_idx,
se.describe_insn(),
old_se.describe_insn()
);
});

info!("[{cycle}] Issue: issue_idx={idx} ({})", se.describe_insn());

self.commit_queue.push_front(se);
Expand Down

0 comments on commit 13d71bb

Please sign in to comment.