Skip to content

Conversation

@klin02
Copy link
Member

@klin02 klin02 commented Nov 8, 2025

This commit introduces DiffPhyRegState and DiffArchRenameTable as new Difftest
interfaces. A new option softArchUpdate is also added (disabled by default).

By default, Difftest replaces PhyReg and RenameTable with ArchReg and CommitData
(WriteBack results) on the hardware side to keep backward compatibility.
When softArchUpdate is enabled, this substitution is deferred to the software side,
reducing hardware area overhead by avoiding extra read ports in the register files.

@klin02 klin02 force-pushed the preg branch 9 times, most recently from a7fe2a3 to d2e8d70 Compare November 11, 2025 02:28
When applying DiffTest with Palladium/FPGA, the probe of ArchReg
will double Regfile areas due to multi reads from register. This
change support replace multi-read ports with Preg and RenameTable.

Note numPregs may be larger than 256, need to adjust addr width of
renameTable later.
Filter writebacks in Preprocess and get_commit_data from phyRegs.
This change add config lazyArchUpdate for Preprocess.
When enabled, Preg and Rename will be extracted to archReg and
commitData in software; otherwise (by default) they will be replaced
in hardware.
@klin02
Copy link
Member Author

klin02 commented Nov 12, 2025

NutShell PR: OSCPU/NutShell#242
XiangShan PR: OpenXiangShan/XiangShan#5188

@Anzooooo Anzooooo self-requested a review November 12, 2025 14:18
@klin02 klin02 requested a review from poemonsense November 12, 2025 14:40
@klin02 klin02 merged commit 43a308e into master Nov 12, 2025
5 checks passed
@klin02 klin02 deleted the preg branch November 12, 2025 15:05
return
#ifdef CONFIG_DIFFTEST_INTWRITEBACK
dut->wb_int[dut->commit[i].wpdest].data;
#else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This #else is wrong. When both Int and Arch are defined, they should exist both.

See https://github.com/OpenXiangShan/difftest/actions/runs/19317148467/job/55250795228

klin02 added a commit that referenced this pull request Nov 14, 2025
In #714, we mistakenly used the phyReg index instead of the data
when generating vec_commit_data. In #724, we updated otherwpdest
for each 64-bit split vecReg.

This change correctly assigns vec_commit_data using otherwpdest
and corresponding 64-bit split vecReg indexed from PhyVecReg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants