Debugging server and debugging system and debugging method of multi-core processor

By designing a debugging server and multiple GDB listening threads, the coordinated debugging of heterogeneous multi-core processors is realized, solving the problems of poor debugging complexity and compatibility in the existing technology, providing more accurate debugging results and flexible debugging control.

CN118885381APending Publication Date: 2024-11-01XIAN MICROELECTRONICS TECH INST
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410862678.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The prior art is difficult to realize the collaborative debugging of heterogeneous multi-core processors in a single chip, and there are problems such as complex debugging programs and poor compatibility.

Method used

A debugging server is designed, including the main thread and multiple GDB listening threads, used to listen for the communication port of heterogeneous multi-core GDB, receive commands and convert them into custom JTAG protocol packages, send requests to the emulator, and parse the processing results. Realize collaborative debugging and unified control of multiple processor cores.

Benefits of technology

It realizes collaborative debugging of multiple processor cores in a single chip, reduces the difference between program debugging state and running state, provides more accurate debugging results, and allows switching debugging control between different processor cores, supporting resources Access, code debugging, and kernel control commands.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885381A_ABST
    Figure CN118885381A_ABST
Patent Text Reader

Abstract

The invention discloses a debugging server, and a debugging system and a debugging method of a multi-core processor. The system comprises a debugging host, a simulator and a heterogeneous multi-core target board, the debugging host comprises a heterogeneous multi-core GDB and a debugging server; the heterogeneous multi-core GDB is used for sending an RSP protocol packet and a debugging command and realizing conversion from an RSP protocol to a self-defined JTAG protocol; the debugging server receives the RSP protocol packet and the debugging command, sends a debugging request to the emulator, receives a processing result returned by the emulator, analyzes the processing result, assembles a response frame and sends the response frame to the heterogeneous multi-core GDB; the simulator sends a self-defined JTAG protocol packet and a command to the heterogeneous multi-core target board according to the debugging request, and returns a processing result to the debugging server; and the heterogeneous multi-core target board returns a processing result to the simulator. The problems that in the prior art, a heterogeneous multi-core processor does not use debugging software, software development and debugging work cannot be smoothly carried out, and the technical problems that a debugging program is complex, compatibility is poor and the like exist are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of embedded system applications and relates to a debugging server, a debugging system and a debugging method for a multi-core processor. Background Art

[0002] With the rapid development of computer hardware and the improvement of user application requirements, embedded systems based on heterogeneous multi-core processors have been widely used in embedded systems due to their advantages such as high performance and low power consumption. While heterogeneous multi-core processor chips improve computer computing speed, they also bring huge challenges to multi-core system debugging.

[0003] Currently, most of the research on debuggers is still limited to single-core, and most manufacturers directly use platform system debugging development tools when developing applications. Therefore, the management of core operating functions, memory, and peripheral resources of heterogeneous multi-core processors, and the difficulty in implementing coordinated debugging of multiple processor cores in a single chip are all problems faced by today's heterogeneous multi-core systems, and there are technical problems such as complex program calls and poor compatibility.

[0004] To this end, the above technical problems need to be solved. Summary of the invention

[0005] The present invention provides a debugging server, a debugging system and a debugging method for a multi-core processor, so as to solve the problems faced by the heterogeneous multi-core processors in the prior art, such as the lack of debugging software, the inability to smoothly carry out software development and debugging work, as well as the technical problems of complex debugging programs and poor compatibility.

[0006] The present invention adopts the following technical solutions:

[0007] The present invention provides a debugging server, comprising: a main thread, a plurality of GDB listening threads;

[0008] The main thread is used to initialize the debugging server, complete link detection, and create multiple GDB listening threads;

[0009] The GDB listening thread is used to listen to the communication port of the heterogeneous multi-core GDB, receive the commands sent by the heterogeneous multi-core GDB, trigger the processing of the corresponding type of commands in the command module, and feed back the output results of the debugging server to the heterogeneous multi-core GDB.

[0010] Optionally, the debugging server supports command types including: resource access class, code debugging class, and core control class.

[0011] The present invention also provides a debugging system for a multi-core processor, comprising the above-mentioned debugging server, specifically comprising: a debugging host, an emulator, and a heterogeneous multi-core target board;

[0012] The debug host runs heterogeneous multi-core GDB and debug server;

[0013] Heterogeneous multi-core GDB, used to send debugging commands in RSP protocol packet format;

[0014] The debugging server is used to receive the debugging commands sent by the heterogeneous multi-core GDB, parse the debugging commands in the RSP protocol package format and convert them into commands in the custom JTAG protocol package format, and send debugging requests to the emulator. At the same time, it receives the processing results returned by the emulator, parses the processing results, assembles the response frame and sends it to the heterogeneous multi-core GDB;

[0015] The simulator is used to send custom JTAG protocol packets and commands to the heterogeneous multi-core target board according to the debugging request, and return the processing results to the debugging server;

[0016] The heterogeneous multi-core target board returns the processing results to the simulator.

[0017] Optionally, each of the multiple GDB listening threads corresponds to a processing core, and the number of created GDB listening threads is consistent with the number of processor cores.

[0018] Optionally, the communication interface between the debugging server and the heterogeneous multi-core GDB is a TCP / IP network communication interface, and the communication interface between the debugging server and the emulator is a USB transmission interface.

[0019] Optionally, the custom JTAG protocol packet includes a 2-byte frame header and an even-byte data frame, wherein the 2-bit EMU in the frame header selects the JTAG debug link, the 1-bit IR / DR selects access to the instruction register or data register of the TAP controller, and the remaining 13 bits represent the total number of bits of the JTAG frame.

[0020] Optionally, the data frame of the custom JTAG protocol packet is composed of several bytes of data to be shifted in by tdi. If the data to be shifted in is less than 2 bytes, USB transmission is performed as 2 bytes.

[0021] Optionally, the heterogeneous multi-core target board adopts a heterogeneous multi-core processor.

[0022] Optionally, a custom JTAG protocol supports master-slave core switching.

[0023] The present invention also provides a debugging method for a debugging server of a heterogeneous multi-core processor. Based on any one of the debugging systems of the multi-core processor in the above embodiments, the method comprises:

[0024] Heterogeneous multi-core GDB, used to send debugging commands in RSP protocol packet format;

[0025] The debugging server receives the debugging commands sent by the heterogeneous multi-core GDB, parses the debugging commands in the RSP protocol package format into commands in the custom JTAG protocol package format, sends debugging requests to the emulator, and receives the processing results returned by the emulator, parses the processing results, assembles the response frame and sends it to the heterogeneous multi-core GDB;

[0026] The emulator sends a custom JTAG protocol packet and command to the heterogeneous multi-core target board according to the debugging request, and returns the processing result to the debugging server;

[0027] The heterogeneous multi-core target board returns the processing results to the simulator.

[0028] The beneficial effects of the present invention are:

[0029] The debugging server designed by the present invention realizes remote debugging for heterogeneous multi-core processors, effectively helping chip developers and users locate problems in chip design and application development;

[0030] By making the multiple GDB listening threads in the debugging server correspond one-to-one with the processing cores, it is possible to achieve collaborative debugging of multiple processor cores in a single chip, and to uniformly control and manage all processor cores, thereby reducing the difference between the program debugging state and the running state and providing more accurate debugging results. In addition, independent programs can be uploaded to each processor core, and the debugging control right can be switched between different processor cores, completing the debugging function without affecting the debugging or running of other cores. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of a debugging system for a multi-core processor provided by the present invention;

[0032] Figure 2 A schematic diagram of a debugging server design framework provided by the present invention;

[0033] Figure 3 A schematic diagram of a custom JTAG protocol frame structure provided by the present invention;

[0034] Figure 4 A schematic diagram of an extended instruction register structure provided by the present invention;

[0035] Figure 5 A LCDSP1602 development board and simulator provided by the present invention;

[0036] Figure 6 The present invention provides an integrated development environment debugging interface. DETAILED DESCRIPTION

[0037] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0038] In the description of the embodiments of the present invention, it should be noted that if the terms "upper", "lower", "horizontal", "inner", etc. indicate an orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of the invention is usually placed when in use, it is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0039] In addition, if the term "horizontal" appears, it does not mean that the component must be absolutely horizontal, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", which does not mean that the structure must be completely horizontal, but can be slightly tilted.

[0040] In the description of the embodiments of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0041] It should be noted that the purpose of the present invention is mainly to solve the problem that the heterogeneous multi-core processors produced have no debugging software and cannot smoothly carry out software development and debugging. The existing commercial debugging software on the market is only for a single processor type and cannot be applied to self-developed heterogeneous processors.

[0042] The present invention has been used to implement a variety of self-developed heterogeneous multi-core processor debuggers in practical applications. The debugger tool can be used to troubleshoot hardware defects and many difficult-to-explore hardware and software problems. The invention can be applied to processor application development, making it convenient for users to use and locate problems. Debugging is a key link in the chip design and application development process. Effective testing and debugging methods can ensure the correctness of chip functions. Therefore, research on debugging technology has important engineering value and practical significance.

[0043] The present invention also provides a debugging server comprising: a main thread, a plurality of GDB listening threads;

[0044] The main thread is used to initialize the debugging server, complete link detection, and create multiple GDB listening threads;

[0045] GDB listening thread, used to listen to the communication port of heterogeneous multi-core GDB, receive commands sent by heterogeneous multi-core GDB, trigger the processing of corresponding type commands of the command module, and feed back the output results of the debugging server to heterogeneous multi-core GDB;

[0046] The debugging server also includes a command processing module that parses various debugging commands issued by GDB, converts them into custom JTAG commands, and sends debugging requests to the emulator.

[0047] In one embodiment, the present invention provides a debugging server, such as Figure 1 As shown, the debugging server adopts a multi-threading solution to achieve collaborative debugging of multiple processor cores in a single chip, and the internal remote debugging server software includes a main thread and multiple GDB listening threads.

[0048] Main thread: mainly includes initialization module, thread creation module and input command processing module. The initialization module mainly detects the link, configures parameters and initializes the processor. The thread creation module creates multiple GDB listening threads, and the number of created threads is consistent with the number of processor cores. The input command processing module allows the debugging server to operate the target board independently without GDB.

[0049] GDB listening thread: This thread is used to listen to the GDB communication port, receive commands sent by GDB, and feed back the output results of the debugging server to GDB. In heterogeneous multi-core debugging, multiple listening threads can be started to listen to different GDB communication ports. Each listening thread controls a processor core, and finally realizes the one-to-one binding of GDB-listening thread-processor core, realizing multi-core debugging control.

[0050] It should be noted that the debugging server designed by the present invention has the following functions:

[0051] The GDB server is mainly used to receive the RSP protocol packets sent by the heterogeneous multi-core GDB, and send the output results received and processed by this software to the heterogeneous multi-core GDB.

[0052] The conversion between RSP protocol and custom JTAG protocol frame mainly realizes the conversion from RSP protocol to custom JTAG protocol.

[0053] Custom JTAG protocol frame sending and receiving is mainly used to send custom JTAG protocol frames to the emulator, and to receive the output results sent by the emulator to this software.

[0054] Control of heterogeneous multi-core debugging commands. The debugging server should be able to distinguish the processor type and commands for different cores, and correctly send and receive replies from each core.

[0055] Optionally, each of the multiple GDB listening threads corresponds to a processing core, and the number of created GDB listening threads is consistent with the number of processor cores.

[0056] It should be noted that the debugging server designed in the present invention is oriented to domestic heterogeneous multi-core processors, laying a foundation for the development of domestic processor tool chains and the productization and practical application of independent instruction set chips.

[0057] Optionally, the debugging server supports command types including: resource access class, code debugging class, and core control class.

[0058] In one embodiment, the debugging server needs to implement the conversion and sending of the following three types of commands. The debugging server needs to support the command types shown in Table 1:

