-
Notifications
You must be signed in to change notification settings - Fork 334
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
Incorrect work of examine() in case of halt groups #902
Comments
@timsifive, can you confirm that my reasoning is correct? |
@kr-sc I haven't yet tried to reproduce it locally. What values of Also your added LOG_INFO print in the patch is put before the dmstatus_read() call - can you check if that is maybe a typo? My expectation is that the examination should pass even if the harts are members a halt/resume group. For the examination, it is important that the given hart being examined can be halted for a brief period of time (and then resumed, if running previously). If in that process some other hart(s) get halted/resumed also (due to the halt/resume groups), that should not break the examination as such. |
I get values that differs only in
Oh, it should be after dmstatus_read(), of course.
Main problem that when we try to halt (if it's was not halted, for example) only first target during second |
Can you add |
P.S. |
@timsifive not quite. What @kr-sc says is that It's just that instead of Actually, @kr-sc was going to look at this one eventually, however since halt groups are not supported by Syntacore HW this task is not of the highest priority. This issue was filed just to document a problem. That being said - I'll double check the situation. |
Yes, but in both runs we connect to same simulator session, which targets were in |
To summarize:
I agree that's a bug. Not sure when I'll get to it. One solution might be to clear all halt groups before examining the first hart. (But examine() is called per "target" without any extra context, so it's not as straightforward as it might be.) |
Halt groups are used to implement OpenOCD smp target, so I think we should clear halt groups before OpenOCD disconnected from target. |
I think we should reset halt groups even upon initial connection. Though it makes |
I launch
spike
simulator with 4 harts:then the following script:
spike_smp4_rtoshw4.cfg
Result of the first iteration:
Result of the second iteration:
Also, if you add additional printing in file riscv-013.c in function
riscv013_get_hart_state()
, you can see thatdmstatus
values are different between two runs.If I understand it correctly, this situation is connected to how
examine()
is implemented in riscv-013.c. At the end ofexamine()
OpenOCD adds all targets to a halt group (because we have smp configuration in this case). It leads to an interesting situation: harts are halted and resumed one by one (as it should be) when examined during the first connection, but when examined during the second connection harts are already merged into a halt group. Because of that when OpenOCD tries to halt the first target, all harts become in a halted state.The text was updated successfully, but these errors were encountered: