Skip to content

Commit

Permalink
Difftest: add lrAddr into snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustusWillisWang committed Jul 15, 2021
1 parent 67bab4f commit 99cf3c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib-include/difftest.h
Expand Up @@ -28,6 +28,7 @@ enum { DIFFTEST_TO_DUT, DIFFTEST_TO_REF };
#ifdef RV64_UARCH_SYNC
struct SyncState {
uint64_t lrscValid;
uint64_t lrscAddr;
};
#endif

Expand Down
8 changes: 7 additions & 1 deletion src/isa/riscv64/difftest/ref.c
Expand Up @@ -67,9 +67,15 @@ void isa_difftest_csrcpy(void *dut, bool direction) {
}

void isa_difftest_uarchstatus_cpy(void *dut, bool direction) {
// TODO
if (direction == DIFFTEST_TO_REF) {
struct SyncState* ms = (struct SyncState*)dut;
cpu.lr_valid = ms->lrscValid;
cpu.lr_addr = ms->lrscAddr;
} else {
struct SyncState ms;
ms.lrscValid = cpu.lr_valid;
ms.lrscAddr = cpu.lr_addr;
memcpy(dut, &ms, sizeof(struct SyncState));
}
}

Expand Down

0 comments on commit 99cf3c8

Please sign in to comment.