OpenXiangShan / difftest

Modern co-simulation framework for RISC-V CPUs
Mulan Permissive Software License, Version 2
118 stars 66 forks source link

pc: add compare for the first instr pc of a commit group. #434

Closed NewPaulWalker closed 3 months ago

NewPaulWalker commented 3 months ago

Sometimes the dut or ref will wrongly jump to a pc, and if their reg state still match in the next instructions, this will make debugging very difficult. So I add the comparison to the pc.

klin02 commented 3 months ago

When define CONFIG_DIFFTEST_SQUASH, multi commits in a group will be squashed to a single one, which means next squashed commit[0].pc will mismatch previous REF pc.

Please add ifndef CONFIG_DIFFTEST_SQUASH when using pc_mismatch.

poemonsense commented 3 months ago

First pc of REF is copied from the DUT.

NewPaulWalker commented 3 months ago

First pc of REF is copied from the DUT.

Yes, when initializing difftest, the REF state is copied from the DUT. What this pr wants to do is to compare whether the first pc in every commit group matches.

poemonsense commented 3 months ago

First pc of REF is copied from the DUT.

Yes, when initializing difftest, the REF state is copied from the DUT. What this pr wants to do is to compare whether the first pc in every commit group matches.

I see. So the problem is that difftest is missing the comparison of pc. Right?

I remember there was the comparison. Maybe it is removed at some point.

NewPaulWalker commented 3 months ago

I see. So the problem is that difftest is missing the comparison of pc. Right?

Yes.