4/29/2020
Godson 3A1000 Processor User Manual
113
Page 140
Godson 3A1000 Processor User Manual Part 2
13 EJTAG debugging
13.1 Introduction to EJTAG
EJTAG (Enhanced JTAG) is defined by MIPS according to the basic structure and function extension of IEEE1149.1 protocol
The specification is a hardware / software subsystem used to support on-chip debugging. The EJTAG specification defines a new type of debugging
Modes, including dedicated instructions, operating modes, and address space, are well integrated with the original MIPS architecture
together. The basic idea of the debug mode is to adopt an exception handling mechanism, so that the software being debugged cannot detect the existence of the debugger.
In addition, the processor expands the address space in debug mode, and can access the debug control register and map to the
Debug interface for storage area. The following figure shows the composition of a common EJTAG debugging system, including:
♦ Debug Host: Run the debug application and control the EJTAG cable
♦ Target Board: the board containing the debugged chip, providing EJTAG interface
Debug host
EJTAG cable
Commissioning service
OS / BIOS
APP
Target board
Figure 13-1 EJTAG debugging system
The debug host can use the EJTAG line to put the processor on the target board into debug mode and turn to execute the debug service
Cheng. There are two entrances to the debug service, which are located at 0xbfc00480 in the BIOS and at the EJTAG debug memory interface.
0xff200200 of the port is selected by the debugging host.
The EJTAG specification draws two blocks in the debug mode address space of the processor and maps them to the debug control register (drseg)
And debug memory interface (dmseg). When the processor executes the debugging service to access the debugging interface, the memory access request will be blocked
Plugged in the debug interface. At this time, the debugging host can detect the memory access request of the debugging memory interface and respond to it.
Simply put, the debug service program can access a section of memory space located on the debug host.
Using the debugging memory space controlled by the debugging host, the debugging service can complete almost any conceivable function, because
The code for the debugging service program itself can be provided by the debugging host (currently not available in the samples of Godson 3A1000 and 2G
Get instructions from dmseg, but can execute memory access instructions).
128
Page 141
Godson 3A1000 Processor User Manual Part 2
Godson 3A1000 / 2G also supports the PC sampling function of the EJTAG specification.
13.2 Use of EJTAG tools
13.2.1
Environmental preparation
♦ EJTAG cable, parallel port to 14-pin EJTAG port
♦ Linux debugging host with parallel port, with root authority