[0059] Table 1 Command types that the debugging server needs to support

[0060]

[0061] The present invention provides a debugging system for a multi-core processor, such as Figure 2 As shown, it includes: debugging host, emulator, heterogeneous multi-core target board;

[0062] The debug host runs heterogeneous multi-core GDB and debug server;

[0063] Heterogeneous multi-core GDB, used to send debugging commands in RSP protocol packet format;

[0064] The debugging server is used to receive the debugging commands sent by the heterogeneous multi-core GDB, parse the debugging commands in the RSP protocol package format and convert them into commands in the custom JTAG protocol package format, and send debugging requests to the emulator. At the same time, it receives the processing results returned by the emulator, parses the processing results, assembles the response frame and sends it to the heterogeneous multi-core GDB;

[0065] The simulator is used to send custom JTAG protocol packets and commands to the heterogeneous multi-core target board according to the debugging request, and return the processing results to the debugging server;

[0066] The heterogeneous multi-core target board returns the processing results to the simulator.

[0067] In one embodiment, it should be noted that the debugging server used in the present system embodiment is the above-mentioned debugging server. Figure 2As shown, the debugging host in the debugging system of the multi-core processor provided by the present invention is a PC, which is used to run the heterogeneous multi-core GDB (open source debugger) of the corresponding processor and many debugging events in the debugging process of the debugging server designed by the present invention, such as: reading and writing registers, reading and writing memory, single stepping, running, stopping, etc.

[0068] The processing flow of these debugging events is basically the same, and the execution process is roughly as follows: heterogeneous multi-core GDB sends commands to the debugging server -> the debugging server analyzes the commands and sends debugging requests to the emulator -> the emulator processes the debugging requests and sends JTAG commands to the target board -> the target board returns the processing results to the emulator -> the emulator returns the processing results to the debugging server -> the debugging server analyzes the results and assembles the response frame to feed back to the heterogeneous multi-core GDB. It should be noted that this system can manage and operate multi-core processors with a single chip for both heterogeneous and non-heterogeneous processors.

[0069] Optionally, the communication interface between the debugging server and the heterogeneous multi-core GDB is a TCP / IP network communication interface, and the communication interface between the debugging server and the emulator is a USB transmission interface.

[0070] Optionally, the custom JTAG protocol packet includes a 2-byte frame header and an even-byte data frame, wherein the 2-bit EMU in the frame header selects the JTAG debug link, the 1-bit IR / DR selects access to the instruction register or data register of the TAP controller, and the remaining 13 bits represent the total number of bits of the JTAG frame.

[0071] Optionally, the data frame of the custom JTAG protocol packet is composed of several bytes of data to be shifted in by tdi. If the data to be shifted in is less than 2 bytes, USB transmission is performed as 2 bytes.

[0072] In one embodiment, the communication interface between the debugging server and GDB designed by the present invention is a TCP / IP network communication interface, the communication protocol is a TCP / IP communication protocol, and the transmission content is an RSP protocol frame. The communication interface between the debugging server and the self-developed emulator is a USB transmission interface, the communication protocol is a USB communication protocol, and the transmission content is a custom JTAG protocol frame.

[0073] The present invention proposes a custom JTAG protocol to achieve access to a heterogeneous multi-core target board. The custom JTAG protocol defines the JTAG debug chain selection bit, debug command type bit, debug command length bit and JTAG debug command. The specific format is as follows: Figure 3 shown.

[0074] The custom JTAG frame contains a 2-byte frame header and an even-numbered byte data frame. The 2-bit EMU in the frame header selects the JTAG debug link, the 1-bit IR / DR selects the instruction register or data register of the TAP controller, and the remaining 13 bits represent the total number of bits in the JTAG frame. The data frame consists of several bytes of data to be shifted in by tdi. If the data to be shifted in is less than 2 bytes, it will be transmitted over USB as 2 bytes.

[0075] It should be noted that a debugging system for a multi-core processor proposed in the present invention can provide the following multi-core debugging functions:

