Heterogeneous nuclear burning debugging system, method and equipment, storage medium and product
Through the heterogeneous nuclear firing and debugging system, the problem of synchronous software writing and debugging on heterogeneous processor cores in mimicry MCUs is solved, and the consistency of synchronous firing and debugging on heterogeneous cores is achieved, simplifying the development process.
Patent Information
- Application Number
- CN202411369884.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
AI Technical Summary
In the software development process of mimicry MCUs, how to write and debug software code simultaneously on multiple heterogeneous processor cores is a technical problem. The existing technology cannot guarantee the synchronization of instruction and the consistency of execution results.
Provide a heterogeneous nuclear burning debugging system, including a burning module and a debugging module. The burning module obtains heterogeneous core information through a scanning processor, establishes a connection, and copies and distributes the program to be burned according to the number of cores; debugging module management Code file, execute user debugging instructions, and analyze debugging results to ensure the consistency of synchronous writing and debugging on multiple heterogeneous cores.
It realizes program writing and debugging synchronized on multiple heterogeneous processor cores, ensures the synchronization of the write program and the consistency of debugging code instructions, simplifies the debugging interaction process, and frees developers from complicated multi-core synchronization. Command line debugging is in configuration.
Smart Images

Figure CN119311552A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of software technology, and in particular to a heterogeneous core burning and debugging system, method, device, storage medium and product. Background Art
[0002] Mimetic MCU combines mimetic technology with microcontroller units (MCU). Mimetic technology mainly involves cyberspace mimetic defense, which enhances the security and reliability of the system by introducing multiple heterogeneous redundant components and modules. MCU, or microcontroller unit, is a programmable integrated circuit that integrates a central processing unit, memory, input / output interface, etc., and is widely used in the control of various electronic and mechanical equipment.
[0003] In the software development process of mimetic MCU, a good source code level debugging tool plays an irreplaceable role for software developers. However, due to the particularity of mimetic MCU, it is necessary to integrate multiple heterogeneous processor cores. How to enable software programs to be burned synchronously on multiple heterogeneous processor cores and how to synchronously debug and run the same software code instructions on multiple heterogeneous processor cores are technical difficulties and challenges in the field of mimetic MCU debugging.
[0004] In the prior art, the solution for flashing and debugging on multiple heterogeneous processor cores is to quickly input debugging instructions in different GDB command line debugging windows, and then quickly switch to another to perform the same operation steps. However, since the execution speed of the program is very fast, this method cannot ensure the synchronization of instructions between the pseudo-heterogeneous processor cores, and also cannot ensure whether the execution results are correct and consistent. Summary of the invention
[0005] The present invention provides a heterogeneous core burning and debugging system, method, device, storage medium and product to realize synchronous program burning and debugging of multiple heterogeneous cores of a mimetic MCU.
[0006] According to one aspect of the present invention, a heterogeneous core burning and debugging system is provided, the system comprising a burning module and a debugging module;
[0007] The burning module includes a burning management unit and a unified burning unit, wherein the burning management unit is used to scan the processor to obtain heterogeneous core information and establish a corresponding connection for each heterogeneous core; the unified burning unit is used to obtain the program to be burned, copy the program to be burned according to the number of the heterogeneous cores, and distribute it to each of the heterogeneous cores for burning at the same time; wherein the heterogeneous core information includes the number of the heterogeneous cores in the processor;
[0008] The debugging module includes a file list unit, a file editing unit, a debugging tool unit and a debugging result analysis unit. The file list unit is used to manage the code files of the program to be debugged; the file editing unit is used to read and run the code files; the debugging tool unit is used to execute corresponding debugging instructions according to user operations; the debugging result analysis unit is used to analyze the debugging results; wherein, the program to be debugged is the burning result of the program to be burned in each heterogeneous core.
[0009] Optionally, the burning module further includes an interaction unit, which is used to display the scanning result of the burning management unit.
[0010] Optionally, the burning module further includes at least one separate burning unit, each of the separate burning units corresponds to a different heterogeneous core, and is used to burn the program to be burned into the corresponding heterogeneous core.
[0011] Optionally, the file editing unit further includes a breakpoint debugging subunit, and the breakpoint debugging subunit is used to receive a breakpoint debugging instruction and interrupt the execution of the code file in response to the breakpoint debugging instruction.
[0012] Optionally, the debugging result analysis unit includes a function stack subunit and a variable parsing subunit;
[0013] The function stack subunit is used to collect and parse the function stack list after the debugging instruction is executed, and receive the function modification operation of the user;
[0014] The variable parsing subunit is used to collect and parse the variable list after the debugging instruction is executed, and receive the user's variable modification operation.
[0015] Optionally, the debugging module also includes an observation point unit for monitoring the target data in response to a user's selection operation on the target data. When the target data changes in the program to be debugged, the program to be debugged is stopped and the values of the target data in each of the heterogeneous cores are summarized and displayed.
[0016] According to another aspect of the present invention, a heterogeneous core programming and debugging method is provided, comprising:
[0017] Scanning the processor through the burning management unit to obtain heterogeneous core information, and establishing a corresponding connection for each heterogeneous core; wherein the heterogeneous core information includes the number of the heterogeneous cores in the processor;
[0018] Obtaining the program to be burned through a unified burning unit, duplicating the program to be burned according to the number of the heterogeneous cores, and distributing the program to be burned to each of the heterogeneous cores for burning;
[0019] Managing the code files of the program to be debugged through the file list unit; wherein the program to be debugged is the burning result of the program to be burned in each heterogeneous core;
[0020] Read and run the code file through the file editing unit;
[0021] Execute corresponding debugging instructions according to user operations through the debugging tool unit;
[0022] The debugging result is analyzed by the debugging result analysis unit.
[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0024] at least one processor; and
[0025] a memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the heterogeneous core burning and debugging method described in any embodiment of the present invention.
[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the heterogeneous core burning and debugging method described in any embodiment of the present invention when executed.
[0028] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program / instruction, and the computer program / instruction, when executed by a processor, implements the steps of the heterogeneous core burning and debugging method described in any embodiment of the present invention.
[0029] The heterogeneous core burning and debugging system disclosed in the present invention comprises a burning module and a debugging module; the burning module comprises a burning management unit and a unified burning unit, the burning management unit is used to scan the processor to obtain heterogeneous core information, and establish a corresponding connection for each heterogeneous core; the unified burning unit is used to obtain a program to be burned, copy the program to be burned according to the number of heterogeneous cores, and distribute it to each heterogeneous core for burning at the same time; wherein the heterogeneous core information includes the number of the heterogeneous cores in the processor; the debugging module comprises a file list unit, a file editing unit, a debugging tool unit and a debugging result analysis unit, the file list unit is used to manage the code file of the program to be debugged; the file editing unit is used to read and run the code file; the debugging tool unit is used to execute the corresponding debugging instruction according to the user operation; the debugging result analysis unit is used to analyze the debugging result; wherein the program to be debugged is the burning result of the program to be burned in each heterogeneous core. The heterogeneous core burning and debugging system disclosed in the present invention can uniformly burn multiple heterogeneous cores contained in a processor through a burning module, and can synchronously debug and run the same software code instruction on multiple heterogeneous processor cores during the debugging process after burning, thereby ensuring the synchronization of the burning program and the consistency of the debugging code instructions, freeing developers from complicated multi-core synchronous command line debugging configuration and switching configuration, and simplifying the entire debugging interaction process.
[0030] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 It is a structural schematic diagram of a heterogeneous core burning and debugging system provided according to the first embodiment of the present invention;
[0033] Figure 2 This is a flow chart of a heterogeneous core programming and debugging method provided according to the second embodiment of the present invention;
[0034] Figure 3 It is a structural schematic diagram of an electronic device for implementing the heterogeneous core burning and debugging method of the third embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Embodiment 1
[0038] Figure 1 This is a structural diagram of a heterogeneous core burning and debugging system provided in the first embodiment of the present invention. This embodiment can be applied to the case of programming and debugging multiple heterogeneous cores of a virtual MCU. The heterogeneous core burning and debugging system can be implemented in the form of hardware and / or software and can be used to execute a heterogeneous core burning and debugging method. The heterogeneous core burning and debugging system can be configured in an electronic device. Figure 1 As shown, the system includes: a burning module 110 and a debugging module 120 .
[0039] The burning module 110 includes a burning management unit 111 and a unified burning unit 112. The burning management unit 111 is used to scan the processor to obtain heterogeneous core information and establish a corresponding connection for each heterogeneous core; the unified burning unit 112 is used to obtain the program to be burned, and copy the program to be burned according to the number of heterogeneous cores, and distribute it to each heterogeneous core for burning. The heterogeneous core information includes the number of heterogeneous cores in the processor.
[0040] In the software development process of the mimetic MCU, due to the particularity of the mimetic MCU, multiple heterogeneous processor cores need to be integrated, so it is necessary to allow the software program to be burned synchronously on multiple heterogeneous processor cores. In this embodiment, the heterogeneous core is the heterogeneous processor core integrated in the mimetic MCU, and the program to be burned is the program that needs to be burned into each heterogeneous processor core.
[0041] Specifically, the heterogeneous core burning and debugging system can use program debugging tools such as OpenOCD and GDB. Before burning, preparations for burning and debugging are required, including preparing the heterogeneous core burning and debugging system required for burning and other necessary OpenOCD and GDB executable files and program files under Windows, and filling in the paths of executable files and program files in advance in the heterogeneous core burning and debugging system. When the burning module 110 burns the program to be burned into each heterogeneous core, it first scans the processor through the burning management unit 111 to obtain the number, type, port number and other information of each heterogeneous core of the processor. An OpenOCD process can be created in the burning management unit 111 to read the configuration file. By starting the OpenOCD process, the heterogeneous core information can be scanned and discovered, and a communication connection can be created for each heterogeneous core. Afterwards, the unified burning unit 112 can copy the program to be burned issued by the user according to the number of heterogeneous cores obtained by scanning, and distribute it to each heterogeneous core at the same time. Optionally, the unified burning unit 112 includes a general input command control, through which the burning instructions defined by the user can be directly received and copied and distributed to each heterogeneous core.
[0042] Preferably, the heterogeneous core burning and debugging system is developed based on QT (graphical user interface application development framework) and adopts a graphical interface design. The system can include a normal mode and an advanced mode. In the normal mode, the heterogeneous core program can be burned synchronously and the synchronous burning process and interaction steps can be intuitively displayed. In the advanced mode, in addition to the functions of the normal mode, key information in the debugging process, such as variable values, stack traces, call relationships, etc., can also be intuitively displayed. The interactive logic can be optimized in this system, and the debugging operation can be simplified and the debugging efficiency can be improved through intelligent prompts, shortcut key settings, drag-and-drop operations, etc. Dynamic adjustment technology can also be introduced in this system to automatically adjust the interface layout and function display according to the user's operating habits and debugging requirements to achieve personalized customization.
[0043] Furthermore, the burning module 110 further includes an interaction unit 113 for displaying the scanning result of the burning management unit 111 .
[0044] Specifically, the interaction unit 113 may be designed using QtTelnet and encapsulate common commands to query the core information of the processor. The user may query heterogeneous core information through the interaction unit 113, and the query result is displayed on the interaction interface.
[0045] Preferably, the interaction unit 113 is also used to check the correctness of the connection established between the burning module 110 and the heterogeneous core. Generally, the processor heterogeneous cores include ARM, RISCV and MIPS. After the burning management unit 111 initiates a telnet connection with OpenOCD and scans the processor heterogeneous cores, if the interaction unit 113 can display that ARM, RISCV and MIPS are found at the same time, it proves that the connection is normal and the burning can be started. At this time, OpenOCD can establish corresponding gdbsever threads for the three scanned heterogeneous cores respectively for monitoring the heterogeneous cores. At this time, the port number of the scanned GDB connection monitoring is filled in in this system, and a connection from local GDB to OpenOCD can be established. Preferably, this system has the function of automatically analyzing the corresponding relationship between the scanned port number and the heterogeneous core, and the port number can also be omitted here.
[0046] Furthermore, the burning module 110 further includes at least one separate burning unit 114 , each of which corresponds to a different heterogeneous core and is used to burn the program to be burned into the corresponding heterogeneous core.
[0047] Specifically, the heterogeneous cores of the processor may include ARM, RISCV and MIPS, and corresponding ARM burning units, RISCV burning units and MIPS burning units may be set for different heterogeneous cores. Taking the ARM burning unit as an example, the ARM burning unit can use the QProcess class to create a GDB process. After obtaining the program to be burned, the GDB process is started and started in the MI (machine interaction) mode of GDB during operation. The ARM burning unit contains a GDB management control for managing the GDB-related functions of the ARM core and establishing a connection with the gdbserver thread of OpenOCD for information interaction. The ARM burning unit can directly receive the burning instruction and establish a channel connection with OpenOCD according to the port number corresponding to the ARM core, wherein the port number does not need to be specified by the user. The ARM burning unit will analyze the OpenOCD startup log, automatically identify the port number of the ARM core through string matching, and burn by sending a load instruction to the ARM gdb. The ARM burning unit also includes a GDB command input control. After the GDB command input by the user is received, it will be passed to the gdb process for execution, and finally passed to the ARMgdbserver thread established when scanning the ARM core, receiving the returned result, and displaying the result in the control in machine mode.
[0048] Similarly, the RISCV burning unit and the MIPS burning unit have the same functions as the ARM burning unit, and are responsible for the burning of RISCV and MIPS respectively.
[0049] The debugging module 120 includes a file list unit 121, a file editing unit 122, a debugging tool unit 123, and a debugging result analysis unit 124. The file list unit 121 is used to manage the code files of the program to be debugged; the file editing unit 122 is used to read and run the code files; the debugging tool unit 123 is used to execute the corresponding debugging instructions according to the user operation; and the debugging result analysis unit 124 is used to analyze the debugging results. The program to be debugged is the burning result of the program to be burned in each heterogeneous core.
[0050] In this embodiment, after the burning module 110 burns the program to be burned into each heterogeneous core, each heterogeneous core obtains a program to be debugged, which needs to be debugged by the debugging module 120 to verify the rationality of the program to be debugged and correct errors.
[0051] Specifically, the file list unit 121 uses QTreeView (a view class in the Qt framework, used to display hierarchical data) to design and display, and the bottom layer uses QFileSystemModel (a data model that can be used to access the local file system) to manage the file list and the associated files displayed. Among them, the files displayed and managed in the file list unit 121 include the code files of the program to be debugged. The file editing unit 122 can read and run the currently debugged code file from the file list unit 121, and use QTextEditor (a multi-line text editing control) to design and display. The debugging tool unit 123 includes a toolbar, which includes a variety of debugging tool buttons, each button corresponds to a debugging instruction. When the user clicks the debugging tool button or selects the debugging tool through keyboard shortcuts, the debugging tool unit 123 can convert the user's operation into a corresponding debugging instruction and send it to the GDB process for detailed debugging processing. After the debugging instruction is executed, the debugging result analysis unit 124 can parse the relevant information of the execution of the currently debugged code file returned by GDB, and summarize and display it in this unit.
[0052] Furthermore, the file editing unit 122 includes a breakpoint debugging subunit 1221, and the breakpoint debugging subunit 1221 is used to receive a breakpoint debugging instruction and interrupt the execution of the code file in response to the breakpoint debugging instruction.
[0053] Specifically, the file editing unit 122 adds a breakpoint function through the breakpoint debugging subunit 1221, which is used to perform breakpoint debugging on the program to be debugged. Among them, breakpoint debugging refers to setting a breakpoint on a certain line of the program to be debugged, so that the program will stop when it runs to this line, and then it can be debugged step by step to find the error code line, and then analyze the cause of the error. The user can input the breakpoint instruction through the breakpoint debugging subunit 1221 of the file editing unit 122, so that the breakpoint debugging subunit 1221 copies and distributes the instruction to the GDB process of each heterogeneous core.
[0054] Furthermore, the debugging result analysis unit 124 includes a function stack subunit 1241 and a variable parsing subunit 1242. The function stack subunit 1241 is used to collect and parse the function stack list after the debugging instruction is executed, and receive the user's function modification operation; the variable parsing subunit 1242 is used to collect and parse the variable list after the debugging instruction is executed, and receive the user's variable modification operation.
[0055] Specifically, the debugging result analysis unit 124 can analyze the function stack list and variable list in the debugging process through the function stack subunit 1241 and the variable analysis subunit 1242 respectively. Taking the function stack subunit 1241 as an example, this module is designed using the QLabelView control. After the debugging instruction is executed, the function stack subunit 1241 can obtain the relevant information of the current debugging program execution returned by GDB, and obtain the function stack list corresponding to each heterogeneous core from it, and then summarize and display it. For the abnormal function values, they can be displayed in a marked manner. Furthermore, through the function stack subunit 1241, the user can modify the function value, and the modification operation will be converted into a GDB command and copied and distributed to the GDB process of each heterogeneous core for processing.
[0056] Similarly, the variable parsing subunit 1242 has the same function as the function stack subunit 1241, except that the variable parsing subunit 1242 summarizes and analyzes the variable list and related value information corresponding to each heterogeneous core of the displayed object. The variable parsing subunit 1242 can also receive the user's variable modification operation, and the modification operation will be converted into a GDB command and copied and distributed to the GDB process of each heterogeneous core for processing.
[0057] Furthermore, the debugging module 120 also includes an observation point unit 125 for responding to the user's selection operation on the target data, monitoring the target data, and when the target data changes in the program to be debugged, stopping the program to be debugged and summarizing and displaying the values of the target data in each heterogeneous core.
[0058] Specifically, the observation point unit 125 is designed and displayed using QTreeView, and the unit can be used to edit and save the value changes of a target data that the user wants to observe in real time. The user can select the target data that he wants to observe through the observation point unit 125, including variables or expressions, etc. The observation point unit 125 can convert the target data into a GDB command and copy and distribute it to the GDB processes of each heterogeneous core for processing. After that, when the value of the target data changes in the program to be debugged, the observation point unit 125 will immediately stop running the program to be debugged, and then summarize the values of the target data in each heterogeneous core and return them to this unit for display.
[0059] The heterogeneous core burning and debugging system disclosed in the present invention comprises a burning module and a debugging module; the burning module comprises a burning management unit and a unified burning unit, the burning management unit is used to scan the processor to obtain heterogeneous core information, and establish a corresponding connection for each heterogeneous core; the unified burning unit is used to obtain a program to be burned, copy the program to be burned according to the number of heterogeneous cores, and distribute it to each heterogeneous core for burning at the same time; wherein the heterogeneous core information includes the number of the heterogeneous cores in the processor; the debugging module comprises a file list unit, a file editing unit, a debugging tool unit and a debugging result analysis unit, the file list unit is used to manage the code file of the program to be debugged; the file editing unit is used to read and run the code file; the debugging tool unit is used to execute the corresponding debugging instruction according to the user operation; the debugging result analysis unit is used to analyze the debugging result; wherein the program to be debugged is the burning result of the program to be burned in each heterogeneous core. The heterogeneous core burning and debugging system disclosed in the present invention can uniformly burn multiple heterogeneous cores contained in a processor through a burning module, and can synchronously debug and run the same software code instruction on multiple heterogeneous processor cores during the debugging process after burning, thereby ensuring the synchronization of the burning program and the consistency of the debugging code instructions, freeing developers from complicated multi-core synchronous command line debugging configuration and switching configuration, and simplifying the entire debugging interaction process.
[0060] Embodiment 2
[0061] Figure 2 This is a flow chart of a heterogeneous core programming and debugging method provided in the second embodiment of the present invention. The method can be executed by a heterogeneous core programming and debugging system. Figure 2 As shown, the method includes:
[0062] S110 , scanning the processor through the burning management unit to obtain heterogeneous core information, and establishing a corresponding connection for each heterogeneous core.
[0063] The heterogeneous core information includes the number of heterogeneous cores in the processor.
[0064] In this embodiment, the heterogeneous core burning and debugging method can be executed by a heterogeneous core burning and debugging system, which includes a burning module and a debugging module. The heterogeneous core is a heterogeneous processor core integrated in the pseudo-MCU, and the program to be burned is a program that needs to be burned into each heterogeneous processor core.
[0065] Optionally, the heterogeneous core burning and debugging system that executes the heterogeneous core burning and debugging method can have built-in program debugging tools such as OpenOCD and GDB. Before burning, the heterogeneous core burning and debugging system and other necessary OpenOCD and GDB executable files and program files required for burning can be prepared under Windows, and the paths of the executable files and program files can be filled in the system in advance.
[0066] Specifically, the burning module in the heterogeneous core burning and debugging system includes a burning management unit. The burning management unit scans the processor to obtain heterogeneous core information, and the method of establishing a corresponding connection for each heterogeneous core can be: the burning management unit in the burning module scans the processor to obtain the number, type, port number and other information of each heterogeneous core of the processor. An OpenOCD process can be created in the burning management unit to read the configuration file. By starting the OpenOCD process, the heterogeneous core information can be scanned and discovered, and a communication connection can be established for each heterogeneous core.
[0067] S120 , obtaining the program to be burned through the unified burning unit, duplicating the program to be burned according to the number of heterogeneous cores, and distributing the program to be burned to each heterogeneous core for burning at the same time.
[0068] In this embodiment, the burning module in the heterogeneous core burning and debugging system also includes a unified burning unit. After the burning management unit establishes a corresponding connection for each heterogeneous core, the unified burning unit can obtain the program to be burned issued by the user, and then copy the program to be burned according to the number of heterogeneous cores obtained by scanning, and distribute it to each heterogeneous core for burning at the same time.
[0069] Optionally, the unified burning unit includes a general input command control, through which the burning instructions defined by the user can be directly received and copied and distributed to each heterogeneous core.
[0070] Furthermore, the heterogeneous core burning and debugging method further includes: displaying the scanning result of the burning management unit through the interactive unit.
[0071] Specifically, the burning module in the heterogeneous core burning and debugging system also includes an interaction unit, which can encapsulate commonly used commands to query the core information of the processor. After receiving the user's processor query instruction, the interaction unit can instruct the burning management unit to scan the processor, and the final scanning result is displayed through the interaction unit.
[0072] Preferably, the interaction unit can also be used to check the correctness of the connection established between the burning module and the heterogeneous core. Generally, the processor heterogeneous cores include ARM, RISCV and MIPS. After the burning management unit initiates a telnet connection with OpenOCD and scans the processor heterogeneous cores, if the interaction unit can display that ARM, RISCV and MIPS are found at the same time, it proves that the connection is normal and the burning can be started. At this time, OpenOCD can establish corresponding gdbsever threads for the three scanned heterogeneous cores respectively for monitoring the heterogeneous cores. At this time, the port number of the scanned GDB connection monitoring is filled in in this system, and a connection from local GDB to OpenOCD can be established. Preferably, the system has a function of automatically analyzing the corresponding relationship between the scanned port number and the heterogeneous core, and the port number can also be omitted here.
[0073] Furthermore, the heterogeneous core programming and debugging method further includes: programming the program to be programmed into the corresponding heterogeneous core by at least one separate programming unit, wherein each separate programming unit corresponds to a different heterogeneous core.
[0074] Specifically, the burning module in the heterogeneous core burning and debugging system also includes at least one separate burning unit, and each separate burning unit can be used to burn the corresponding heterogeneous core. Among them, the heterogeneous cores of the processor may include ARM, RISCV and MIPS, and corresponding ARM burning units, RISCV burning units and MIPS burning units can be set for different heterogeneous cores. Taking the ARM burning unit as an example, the ARM burning unit can use the QProcess class to create a GDB process. After obtaining the program to be burned, the GDB process is started and started in the MI (machine interaction) mode of GDB during operation. The ARM burning unit contains a GDB management control for managing the GDB-related functions of the ARM core and establishing a connection with the gdbserver thread of OpenOCD for information interaction. The ARM burning unit can directly receive the burning instruction and establish a channel connection with OpenOCD according to the port number corresponding to the ARM core, wherein the port number does not need to be specified by the user. The ARM burning unit will analyze the OpenOCD startup log, automatically identify the port number of the ARM core through string matching, and burn by sending a load instruction to the ARM gdb. The ARM burning unit also includes a GDB command input control. After the GDB command input by the user is received, it will be passed to the gdb process for execution, and finally passed to the ARM gdbserver thread established when scanning the ARM core, receiving the returned result, and displaying the result in the machine mode in the control. Similarly, the RISCV burning unit and the MIPS burning unit have the same functions as the ARM burning unit. The RISCV burning unit and the MIPS burning unit can be used to complete the burning of RISCV and MIPS respectively.
[0075] S130. Managing code files of the program to be debugged through a file list unit.
[0076] The program to be debugged is the burning result of the program to be burned in each heterogeneous core.
[0077] In this embodiment, the heterogeneous core burning and debugging method can be executed by a heterogeneous core burning and debugging system, which includes a burning module and a debugging module, wherein the debugging module includes a file list unit, a file editing unit, a debugging tool unit, and a debugging result analysis unit. After the burning module burns the program to be burned into each heterogeneous core, each heterogeneous core obtains the program to be debugged, which needs to be debugged by the debugging module to verify the rationality of the program to be debugged and perform error correction.
[0078] Specifically, the file list unit can be designed and displayed using QTreeView (a view class in the Qt framework, used to display hierarchical data), and the underlying QFileSystemModel (a data model that can be used to access the local file system) is used to manage the file list and the displayed associated files. Through the file list unit, the code files of the program to be debugged can be displayed and managed.
[0079] S140. Read and run the code file through the file editing unit.
[0080] In this embodiment, the file editing unit in the debugging module of the heterogeneous core burning and debugging system can read the currently debugged code file from the file list unit and run it.
[0081] Optionally, the file editing unit can use QTextEditor (multi-line text editing control) for design display.
[0082] Furthermore, the heterogeneous core burning and debugging method also includes: receiving a breakpoint debugging instruction through a breakpoint debugging subunit, and interrupting the running of the code file in response to the breakpoint debugging instruction.
[0083] Specifically, the file editing unit may include a breakpoint debugging subunit, through which a breakpoint function can be added to the file editing unit, and breakpoint debugging can be performed on the program to be debugged. Breakpoint debugging refers to setting a breakpoint on a certain line of the program to be debugged, so that the program will stop when it runs to this line, and then it can be debugged step by step to find the erroneous code line, and then analyze the cause of the error. The breakpoint debugging subunit of the file editing unit can receive the breakpoint instruction input by the user, so that the breakpoint debugging subunit copies and distributes the instruction to the GDB process of each heterogeneous core, and then responds to the breakpoint debugging instruction to interrupt the running of the code file.
[0084] S150: Execute corresponding debugging instructions according to user operations through the debugging tool unit.
[0085] In this embodiment, the debugging instruction triggered by the user operation can be executed by the debugging tool unit in the debugging module of the heterogeneous core burning and debugging system.
[0086] Specifically, the debugging tool unit includes a toolbar, which includes a variety of debugging tool buttons, each button corresponding to a debugging instruction. When the user clicks the debugging tool button or selects the debugging tool through keyboard shortcuts, the debugging tool unit can convert the user's operation into a corresponding debugging instruction and send it to the GDB process for detailed debugging processing.
[0087] S160: Analyze the debugging result by a debugging result analysis unit.
[0088] In this embodiment, the debugging result analysis unit in the debugging module of the heterogeneous core burning debugging system can analyze the debugging results after the debugging instructions are executed. The debugging result analysis unit can parse the relevant information of the execution of the current debugged code file returned by GDB and summarize and display it in this unit.
[0089] Optionally, the debugging result analysis unit includes a function stack sub-unit and a variable parsing sub-unit. The method for analyzing the debugging result through the debugging result analysis unit may be: collecting and parsing the function stack list after the debugging instruction is executed by the function stack sub-unit, and receiving the user's function modification operation; collecting and parsing the variable list after the debugging instruction is executed by the variable parsing sub-unit, and receiving the user's variable modification operation.
[0090] Specifically, the debugging result analysis unit can analyze the function stack list and variable list in the debugging process respectively through the function stack subunit and the variable parsing subunit. Taking the function stack subunit 1241 as an example, this module is designed using the QLabelView control. After the debugging instruction is executed, the function stack subunit can obtain the relevant information of the current debugging program execution returned by GDB, and obtain the function stack list corresponding to each heterogeneous core from it, and then summarize and display it. For the abnormal function value, it can be displayed in a marked manner. Further, through the function stack subunit, the user can modify the function value, and the modification operation will be converted into a GDB command copy and distributed to the GDB process of each heterogeneous core for processing. Similarly, the variable parsing subunit has the same function as the function stack subunit, the difference is that the variable parsing subunit summarizes and analyzes the variable list and related value information corresponding to each heterogeneous core of the displayed object. The variable parsing subunit can also receive the user's variable modification operation, and the modification operation will be converted into a GDB command copy and distributed to the GDB process of each heterogeneous core for processing.
[0091] Furthermore, the heterogeneous core burning and debugging method also includes: monitoring the target data in response to the user's selection operation on the target data through the observation point unit, and when the target data changes in the program to be debugged, stopping the running of the program to be debugged and summarizing and displaying the values of the target data in each heterogeneous core.
[0092] Specifically, the debugging module of the heterogeneous core burning and debugging system can also include an observation point unit. The observation point unit is designed and displayed using QTreeView. Through this unit, the user can edit and save the changes in the value of a certain target data that the user wants to observe in real time. Through the observation point unit, the user can select the target data to be observed, including variables or expressions, etc. The observation point unit can convert the target data into a GDB command and copy and distribute it to the GDB process of each heterogeneous core for processing. After that, when the value of the target data changes in the program to be debugged, the observation point unit will immediately stop running the program to be debugged, and then summarize the values of the target data in each heterogeneous core and return them to this unit for display.
[0093] The heterogeneous core burning and debugging method disclosed in the present invention can be executed by the heterogeneous core burning and debugging system provided by any embodiment of the present invention, and has corresponding modules and beneficial effects.
[0094] Embodiment 3
[0095] Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0096] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0097] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0098] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a heterogeneous core burning and debugging method.
[0099] In some embodiments, the heterogeneous core burn-in debugging method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the heterogeneous core burn-in debugging described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the heterogeneous core burn-in debugging method in any other appropriate manner (e.g., by means of firmware).
[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0102] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A heterogeneous core burning and debugging system, characterized in that: The system comprises: a burning module and a debugging module; The burning module includes a burning management unit and a unified burning unit, wherein the burning management unit is used to scan the processor to obtain heterogeneous core information and establish a corresponding connection for each heterogeneous core; the unified burning unit is used to obtain the program to be burned, copy the program to be burned according to the number of the heterogeneous cores, and distribute it to each of the heterogeneous cores for burning at the same time; wherein the heterogeneous core information includes the number of the heterogeneous cores in the processor; The debugging module includes a file list unit, a file editing unit, a debugging tool unit and a debugging result analysis unit. The file list unit is used to manage the code files of the program to be debugged; the file editing unit is used to read and run the code files; the debugging tool unit is used to execute corresponding debugging instructions according to user operations; the debugging result analysis unit is used to analyze the debugging results; wherein, the program to be debugged is the burning result of the program to be burned in each heterogeneous core.
2. The system according to claim 1, characterized in that The burning module further includes an interaction unit, which is used to display the scanning result of the burning management unit.
3. The system according to claim 1, characterized in that The burning module further includes at least one separate burning unit, each of which corresponds to a different heterogeneous core and is used to burn the program to be burned into the corresponding heterogeneous core.
4. The system according to claim 1, characterized in that The file editing unit further comprises a breakpoint debugging subunit, and the breakpoint debugging subunit is used for receiving a breakpoint debugging instruction and interrupting the running of the code file in response to the breakpoint debugging instruction.
5. The system according to claim 1, characterized in that The debugging result analysis unit includes a function stack subunit and a variable parsing subunit; The function stack subunit is used to collect and parse the function stack list after the debugging instruction is executed, and receive the function modification operation of the user; The variable parsing subunit is used to collect and parse the variable list after the debugging instruction is executed, and receive the user's variable modification operation.
6. The system according to claim 1, characterized in that The debugging module also includes an observation point unit for monitoring the target data in response to a user's selection operation on the target data. When the target data changes in the program to be debugged, the program to be debugged is stopped and the values of the target data in each of the heterogeneous cores are summarized and displayed.
7. A heterogeneous core burning and debugging method, characterized in that: include: Scanning the processor through the burning management unit to obtain heterogeneous core information, and establishing a corresponding connection for each heterogeneous core; wherein the heterogeneous core information includes the number of the heterogeneous cores in the processor; Obtaining the program to be burned through a unified burning unit, duplicating the program to be burned according to the number of the heterogeneous cores, and distributing the program to be burned to each of the heterogeneous cores for burning; Managing the code files of the program to be debugged through the file list unit; wherein the program to be debugged is the burning result of the program to be burned in each heterogeneous core; Read and run the code file through the file editing unit; Execute corresponding debugging instructions according to user operations through the debugging tool unit; The debugging result is analyzed by the debugging result analysis unit.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the heterogeneous core burning and debugging method described in claim 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the heterogeneous core burning and debugging method described in claim 7 when executed.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by the processor, the steps of the heterogeneous core burning and debugging method as described in claim 7 are implemented.