[[risc-v-debug]]
= The RISC-V Debug Specification
:description: RISC-V Debug Specification
:company: RISC-V.org
:authors: Editors: Paul Donahue <pdonahue@ventanamicro.com>, Ventana Micro Systems, Tim Newsome <tim@sifive.com>, SiFive, Inc.
:revdate: Revised 20231107
:revnumber: 20231107
//:revremark: Pre-release version
:url-riscv: http://riscv.org
:doctype: book
:colophon:
:pdf-theme: ./docs-resources/themes/riscv-pdf.yml
:pdf-fontsdir: ./docs-resources/fonts/
:preface-title: Preface
:appendix-caption: Appendix
:imagesdir: ./docs-resources/images
:title-logo-image: image:risc-v_logo.png[pdfwidth=3.25in,align=center]
//:page-background-image: image:draft.png[opacity=20%]
//:title-page-background-image: none
//:back-cover-image: image:backpage.png[opacity=25%]
//:back-cover-image: image:riscv-horizontal-color.svg[opacity=25%]
// Settings:
:experimental:
:reproducible:
:imagesoutdir: ./docs-resources/images
//:bibtex-file: ../docs-resources/resources/riscv-spec.bib
//:bibtex-order: alphabetical
//:bibtex-style: apa
//:bibtex-format: asciidoc
//:bibtex-throw: false
:icons: font
:lang: en
:listing-caption: Example
:toc: left
:toclevels: 4 
:sectnums:
:sectnumlevels: 4
:source-highlighter: pygments
ifdef::backend-pdf[]
:source-highlighter: rouge
endif::[]
:table-caption: Table
:figure-caption: Figure
:xrefstyle: short 
:chapter-refsig: Chapter
:section-refsig: Section
:appendix-refsig: Appendix
:data-uri:
:hide-uri-scheme:
:stem: latexmath
:footnote:

[WARNING]
====
This stable specification might change before being accepted as standard. We're trying to only make backwards-compatible changes, but sometimes it's unavoidable to change a corner case. If you implement this document, please keep an eye on https://github.com/riscv/riscv-debug-spec[the github repository] for changes that might affect your implementation.
====

Contributors to all versions of the spec in alphabetical order (please
contact editors to suggest corrections): Bruce Ableidinger, Krste
Asanović, Peter Ashenden, Allen Baum, Mark Beal, Alex Bradbury, Chuanhua
Chang, Yen Hao Chen, Zhong-Ho Chen, Monte Dalrymple, Paul Donahue,
Vyacheslav Dyachenko, Ernie Edgar, Peter Egold, Marc Gauthier, Markus
Goehrle, Robert Golla, John Hauser, Richard Herveille, Yung-ching Hsiao,
Po-wei Huang, Scott Johnson, L. J. Madar, Grigorios Magklis, Daniel
Mangum, Alexis Marquet, Jan Matyas, Kai Meinhard, Jean-Luc Nagel, Aram
Nahidipour, Rishiyur Nikhil, Gajinder Panesar, Deepak Panwar, Antony
Pavlov, Klaus Kruse Pedersen, Ken Pettit, Darius Rad, Joe Rahmeh, Josh
Scheid, Vedvyas Shanbhogue, Gavin Stark, Ben Staveley, Wesley Terpstra,
Tommy Thorn, Megan Wachs, Jan-Willem van de Waerdt, Philipp Wagner,
Stefan Wallentowitz, Ray Van De Walker, Andrew Waterman, Thomas Wicki,
Andy Wright, Bryan Wyatt, and Florian Zaruba.

_This document is released under a Creative Commons Attribution 4.0 International License._

// Include macros for registers and fields
include::build/abstract_commands-def.adoc[]
include::build/core_registers-def.adoc[]
include::build/dm_registers-def.adoc[]
include::build/hwbp_registers-def.adoc[]
include::build/jtag_registers-def.adoc[]
include::build/sample_registers-def.adoc[]
include::build/sw_registers-def.adoc[]

// Manual macros
:hartsel: <<hartsel,hartsel>>
:keepalive: <<keepalive,keepalive>>

include::introduction.adoc[]
include::overview.adoc[]
include::debug_module.adoc[]
include::Sdext.adoc[]
include::Sdtrig.adoc[]
include::dtm.adoc[]
include::implementations.adoc[]
include::debugger_implementation.adoc[]
//include::future.adoc[]
//include::index.adoc[]
//include::bibliography.adoc[]

[index]
== Index