[0076] (1) Realize the coordinated debugging of multiple processor cores in a single chip. All processor cores can be controlled and managed uniformly, such as allowing them to continue running to a breakpoint or stop running at the same time; unified control and management ensures synchronization between processor cores, reduces differences in program debugging states, and provides more accurate debugging results;

[0077] (2) Ability to upload independent programs to each processor core and complete basic debugging functions without affecting the debugging or operation of other cores, such as inserting breakpoints, deleting breakpoints, single-step running, viewing registers, viewing memory, viewing variables, etc.;

[0078] (3) Debug control can be switched between different processor cores.

[0079] Optionally, the heterogeneous multi-core target board adopts a heterogeneous multi-core processor.

[0080] Optionally, the custom JTAG protocol supports master-slave core switching.

[0081] In a specific embodiment, the present invention redefines the meaning of the instruction register bit field by extending the instruction register, and combines it with the custom JTAG protocol. The custom JTAG protocol defines a heterogeneous access method. For example, a heterogeneous multi-core processor provides a set of JTAG links to the outside world, and realizes the master-slave core switching by extending the instruction registers of PPC and DSP. Taking the self-developed chip LCDSP1602 as an example, it is a heterogeneous multi-core high-performance processor for image processing and intelligent computing. It integrates 2 PowerPC master cores and 16 RISC-V 32IF compatible DSP slave core switching. The effective bit width of the original ppc instruction register is 4 bits, and RISCV is 5 bits. The ID bit field is added to expand the instruction register to 7 bits. Figure 4 As shown, the content of the ID bit field can distinguish the PPC processor and the RISCV processor, and the remaining bits are framed according to the original PPC and RISCV instruction encoding to achieve heterogeneous access.

[0082] Specifically, the three-bit ID bit field can select the PPC core, and the two-bit ID bit field can select the DSP. For example, the last two bits are 11, which represents dsp. The distinction between the 16 cores is based on the different base addresses of each core, which is reflected in the composed custom jtag frame.

[0083] The last three digits are 100 or 101, which means it is core 0 or core 1 of PPC.

[0084] It should be noted that the heterogeneous multi-core processor designed by the present invention realizes the coordinated debugging of multiple processor cores in a single chip, and can uniformly control and manage all processor cores, reduce the difference between program debugging state and running state, and provide more accurate debugging results; based on the ID bit, the corresponding processing core is selected, and an independent program can be uploaded to each processor core. The debugging control right can be switched between different processor cores, and the debugging function is completed without affecting the debugging or operation of other cores.

[0085] The present invention also provides a debugging method for a debugging server of a heterogeneous multi-core processor, based on any one of the above-mentioned debugging systems of the multi-core processor, the method comprising:

[0086] Heterogeneous multi-core GDB sends debugging commands in RSP protocol packet format;

[0087] The debugging server receives the debugging commands sent by the heterogeneous multi-core GDB, parses the debugging commands in the RSP protocol package format into commands in the custom JTAG protocol package format, sends debugging requests to the emulator, and receives the processing results returned by the emulator, parses the processing results, assembles the response frame and sends it to the heterogeneous multi-core GDB;

[0088] The emulator sends a custom JTAG protocol packet and command to the heterogeneous multi-core target board according to the debugging request, and returns the processing result to the debugging server;

[0089] The heterogeneous multi-core target board returns the processing results to the simulator.

[0090] It should be noted that the debugging method for a debugging server for a heterogeneous multi-core processor provided by the present invention is consistent with the remote debugging method that can be implemented by the debugging system for the multi-core processor mentioned above, and will not be described in detail here.

[0091] It should be noted that, based on the debugging method for the debugging server for heterogeneous multi-core processors proposed in the present invention, specific experiments were conducted:

