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

[sw,dv] Backdoor write from DV (sw_symbol_backdoor_overwrite) does not work for main SRAM #23926

Open
andreaskurth opened this issue Jul 5, 2024 · 2 comments
Labels
Component:DV DV issue: testbench, test case, etc. Component:Software Issue related to Software
Milestone

Comments

@andreaskurth
Copy link
Contributor

andreaskurth commented Jul 5, 2024

When DV code calls sw_symbol_backdoor_overwrite on a symbol that is located in main SRAM (such as a non-const global variable declared in C code), the updated value of the variable might not be visible to SW running on Ibex.

One instance of this problem caused this spinwait in the rv_dm_access_after_wakeup test to not exit

OTTF_WAIT_FOR(kSoftwareBarrier == 1, kSoftwareBarrierTimeoutUsec);

When the variable is instead located in flash, which can be achieved by qualifying a global variable as const in C code, the value written by DV code is visible to SW code running on Ibex as expected. FPGA tests, on the other hand, need a variable that can be modified by SW and thus cannot be located in flash (which is write-protected by PMP), so a separate variable is needed (see comment below).

@andreaskurth andreaskurth added Component:DV DV issue: testbench, test case, etc. Component:Software Issue related to Software labels Jul 5, 2024
@andreaskurth
Copy link
Contributor Author

Placing this in Backlog as it's not critical for any of the currently active milestones -- the workaround via flash should suffice for now.

@pamaury
Copy link
Contributor

pamaury commented Jul 5, 2024

I should point that this is the main reason why many sival tests use a different set of variables for DV and silicon: the DV ones are in flash and the silicon one in RAM. Fixing this would therefore simplify the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV DV issue: testbench, test case, etc. Component:Software Issue related to Software
Projects
None yet
Development

No branches or pull requests

2 participants