RISC-V Debug协议解读

本文详细介绍了RISC-V的调试协议,包括必须实现的特性如读写寄存器、硬件断点、单步执行等,以及可选功能如组别调试、外部触发响应等。调试流程涉及Debug Host、Debug Translator、Debug Transport Hardware和Debug Module,通过抽象命令进行内存访问和寄存器操作。同时,文章提到了Program Buffer用于执行任意指令,以及System Bus Access以绕过CPU直接访问内存。此外,文章还概述了不同调试模式和状态,以及Debug Module Registers的相关信息。

此文对RISC-V Debug协议做一个简单的介绍,具体的内容,大家可以查看协议本身内容。
https://github.com/riscv/riscv-debug-spec/blob/master/riscv-debug-stable.pdf

介绍是按目录结构进行的。

1 Introduction

  1. All hart registers (including CSRs) can be read/written.
  2. Memory can be accessed either from the hart’s point of view, through the system bus directly, or both.
  3. RV32, RV64, and future RV128 are all supported.
  4. Any hart in the hardware platform can be independently debugged.
  5. A debugger can discover almost everything it needs to know itself, without user configuration.
  6. Each hart can be debugged from the very first instruction executed.
  7. A RISC-V hart can be halted when a software breakpoint instruction is executed.
  8. Hardware single-step can execute one instruction at a time.
  9. Debug functionality is independent of the debug transport used.
  10. The debugger does not need to know anything about the microarchitecture of the harts it is debugging.
  11. Arbitrary subsets of harts can be halted and resumed simultaneously. (Optional)
  12. Arbitrary instructions can be executed on a halted hart. That means no new debug functionality is needed when a core has additional or custom instructions or state, as long as there exist programs that can move that state into GPRs. (Optional)
  13. Registers can be accessed without halting. (Optional)
  14. A running hart can be directed to execute a short sequence of instructions, with little overhead. (Optional)
  15. A system bus master allows memory access without involving any hart. (Optional)
  16. A RISC-V hart can be halted when a trigger matches the PC, read/write address/data, or an instruction opcode. (Optional)
  17. Harts can be grouped, and harts in the same group will all halt when any of them halts. These groups can also react to or notify external triggers. (Optional)

RISC-V Debug协议主要支持的特性就上面17点,有些是必须实现的,有些事可选的。

2 System Overview

系统总体框架:
在这里插入图片描述

重要的内容有:

  1. The user interacts with the Debug Host (e.g. laptop), which is running a debugger (e.g. gdb). (软件层面)
  2. The debugger communicates with a Debug Translator (e.g. OpenOCD, which may include a hardware driver) to communicate with Debug Transport Hardware (e.g. Olimex USB-JTAG adapter). (OpenOCD为软件,Olimex USB-JTAG adapter为硬件驱动)
  3. The Debug Transport Hardware connects the Debug Host to the Platform’s Debug Transport Module (DTM). (硬件底层接收模块,例如JTAG信号的接收和处理)
  4. The DTM provides access to one or more Debug Modules (DMs) using the Debug Module Interface (DMI). (接口,例如JTAG2TileLink,JTAG2AHB,一边是DTM的硬件接口,接收host的信号,一边是驱动DM模块的总线接口,驱动DM模块的总线接口由系统自行决定,可以是ABH、AXI4、TileLink或者其他简单的接口)

3 Debug Module (DM), non-ISA

评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值