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

ram: add gcpt-restore option for VCS #322

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

xiaokamikami
Copy link
Contributor

@xiaokamikami xiaokamikami commented Mar 22, 2024

The mobile gcpt overlay function becomes public so that it can also be used on the vcs Paladin

@xiaokamikami xiaokamikami force-pushed the gcpt_overram branch 2 times, most recently from 04ba8f0 to 69f510c Compare March 22, 2024 07:28
poemonsense
poemonsense previously approved these changes Mar 22, 2024
Copy link
Member

@poemonsense poemonsense left a comment

Choose a reason for hiding this comment

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

Format the code. Then it looks ok to me

@@ -126,6 +128,11 @@ initial begin
$value$plusargs("flash=%s", flash_bin_file);
set_flash_bin(flash_bin_file);
end
// overwrite gcpt on ram: bin file
if ($test$plusargs("gcpt")) begin
Copy link
Member

Choose a reason for hiding this comment

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

Should use the same argument name as Verilator. Use gcpt-restore instead of gcpt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@poemonsense poemonsense changed the title ram: overwrite gcpt ram: add gcpt-restore option for VCS Mar 22, 2024
@xiaokamikami xiaokamikami force-pushed the gcpt_overram branch 3 times, most recently from 63d19bd to 438b3c3 Compare March 22, 2024 08:38
delete reader;
char gcpt_restore[256];
uint64_t overwrite_nbytes = args.overwrite_nbytes;
strcpy(gcpt_restore, args.gcpt_restore);
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this strcpy?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/home/runner/work/difftest/xs-env/NutShell/difftest/src/test/csrc/common/ram.h:217:6: note: candidate function not viable: 1st argument ('const char *') would lose const qualifier
There seems to be no way to pass the args argument as a function argument

Copy link
Member

Choose a reason for hiding this comment

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

should add const to the function declaration:

void overwrite_ram(const char *gcpt_restore, uint64_t overwrite_nbytes)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thankyou

@poemonsense poemonsense merged commit b4cda2b into OpenXiangShan:master Mar 22, 2024
5 checks passed
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.

2 participants