没有合适的资源?快使用搜索试试~ 我知道了~
首页riscv-debug-spec-0.11nov12 Riscv 调试文档
资源详情
资源评论
资源推荐
RISC-V External Debug Support
Version 0.11nov12
Tim Newsome <tim@sifive.com>
November 12, 2016
Warning! This draft specification will change before being ac-
cepted as standard, so implementations made to this draft specifica-
tion will likely not conform to the future standard.
Contents
1 Introduction 5
2 About This Document 5
2.1 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Register Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3.1 Long Name (shortname, at 0x123) . . . . . . . . . . . . . 6
3 Background 6
4 Supported Features 6
5 System Overview 7
6 Debug Transport Module (DTM) 9
7 Debug Module( DM) 9
7.1 Debug Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
7.2 System Bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7.3 Debug Interrupt Block . . . . . . . . . . . . . . . . . . . . . . . . 11
7.4 Halt Notification Block . . . . . . . . . . . . . . . . . . . . . . . . 11
7.5 Debug ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.6 Debug RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.7 Reset Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.8 Bus Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.9 Serial Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.10 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1
7.11 Debug Module Debug Bus Registers . . . . . . . . . . . . . . . . 14
7.11.1 Control (dmcontrol, at 0x10) . . . . . . . . . . . . . . . . 14
7.11.2 Info (dminfo, at 0x11) . . . . . . . . . . . . . . . . . . . . 16
7.11.3 Authentication Data (authdata0, at 0x12) . . . . . . . . 18
7.11.4 Authentication Data (authdata1, at 0x13) . . . . . . . . 18
7.11.5 Serial Data (serdata, at 0x14) . . . . . . . . . . . . . . . 19
7.11.6 Serial Status (serstatus, at 0x15) . . . . . . . . . . . . . 19
7.11.7 System Bus Address 31:0 (sbaddress0, at 0x16) . . . . . 20
7.11.8 System Bus Address 63:32 (sbaddress1, at 0x17) . . . . 20
7.11.9 System Bus Data 31:0 (sbdata0, at 0x18) . . . . . . . . . 20
7.11.10 System Bus Data 63:32 (sbdata1, at 0x19) . . . . . . . . 21
7.11.11 Halt Notification Summary (haltsum, at 0x1b) . . . . . . 21
7.11.12 System Bus Address 95:64 (sbaddress2, at 0x3d) . . . . 22
7.11.13 System Bus Data 95:64 (sbdata2, at 0x3e) . . . . . . . . 22
7.11.14 System Bus Data 127:96 (sbdata3, at 0x3f) . . . . . . . . 23
7.12 Debug Module System Bus Registers . . . . . . . . . . . . . . . . 23
7.12.1 Clear Debug Interrupt (cleardebint, at 0x100) . . . . . 23
7.12.2 Set Halt Notification (sethaltnot, at 0x10c) . . . . . . . 25
7.12.3 Serial Info (serinfo, at 0x110) . . . . . . . . . . . . . . . 25
7.12.4 Serial Send 0 (sersend0, at 0x200) . . . . . . . . . . . . . 25
7.12.5 Serial Receive 0 (serrecv0, at 0x204) . . . . . . . . . . . 25
7.12.6 Serial Status 0 (serstat0, at 0x208) . . . . . . . . . . . . 26
8 RISC-V Debug 26
8.1 Hart IDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.2 Debug Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.3 Debug ROM Contents . . . . . . . . . . . . . . . . . . . . . . . . 27
8.4 dret Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
8.5 Load-Reserved/Store-Conditional Instructions . . . . . . . . . . . 28
8.6 Core Debug Registers . . . . . . . . . . . . . . . . . . . . . . . . 28
8.6.1 Debug Control and Status (dcsr, at 0x7b0) . . . . . . . . 28
8.6.2 Debug PC (dpc, at 0x7b1) . . . . . . . . . . . . . . . . . . 30
8.6.3 Debug Scratch Register (dscratch, at 0x7b2) . . . . . . . 30
8.6.4 Privilege Level (priv, at virtual) . . . . . . . . . . . . . . 30
9 Trigger Module 31
9.1 Trigger Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.1.1 Trigger Select (tselect, at 0x7a0) . . . . . . . . . . . . . 31
9.1.2 Trigger Data 1 (tdata1, at 0x7a1) . . . . . . . . . . . . . 32
9.1.3 Trigger Data 2 (tdata2, at 0x7a2) . . . . . . . . . . . . . 33
9.1.4 Trigger Data 3 (tdata3, at 0x7a3) . . . . . . . . . . . . . 33
9.1.5 Match Control (mcontrol, at 0x7a1) . . . . . . . . . . . . 33
9.1.6 Instruction Count (icount, at 0x7a1) . . . . . . . . . . . 35
2
10 JTAG Debug Transport Module 37
10.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
10.2 JTAG Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
10.3 JTAG Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
10.3.1 IDCODE (00001) . . . . . . . . . . . . . . . . . . . . . . . 38
10.3.2 DTM Control (dtmcontrol, at 10000) . . . . . . . . . . . 41
10.3.3 Debug Bus Access (dbus, at 10001) . . . . . . . . . . . . 42
10.3.4 BYPASS (11111) . . . . . . . . . . . . . . . . . . . . . . . 44
A Debugger Implementation 45
A.1 Debug Bus Access . . . . . . . . . . . . . . . . . . . . . . . . . . 45
A.2 Debug RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
A.3 Main Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
A.4 Reading Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
A.5 Writing Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
A.6 Halt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
A.7 Reading Registers . . . . . . . . . . . . . . . . . . . . . . . . . . 49
A.8 Writing Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
A.9 Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
A.10 Single Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
A.11 Handling Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . 50
B Debug ROM Source 50
C Trace Module 52
C.1 Trace Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . 53
C.2 Trace Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
C.3 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
C.4 Trace Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
C.4.1 Trace (trace, at 0x728) . . . . . . . . . . . . . . . . . . . 56
C.4.2 Trace Buffer Start (tbufstart, at 0x729) . . . . . . . . . 58
C.4.3 Trace Buffer End (tbufend, at 0x72a) . . . . . . . . . . . 58
C.4.4 Trace Buffer Write (tbufwrite, at 0x72b) . . . . . . . . . 58
D Future Ideas 58
D.1 Lightweight Brainstorming . . . . . . . . . . . . . . . . . . . . . . 59
E Change Log 60
List of Figures
1 RISC-V Debug System Overview . . . . . . . . . . . . . . . . . . 8
3
List of Tables
1 Register Access Abbreviations . . . . . . . . . . . . . . . . . . . . 6
2 Debug Module Debug Bus Space . . . . . . . . . . . . . . . . . . 10
3 Debug Module System Bus Space . . . . . . . . . . . . . . . . . . 11
4 Debug Module Debug Bus Registers . . . . . . . . . . . . . . . . 14
5 Debug Module System Bus Registers . . . . . . . . . . . . . . . . 24
6 Debug ROM Contents . . . . . . . . . . . . . . . . . . . . . . . . 27
7 Core Debug Registers . . . . . . . . . . . . . . . . . . . . . . . . 28
8 Privilege Level Encoding . . . . . . . . . . . . . . . . . . . . . . . 30
9 Trigger Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
10 JTAG Connector Diagram . . . . . . . . . . . . . . . . . . . . . . 38
11 JTAG Connector Pinout . . . . . . . . . . . . . . . . . . . . . . . 39
12 JTAG TAP Registers . . . . . . . . . . . . . . . . . . . . . . . . . 40
13 Memory Read Timeline . . . . . . . . . . . . . . . . . . . . . . . 48
14 Trace Sequence Header Packets . . . . . . . . . . . . . . . . . . . 54
15 Trace Data Events . . . . . . . . . . . . . . . . . . . . . . . . . . 55
16 Trace Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4
Acknowledgments
I would like to thank the following people for their time, feedback, and ideas:
Bruce Ableidinger, Krste Asanovic, Mark Beal, Monte Dalrymple, Peter Egold,
Gajinder Panesar, Klaus Kruse Pedersen, Antony Pavlov, Ken Pettit, Megan
Wachs, Stefan Wallentowitz, Ray Van De Walker, Andrew Waterman, and Andy
Wright.
1 Introduction
Software contains bugs, and to help find these bugs it is critical to have good
debugging tools. Unless a robust OS is running on a core, with convenient
access to it (eg. over a network interface), hardware support is required to
provide visibility into what is going on in that core. This document outlines
how that support should be provided on RISC-V platforms.
2 About This Document
2.1 Structure
This document contains two parts. The main part of the document is the
specification, which is given in the numbered sections. The second part of the
document is a set of appendices. The information in the appendix is intended
to clarify and provide examples, but is not part of the actual specification.
2.2 Terminology
A platform is a single integrated circuit consisting of one or more components.
Some components may be RISC-V cores, while others may have a different
function. Typically they will all be connected to a single system bus. A single
RISC-V core contains one or more hardware threads, called harts.
2.3 Register Definitions
All register definitions in this document follow the format shown in Section 2.3.1.
A simple graphic shows which fields are in the register. The upper and lower bit
indices are shown to the top left and top right of each field. The total number
of bits in the field are shown below it.
After the graphic follows a table which for each field lists its name, de-
scription, allowed accesses, and reset value. The allowed accesses are listed in
Table 1.
5
剩余60页未读,继续阅读
ppcust
- 粉丝: 38
- 资源: 725
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- zigbee-cluster-library-specification
- JSBSim Reference Manual
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0