[0092] The debugging server design method proposed in the present invention has been verified on the produced chips LCDSP1602, LSP0201RH, and Revealer1601p, and has performed well. Figure 5The LCDSP1602 development board and emulator produced by the company. The debugging server software has been integrated into the development environment for use. Figure 6 It is the debugging interface in the integrated development environment. Figure 6 In the debugger, the information in the multi-core debug management window, variables, registers, memory windows, disassembly window, debug server console and other windows are all obtained through the debug server.

Claims

1. A debugging server, characterized in that: include: One main thread and multiple GDB monitoring threads; The main thread is used to initialize the debugging server to complete link detection and create multiple GDB listening threads; The GDB listening thread is used to listen to the communication port of the heterogeneous multi-core GDB, receive the command sent by the heterogeneous multi-core GDB, trigger the processing of the corresponding type of command of the command module, and feed back the output result of the debugging server to the heterogeneous multi-core.

2. A debugging server as claimed in claim 1, characterized in that: The debugging server supports command types including: resource access type, code debugging type, and core control type.

3. A debugging system for a multi-core processor, characterized in that: A debugging server comprising the above-mentioned claim 1 or 2, specifically comprising: a debugging host, an emulator, and a heterogeneous multi-core target board; The debugging host runs heterogeneous multi-core GDB and a debugging server; The heterogeneous multi-core GDB is used to send debugging commands in the RSP protocol packet format; The debugging server is used to receive the debugging command sent by the heterogeneous multi-core GDB, parse and convert the debugging command in the RSP protocol packet format into a command in the custom JTAG protocol packet format, and send a debugging request to the emulator, and at the same time receive the processing result returned by the emulator, parse the processing result, assemble a response frame and send it to the heterogeneous multi-core GDB; The simulator is used to send a custom JTAG protocol packet and a command to the heterogeneous multi-core target board according to the debugging request, and return the processing result to the debugging server; The heterogeneous multi-core target board returns the processing result to the simulator.

4. A debugging system for a multi-core processor as claimed in claim 3, characterized in that: Each of the multiple GDB listening threads corresponds to a processing core, and the number of the created GDB listening threads is consistent with the number of processor cores.

5. A debugging system for a multi-core processor as claimed in claim 3, characterized in that: The communication interface between the debugging server and the heterogeneous multi-core GDB is a TCP / IP network communication interface, and the communication interface between the debugging server and the emulator is a USB transmission interface.

6. A debugging system for a multi-core processor as claimed in claim 3, characterized in that: The custom JTAG protocol packet contains a 2-byte frame header and an even-byte data frame. The 2-bit EMU in the frame header selects the JTAG debug link, the 1-bit IR / DR selects access to the instruction register or data register of the TAP controller, and the remaining 13 bits represent the total number of bits in the JTAG frame.

7. A debugging system for a multi-core processor as claimed in claim 6, characterized in that: The data frame of the custom JTAG protocol packet is composed of several bytes of data to be shifted in by tdi. If the data to be shifted in is less than 2 bytes, USB transmission is performed as 2 bytes.

8. A debugging system for a multi-core processor as claimed in claim 3, characterized in that: The heterogeneous multi-core target board adopts a heterogeneous multi-core processor.

9. A debugging system for a multi-core processor as claimed in claim 8, characterized in that: The custom JTAG protocol supports master-slave core switching.

10. A debugging method for a debugging server of a heterogeneous multi-core processor, based on a debugging system for a multi-core processor according to any one of claims 3 to 9, characterized in that: The method includes: Heterogeneous multi-core GDB, used to send debugging commands in RSP protocol packet format; The debugging server receives the debugging command sent by the heterogeneous multi-core GDB, parses the debugging command in the RSP protocol packet format into a command in the custom JTAG protocol packet format, sends a debugging request to the emulator, and receives the processing result returned by the emulator, parses the processing result, assembles a response frame and sends it to the heterogeneous multi-core GDB; The simulator sends a custom JTAG protocol packet and a command to the heterogeneous multi-core target board according to the debugging request, and returns the processing result to the debugging server; The heterogeneous multi-core target board returns the processing result to the simulator.

Citation Information

Cited By

  • Invasive debugging method, electronic equipment, readable medium and program product

    CN121880117A