-
Notifications
You must be signed in to change notification settings - Fork 327
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
target/riscv: restrict BSCAN-related commands to before-init
#1115
Conversation
Logically, BSCAN tunneling is used to establish a connection, therefore it should be set up before the communication starts (i.e. before `init`). Moreover, current implementation does not support changing `bscan_tunnel_ir_width` after `init`. This is evident by RISC-V handler of the `init` itself. Link: https://github.com/riscv-collab/riscv-openocd/blob/9a23c9e67978f77d9166102cefc7b537b714b561/src/target/riscv/riscv.c#L467-L481 Change-Id: I817c6a996f7f7171b2286e181daf1092bd358f69 Signed-off-by: Evgeniy Naydanov <[email protected]>
@Dolu1990, @GregSavin, @command-paul could you please take a look if time permits? |
The change from COMMAND_ANY to COMMAND_CONFIG looks good and correct to me. |
@en-sc The code change looks all right to me, thank you. Broader question to all participants in this thread (@Dolu1990, @GregSavin, @command-paul) - I am concerned about maintenance of this the proprietary BSCAN tunnel functionality in OpenOCD as we do not have a way to test it. If you have any suggestions in this area, that would be most welcome. |
Regarding testing, that is a fair point, and actually there are now 2 slightly different proprietary variants covered by that tunnel feature (nested TAP and tunneled DR). Presumably testable on their own respective FPGA-based environments but not on Spike. Modifications to Spike might be possible, as build-time and run-time options, but I don't know if these tunneling schemes are currently codified in RISC-V standards or drafts, so that might be a barrier for getting that approach accepted into the main Spike branch. (I used to work for one of the companies that implemented one of the BSCAN tunnel schemes on some of their FPGA images for RISC-V based systems, but now I work for a different company). |
Hi, So i would say, we don't need any hardware to test it. Simulation can be good enough. Let me know if interrested, i can setup something. |
Hello @GregSavin, @Dolu1990, Thank you for replying (and sorry for my late reaction due to being OoO). If the preference would be to go with Spike (as @GregSavin suggests), maybe a thin wrapper over Spike could be written to simulate both the BSCAN tunnel modes. Perhaps something along these lines. This way Spike could remain unmodified. The solution from @Dolu1990 to have a simulated HW with the BSCAN tunnel also sounds fine to me. |
I think the best is probably to try the spike solution first, as it would be more compliant / much faster to simulate. |
Logically, BSCAN tunneling is used to establish a connection, therefore it should be set up before the communication starts (i.e. before
init
).Moreover, current implementation does not support changing
bscan_tunnel_ir_width
afterinit
. This is evident by RISC-V handler of theinit
itself.Link:
riscv-openocd/src/target/riscv/riscv.c
Lines 467 to 481 in 9a23c9e
Change-Id: I817c6a996f7f7171b2286e181daf1092bd358f69