ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

dpc

T1 riscv register register
Debug PC Register
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRISC-V Privileged (Sdext)
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
PrivilegeD
ExtensionsSdext

Summary

Upon entry to debug mode, dpc is updated with the virtual address of the next instruction to be executed.

Syntax / Encoding

CSR 0x7b1 (D-mode, RW)

Bitfields (1)

BitsFieldDescription
63:0DPCDebug PC Value [RV32: 31:0, RV64: 63:0]

Reference Notes

Upon entry to debug mode, dpc is updated with the virtual address of the next instruction to be executed.

Executing the Program Buffer may cause the value of dpc to become UNSPECIFIED. If that is the case,
it must be possible to read/write dpc using an abstract command with postexec not set. The debugger
must attempt to save dpc between halting and executing a Program Buffer, and then restore dpc before
leaving Debug Mode.

If the Access Register abstract command supports reading dpc while the hart is running, then the
value read should be the address of a recently executed instruction.

If the Access Register abstract command supports writing dpc while the hart is running, then the
executing program should jump to the written address shortly after the write occurs.

The writability of dpc follows the same rules as mepc as defined in the Privileged Spec. In particular,
dpc must be able to hold all valid virtual addresses and the writability of the low bits depends on
IALIGN.

When resuming, the hart’s PC is updated to the virtual address stored in dpc. A debugger may write
dpc to change where the hart resumes.

This CSR is read/write.