riscv-openocd
riscv-openocd copied to clipboard
Allow various configuration options to be per-hart
Quoting Jan Matyas' feedback on http://openocd.zylin.com/#/c/5821/6/src/target/riscv/riscv.c:
I believe we should store the ebreakm, ebreaks, ..., ... and most other flags separately for each RISC-V target -- there can be more of them in the JTAG chain, each possibly with different settings.
Command "riscv
" would apply to the currently selected target. Command "<target_name> riscv
" would apply to the specified target. To get the target the command applies to inside the handler, use get_current_target(), as is already used in "dmi_read" and "dmi_write" command handlers.
IMO, these flags that should be stored separately per each target:
- riscv_ebreak*
- riscv_enable_virt2phys
- ir_*
- custom exposed csrs
- other custom exposed registers
- riscv_enable_virtual
- riscv_prefer_sba
Timeout related settings can probably be specified just globally for all RISC-V targets.
As for the BSCAN bridge options, I am not sure if these are global or per-target (not sure how BSCAN is utilized in this specific implementation).