A synchronous debugging method for multi-core processors
By using debugging signals and discrete control cards on the host and target sides to manage the synchronous operations of multi-core processors, the problem of synchronous debugging of multi-core processors under a single set of debugging resources is solved, and the synchronous stop and operation of multi-core processors are realized. Improved debugging reliability and efficiency.
Patent Information
- Application Number
- CN202111534272.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the synchronous debugging of multi-core processors, how a single set of debugging resources can effectively manage the synchronous stop and run of multiple cores has become a key technical problem. In particular, how to achieve synchronous operations of multi-core processors under single-core debugging resources is a challenge.
By using the debugging bus interface and discrete control card on the host side and target side respectively, we can generate and send stop signals and run signals to control the synchronous stop and run of multi-core processors, and use the interrupt controller to receive and deliver signals to ensure that the main core and The synchronization status of the slave core.
It realizes the synchronous stop and synchronous operation of multi-core processors, ensures the synchronization consistency and status protection of each core during the debugging process, and improves the debugging reliability and efficiency of multi-core processors.
Smart Images

Figure CN114355802B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of embedded multi-core debugging, and in particular relates to a synchronous debugging method for multi-core processors. Background Art
[0002] In the fields of aerospace flight control, air traffic control, banking and nuclear power plant control, redundancy control technology is often used to improve the mission reliability and safety reliability of the system. In the development and design of redundancy control software, it is often necessary to stop all channels when a certain channel runs to a certain condition to observe the current operating status of each channel, analyze the data of each channel, and verify whether the software logic design is reasonable.
[0003] In single-core redundant synchronous debugging, each CPU exclusively occupies the debug bus and the external interface for synchronous debugging, and channels are synchronized by high and low handshakes of synchronous signals.
[0004] In multi-core synchronous debugging, there is only one set of debugging resources outside a CPU, but there are multi-core debugging targets inside a CPU. How to solve the problem of multi-core synchronous debugging with one set of debugging resources is a key technology that must be broken through.
[0005] Therefore, designing and implementing the synchronous stop and synchronous operation of multiple cores in the CPU has become an important technical challenge in developing redundant multi-core control software. The relevant foreign technologies for the proposal of this requirement and the engineering implementation method are kept confidential, and there are no related reports in China. Summary of the invention
[0006] In view of the above technical problems, in a first aspect, the present application provides a method for synchronous debugging of a multi-core processor, the method being applied to a host side, the host side including a debug bus interface, a discrete control card and control software; the method comprising:
[0007] The discrete control card generates a stop signal or a run signal, and sends the stop signal to the target machine end; wherein the stop signal is used to control the multi-core processor to achieve synchronous stop;
[0008] The control software generates a software signal, and sends the software signal and the operation signal to the target machine; wherein the software signal is used to control the multi-core processor to be in a standby state; and the operation signal is used to control the multi-core processor to realize synchronous operation.
[0009] Preferably, the discrete control card generates a stop signal and a run signal, and sends the stop signal to the target machine end, including:
[0010] The control software sends an instruction to the discrete control card, and the discrete control card generates the stop signal based on the instruction and sends the stop signal to the target machine end.
[0011] Preferably, the control software generates a software signal, and sends the software signal and the operation signal to the target machine end, including:
[0012] The control software generates a software signal and sends the software signal to the main core;
[0013] The operation signal is sent to an interrupt controller.
[0014] Preferably, the discrete control card generates an operation signal, including:
[0015] The control software sends instructions to the discrete control card, and the discrete control card generates the operation signal based on the instructions.
[0016] In a second aspect, the present application provides a method for synchronous debugging of a multi-core processor, characterized in that the method is applied to a target machine end, the target machine end includes a multi-core processor, and the multi-core processor includes an interrupt controller; the method includes:
[0017] The interrupt controller receives the stop signal or the run signal, and controls the multi-core processor to stop synchronously based on the stop signal; wherein the multi-core processor includes a master core and a slave core;
[0018] The master core receives the software signal, forwards the software signal to the slave core, and controls the master core and the slave core to run synchronously based on the software signal and the running signal.
[0019] Preferably, the interrupt controller receives the stop signal, and controls the multi-core processor to stop synchronously based on the stop signal, including:
[0020] The interrupt controller receives the stop signal and delivers the stop signal to the multi-core processor;
[0021] The multi-core processors are controlled to stop synchronously based on the stop signal.
[0022] Preferably, the software signal is a preparation signal for the master core and the slave core to run synchronously.
[0023] Preferably, the interrupt controller receives the operation signal, comprising:
[0024] The interrupt controller receives the operation signal and delivers the operation signal to the master core and the slave core.
[0025] Beneficial effects of the present invention:
[0026] The present invention provides a synchronous debugging method for a multi-core processor. When an event occurs in a certain core, not only the core operation is stopped to protect the scene, but also other cores in the multi-core processor are synchronously stopped. When the target core is debugged and resumed, other cores in the multi-core processor must also be notified to synchronize operation, so as to achieve the purpose of synchronously stopping and synchronously operating multiple cores of the multi-core processor, and realize synchronous debugging of the multi-core processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a multi-core processor synchronous debugging principle provided in an embodiment of the present application;
[0028] Figure 2 A multi-core processor synchronous stop control flow graph provided in an embodiment of the present application;
[0029] Figure 3 A multi-core processor synchronous operation control flow graph provided in an embodiment of the present application;
[0030] Figure 4 A schematic diagram of a synchronous stop signal processing of a multi-core processor provided in an embodiment of the present application;
[0031] Figure 5 A schematic diagram of the principle of a multi-core processor "multi-core parallel operation" mechanism provided in an embodiment of the present application;
[0032] Figure 6 A schematic diagram of the Timer compensation principle of a multi-core processor system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0034] The technical solution of this application consists of the following parts:
[0035] 1) If Figure 1 , connecting the debugging device with the multi-core processor embedded computer according to the debugging schematic diagram, and realizing the signal path of the debugging signal, the discrete signal and the reset signal between the host end and the target end;
[0036] 2) On the host side, the discrete control card is controlled by the debugging control software to send a reset pulse signal to the target machine. The reset pulse level and width need to be consistent with the reset signal required by the processor. The reset signal enables the RST pin of the multi-core processor, and the internal logic of the multi-core processor guides the multi-core processor to reset and start;
[0037] 3) If Figure 2 ,On the host side, the discrete control card is controlled by the control software to send a stop signal to the target machine. The hardware stop signal reaches the interrupt controller of the multi-core processor, and the stop signal is delivered to all cores through the interrupt controller to ensure that all cores respond synchronously;
[0038] 4) After the multi-core synchronization of the target machine stops, the host can debug the target machine through the control software, and proceed to the next step after the debugging is completed;
[0039] 5) Implementation of the “multi-core parallel” mechanism. Figure 3 , two signals are sent continuously on the host side: first, the debugging control software sends the "synchronization preparation" debugging command to the target machine through the debugging bus; then, the control software performs synchronization delay; finally, the control software controls the discrete control card to send the "running signal" to the target machine. Figure 5 ,On the target machine side, after the multi-core processor core receives the ,“synchronous ready” signal, the debug command processing module first suspends the core and waits; when the multi-core processor core receives the ,“running signal”, it exits the interrupt handler at the same time and resumes ,synchronous operation.
[0040] 6) Repeat steps 3, 4, and 5 to achieve multiple simultaneous debugging of multi-core processors.
[0041] It should be noted that in step 3, the target machine performs the "stop signal" processing logic as follows: Figure 4 .
[0042] 1) In the signal sampling logic, the falling edge is identified and the low-level pulse width is 40ns for double insurance to filter out interference signals;
[0043] 2) Design a dedicated register in the interrupt handler to clear the sampling pulse signal and avoid repeated responses.
[0044] In step 5, the target machine multi-core exits the interrupt handler and resumes synchronous operation.
[0045] 1) The synchronization delay time of the host-side control software needs to be adapted according to the actual hardware performance;
[0046] 2) It is necessary to compensate the interrupt response time of the target machine application software system Timer. The specific compensation time is based on the actual processing logic of the system. Figure 6,Since the "site saving" after entering the interrupt service in "synchronous debugging" and the "site recovery" when exiting the interrupt service will consume the ,application software system timer, the site processing mainly includes ,interrupt context, status word, program pointer and other key information.
[0047] In other embodiments of the present application, PowerPC2020 synchronous debugging
[0048] 1) If Figure 1 , according to the debugging schematic diagram, the debugging device is connected to the multi-core processor embedded computer to realize the signal path of the debugging signal, the stop signal and the reset signal between the host end and the target end;
[0049] 2) On the host side, the discrete control card is controlled by the debugging control software to send a 10ms low pulse reset signal to the target machine, and the PowerPC2020 is reset and started;
[0050] 3)Stop debugging synchronously:
[0051] a) Bind the stop signal to both core 1 and core 2 in the PowerPC2020 programmable interrupt controller in advance;
[0052] b) If Figure 2 , on the host side, the discrete control card is controlled by the debugging control software to send a 10ms low pulse stop signal to the target machine;
[0053] c) If Figure 3 , the target machine's "debugging agent" processes the "stop signal" and first identifies the falling edge of the "stop signal". After identifying the falling edge, it also determines whether the low-level pulse width of the "stop signal" is greater than 40ns. The interference signal is filtered through the double threshold of the falling edge and the pulse width;
[0054] d) If Figure 3 , the target machine sets a dedicated register in the interrupt handler to clear the continuous sending of the sampling pulse signal to avoid repeated responses to the "synchronous stop" debugging command.
[0055] 4) After the multi-core synchronous stop of the target machine, the host can debug the target machine through the debugging control software, such as reading key variables, setting variable values and setting breakpoints, etc. After the debugging is completed, proceed to the next step;
[0056] 5) Synchronous operation and debugging:
[0057] a) If Figure 5 , the debugging device sends the "synchronization preparation" debugging command to the target machine through the debugging control software and starts a 500ms delay;
[0058] b) After receiving the "synchronization preparation" debugging command, the "synchronization preparation" debugging command is distributed to the slave cores by the target machine's main core "debugging agent";
[0059] c) When the CPU core receives the "synchronous preparation" debugging command, the "debugging agent" debugging command processing module of each core suspends the core and waits;
[0060] d) After the debugging device delays for 500ms, the debugging control software controls the discrete control card to send a 10ms low pulse "running signal" to the target machine;
[0061] e) If Figure 6 After the target machine receives the "run signal", the "debugging agent" of each core on the target machine compensates the system Timer300us interrupt response time, then exits the interrupt handler and restores the synchronous operation between the cores.
[0062] The above is only a specific embodiment of the present invention, and the present invention is described in detail. The unexplained part is a conventional technology. However, the protection scope of the present invention is not limited to this. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for synchronous debugging of multi-core processors, characterized in that: The method is applied to a host side, the host side includes a debug bus interface, a discrete control card and control software; the method includes: The discrete control card generates a stop signal or a run signal and sends the stop signal to the target machine end; wherein the stop signal is used to control the multi-core processor to achieve synchronous stop; The control software generates a software signal, and sends the software signal and the operation signal to the target machine end; wherein the software signal is used to control the multi-core processor to be in a standby state; and the operation signal is used to control the multi-core processor to realize synchronous operation; The method specifically comprises: On the host side, the discrete control card is controlled by the debug control software to send a reset pulse signal to the target machine. The reset pulse level and width need to be consistent with the reset signal required by the processor. On the host side, the discrete control card is controlled by the control software to send a stop signal to the target machine. The hardware stop signal reaches the interrupt controller of the multi-core processor, and the stop signal is delivered to all cores through the interrupt controller to ensure that all cores respond synchronously. After the multi-core synchronous stop of the target machine, the host can debug the target machine through the control software, and proceed to the next step after the debugging is completed; Two signals are sent continuously on the host side: first, the debugging control software sends a "synchronization preparation" debugging command to the target machine through the debugging bus; then, the control software performs synchronization delay; finally, the control software controls the discrete control card to send a "running signal" to the target machine; On the target machine side, after the multi-core processor core receives the "synchronous ready" signal, the debugging command processing module first suspends the core and waits; when the multi-core processor core receives the "run signal", it exits the interrupt handler at the same time and resumes synchronous operation.
2. The method according to claim 1, characterized in that: The discrete control card generates a stop signal and a run signal, and sends the stop signal to the target machine end, including: The control software sends an instruction to the discrete control card, and the discrete control card generates the stop signal based on the instruction and sends the stop signal to the target machine end.
3. The method according to claim 1, characterized in that The control software generates a software signal, and sends the software signal and the operation signal to the target machine end, including: The control software generates a software signal and sends the software signal to the main core; The operation signal is sent to an interrupt controller.
4. The method according to claim 3, characterized in that The discrete control card generates an operation signal, including: The control software sends instructions to the discrete control card, and the discrete control card generates the operation signal based on the instructions.
5. A method for synchronous debugging of multi-core processors, characterized in that: The method is applied to a target machine end, the target machine end includes a multi-core processor, and the multi-core processor includes an interrupt controller; the method includes: The interrupt controller receives a stop signal or a run signal, and controls the multi-core processor to stop synchronously based on the stop signal; wherein the multi-core processor includes a master core and a slave core; The master core receives the software signal, forwards the software signal to the slave core, and controls the master core and the slave core to run synchronously based on the software signal and the running signal; wherein the software signal is a preparation signal for the master core and the slave core to run synchronously; The method specifically comprises: On the host side, the discrete control card is controlled by the debug control software to send a reset pulse signal to the target machine. The reset pulse level and width need to be consistent with the reset signal required by the processor. On the host side, the discrete control card is controlled by the control software to send a stop signal to the target machine. The hardware stop signal reaches the interrupt controller of the multi-core processor, and the stop signal is delivered to all cores through the interrupt controller to ensure that all cores respond synchronously. After the multi-core synchronous stop of the target machine, the host can debug the target machine through the control software, and proceed to the next step after the debugging is completed; Two signals are sent continuously on the host side: first, the debugging control software sends a "synchronization preparation" debugging command to the target machine through the debugging bus; then, the control software performs synchronization delay; finally, the control software controls the discrete control card to send a "running signal" to the target machine; On the target machine side, after the multi-core processor core receives the "synchronous ready" signal, the debugging command processing module first suspends the core and waits; when the multi-core processor core receives the "run signal", it exits the interrupt handler at the same time and resumes synchronous operation.
6. The method according to claim 5, characterized in that The interrupt controller receives the stop signal, and controls the multi-core processor to stop synchronously based on the stop signal, including: The interrupt controller receives the stop signal and delivers the stop signal to the multi-core processor; The multi-core processors are controlled to stop synchronously based on the stop signal.
7. The method according to claim 6, characterized in that The interrupt controller receives the operation signal, including: The interrupt controller receives the operation signal and delivers the operation signal to the master core and the slave core.
