Skip to content

Assertion failure when force-reading a dirty register #1309

@en-sc

Description

@en-sc

Steps to reproduce:

  1. Run Spike:
> spike --rbb-port=7777 ~/openocd/boot_spike64.elf
  1. Run OpenOCD:
> cat spike.cfg
adapter driver remote_bitbang
remote_bitbang port 7777
remote_bitbang host 127.0.0.1

set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 5

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME riscv -chain-position $_TARGETNAME -rtos hwthread
> openocd \
  -f spike.cfg \
  -c init \
  -c halt \
  -c 'reg a0 0' \
  -c 'reg a0 force' \
  -c shutdown
Open On-Chip Debugger 0.12.0+dev-02029-geb01c632a (2025-11-05-14:51)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Warn : DEPRECATED: auto-selecting transport "jtag". Use 'transport select jtag' to suppress this message.
Info : [riscv.cpu] Hardware thread awareness created
Info : Initializing remote_bitbang driver
Info : Connecting to 127.0.0.1:7777
Info : remote_bitbang driver initialized
Info : Note: The adapter "remote_bitbang" doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0xdeadbeef (mfg: 0x777 (Fabric of Truth Inc), part: 0xeadb, ver: 0xd)
Info : [riscv.cpu] datacount=2 progbufsize=2
Info : [riscv.cpu] Examined RISC-V core
Info : [riscv.cpu]  XLEN=64, misa=0x800000000014112d
[riscv.cpu] Target successfully examined.
Info : [riscv.cpu] Examination succeed
Info : [riscv.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
riscv.cpu halted due to undefined.
a0 (/64): 0x0000000000000000
openocd: ocd_sources/src/target/riscv/riscv_reg_impl.h:30: riscv_reg_impl_is_initialized: Assertion `reg->valid || !reg->dirty' failed.
Aborted                    (core dumped) build/Release/src/openocd -f spike.cfg -c init -c halt -c 'reg a0 0' -c 'reg a0 force' -c shutdown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions