Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(override flash): support override flash from dut #75

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

xyyy1420
Copy link

Once NEMU supports writing checkpoints to flash, we need to synchronize the content to spike through this interface

Signed-off-by: jiaxiaoyu <xyyy1420@gmail.com>
Copy link

@shinezyy shinezyy left a comment

Choose a reason for hiding this comment

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

lgtm

@xyyy1420 xyyy1420 merged commit 0fa6cee into difftest Dec 25, 2024
3 checks passed
@@ -638,8 +643,8 @@ void debug_mem_sync(reg_t addr, void* buf, size_t n) {
ref->debug_memcpy_from_dut(addr, buf, n);
}

void difftest_load_flash(void *flash_bin, size_t size) {

void difftest_load_flash(const uint8_t *flash_bin, size_t size) {
Copy link
Member

Choose a reason for hiding this comment

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

According to NEMU (https://github.com/OpenXiangShan/NEMU/blob/master/src/cpu/difftest/ref.c#L104-L109) and DiffTest (https://github.com/OpenXiangShan/difftest/blob/master/src/test/csrc/difftest/difftest.cpp#L596), this void *flash_bin is a char * pointer to the flash file instead of a pointer to the memory contents.

I agree that an API with pointer to the flash contents is better. However, this change breaks our code in NEMU and DiffTest. Can you use this Spike version to diff with NEMU?

I would like to add a difftest_load_flash_v2 for the new API.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry it was an oversight on my part, this interface is not used in NEMU, I'm adding implementations for both sides (NEMU and spike)

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.

3 participants