Method for synchronizing virtual target machine and data excitation software
By designing a synchronous communication method between the virtual target machine and the data excitation software, ensuring that the two runs simultaneously, the data frame loss and repetition problems caused by inconsistent cycles and phases between the virtual target machine and the data excitation software are solved, and the credibility of monitoring data is improved.
Patent Information
- Application Number
- CN202411983956.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
The period and phase of the virtual target machine and the data excitation software are inconsistent, resulting in the data excitation software that has frame drop problems when injecting data. The output data records of the virtual target machine are duplicated or frame drops, and the monitoring data is low.
By designing communication and handshake between the virtual target machine and the data excitation software, we ensure that the virtual target machine and the data excitation software run simultaneously. The virtual timer in the virtual target machine triggers a timing interrupt and sends a running ready signal through network communication. The data excitation monitoring software starts running and injects data after receiving the signal.
The virtual target machine and data excitation software are implemented to run at the same phase in the same period, solving the frame drop and repetition problems of data output by virtual target machine, and improving the credibility of monitoring data.
Smart Images

Figure CN119938356A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of software synchronization, and in particular to a method for synchronizing a virtual target machine with data excitation software, which realizes high-reliability simulation data injection and output data monitoring of the virtual target machine through periodic synchronization between the virtual target machine software and the data excitation software. Background Art
[0002] In order to reduce the dependence of software developers on hardware and improve the efficiency of software development and testing, the development and testing methods based on target machine hardware have gradually changed. Currently, developing virtual target machines on the PC side is a common development solution. In the process of this digital technology development, developers have also ushered in more challenges.
[0003] In order to simulate the data communication between the physical hardware and the external bus, the virtual target machine mostly uses PC simulation software for data stimulation and detection. Since the two application software, data stimulation software and virtual target machine, have different periodic timing trigger mechanisms and use different periodic trigger sources, there are differences in the operating frequencies and periods of the two software, resulting in many problems in the output data recording of the virtual target machine.
[0004] For example, when the cycles of the data excitation software and the virtual target machine are inconsistent, the data excitation software will have frame loss problems when injecting data, and the data monitoring software will have data duplication or frame loss problems when recording the output of the virtual target machine; when the cycles of the data excitation software and the virtual target machine are consistent, but there are differences in the execution phases, the virtual target machine input data reading and data excitation may conflict, and the virtual target machine output data writing and data monitoring may conflict, ultimately resulting in chaotic monitoring data and low credibility. Summary of the invention
[0005] The purpose of the present invention is: the present invention proposes a method for synchronizing a virtual target machine with data excitation software, designs the communication and handshake mode of the two software, realizes the purpose of the virtual target machine and the data excitation software having the same cycle and the same phase, and improves the credibility of the monitoring data of the virtual target machine.
[0006] The present application provides a method for synchronizing a virtual target machine with data stimulus software, the method comprising:
[0007] The virtual timer in the virtual target machine triggers a timer interrupt according to the timer time configured in the device executable target code;
[0008] The virtual target machine sends a "ready to run" flag to the data stimulus monitoring software at the same time as the virtual timer interrupt is triggered;
[0009] When the data stimulus monitoring software receives the run-ready status of the virtual target machine, it starts running and performs two activities at the same time: it feeds back the "stimulus ready" flag to the virtual target machine; and it injects data into the simulated input buffer in the virtual target machine as the bus input value of one run cycle of the virtual target machine.
[0010] Preferably, the method further comprises:
[0011] The data stimulus monitoring software reads data from the output buffer of the virtual target machine and records the data as the bus output value of one cycle of the virtual target machine;
[0012] After reading the data, the data stimulus monitoring software enters a waiting state, waiting for the next "ready to run" flag of the virtual target machine.
[0013] Preferably, the method further comprises:
[0014] After receiving the "stimulus ready" flag from the data stimulus monitoring software, the virtual target machine starts running the virtual target machine software.
[0015] Preferably, after receiving the "stimulus ready" flag of the data stimulus monitoring software, the virtual target machine starts running the virtual target machine software, including:
[0016] Run executable object code on the virtual CPU;
[0017] Read bus input data from the virtual input buffer;
[0018] Operation instructions of a computing device;
[0019] Output bus data to the virtual output buffer.
[0020] Preferably, the method further comprises:
[0021] Prepare the embedded device virtual target machine.
[0022] Preferably, the virtual target machine should have the following characteristics:
[0023] The virtual target machine should run on the WINDOWS / LINUX system PC to simulate an embedded device; the virtual target machine should have storage device simulation and CPU simulation, simulating the memory and processor of the real target machine to run the binary target code of the embedded device; the virtual target machine should have input buffer and output buffer simulation to simulate the input and output of the external bus; the virtual target machine should have timer simulation to simulate the timing mechanism of the device and generate interrupts to start periodic tasks.
[0024] Preferably, the method further comprises:
[0025] Prepare the data stimulus monitoring software.
[0026] Preferably, the data incentive monitoring software should have the following features:
[0027] The data stimulus monitoring software should run on the same WINDOWS / LINUX system PC as the virtual target machine; the data stimulus monitoring software should be able to inject bus data into the virtual target machine periodically; the data stimulus monitoring software should be able to read the bus data output by the virtual target machine periodically; the data stimulus monitoring software should be able to communicate with the virtual target machine and receive the virtual target machine's ready-to-run signal.
[0028] Beneficial technical effects of this application:
[0029] The technical means of handshaking between the virtual target machine and the data excitation software in this application can ensure that the virtual target machine and the data excitation monitoring software run in the same cycle and phase, effectively solving the problem of out-of-beat operation of the virtual target machine and the data excitation software.
[0030] Furthermore, thanks to the technical means of data stimulation and reading of the virtual target machine by the data stimulation software, the data stimulation software can timely inject the input of the virtual target machine and collect the output of the virtual target machine to achieve the purpose of data injection and data collection without loss.
[0031] In summary, the present application realizes the synchronous injection and acquisition functions of data stimulus software to a virtual target machine, which has significant technical progress and practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a block diagram of a method for synchronizing a virtual target machine and data stimulus software provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The present application provides a method for synchronizing a virtual target machine with data stimulus software, including the following steps:
[0034] 1. Prepare a virtual target machine for embedded devices. The virtual target machine should have the following features: the virtual target machine should run on a PC such as WINDOWS / LINUX to simulate an embedded device; the virtual target machine should have storage device simulation and CPU simulation to simulate the memory and processor of the real target machine to run the binary target code of the embedded device; the virtual target machine should have input buffer and output buffer simulation to simulate the input and output of the external bus; the virtual target machine should have timer simulation to simulate the timing mechanism of the device and generate interrupts to start periodic tasks.
[0035] 2. Prepare data stimulus monitoring software. The data stimulus monitoring software should have the following features: the data stimulus monitoring software should run on the same WINDOWS / LINUX system PC as the virtual target machine; the data stimulus monitoring software should be able to inject bus data into the virtual target machine periodically; the data stimulus monitoring software should be able to read the bus data output by the virtual target machine periodically; the data stimulus monitoring software should be able to communicate with the virtual target machine and receive the virtual target machine's ready-to-run signal.
[0036] 3. The virtual timer in the virtual target machine triggers a timer interrupt according to the timer time configured in the device executable target code.
[0037] 4. When the virtual timer interrupt is triggered, the virtual target machine sends a "ready to run" flag to the data stimulus monitoring software through network communication or other software communication methods.
[0038] 5. When the data stimulus monitoring software receives the ready-to-run status of the virtual target machine, it starts running and performs two activities at the same time: it feeds back the "stimulus ready" flag to the virtual target machine through network communication or other inter-software communication methods; it injects data into the simulated input buffer in the virtual target machine through network communication or other inter-software communication methods as the bus output value of one running cycle of the virtual target machine.
[0039] 6. The data stimulus monitoring software reads data from the output buffer of the virtual target machine and records the data as the bus output value of one cycle of the virtual target machine. After reading the data, the data stimulus monitoring software enters the waiting state, waiting for the next "ready to run" flag of the virtual target machine.
[0040] 7. After receiving the "stimulus ready" flag from the data stimulus monitoring software, the virtual target machine starts running the virtual target machine software, including: running the executable target code on the virtual CPU; reading the bus input data from the virtual input buffer; calculating the device's operation instructions; and outputting the bus data to the virtual output buffer.
[0041] 8. The virtual target machine executes the contents of step 7 until the virtual timer interrupt arrives again, and then loops through the contents of steps 2 to 7.
[0042] See also Figure 1 In other embodiments of the present application, the specific method of the present invention is as follows:
[0043] 1. Prepare a virtual target machine for embedded devices. The virtual target machine is built by SKYEYE virtual software and runs on the PC side of the WINDOWS / LINUX system to simulate the flight control computer equipment hardware. The virtual target machine has storage device simulation, FLASH, RAM, and the simulated CPU core model is POWERPC755. It simulates the memory and processor of the real target machine to run the binary executable target code of the flight control computer device; the virtual target machine has input buffer and output buffer simulation, simulating the input and output of the flight control computer FPGA hardware address from the IMB external bus; the virtual target machine has timer simulation, simulating the 12.5ms operation cycle of the flight control computer, and generating interrupts to start periodic tasks.
[0044] 2. Prepare data stimulus monitoring software. The data stimulus monitoring software is the supporting data stimulus monitoring software for SKYEYE and also runs on the PC side of WINDOWS. The data stimulus monitoring software can inject and read buffer data into the virtual target machine periodically. The data stimulus monitoring software should communicate with the SKYEYE virtual target machine through the network. The two software are on the same PC but occupy different UDP ports.
[0045] 3. The virtual timer in the virtual target machine triggers a timer interrupt according to the timer time configured with a 12.5ms period and enters a waiting state.
[0046] 4. When the virtual timer interrupt is triggered, the virtual target machine sends a "ready to run" flag to the data stimulus monitoring software through network communication.
[0047] 5. When the data stimulus monitoring software receives the run-ready status of the virtual target machine, the data stimulus monitoring software starts running and performs two activities at the same time: through network communication, it feeds back the "stimulus ready" flag to the virtual target machine; through network communication, it injects the bus data of one run cycle into the simulated IMB input buffer in the virtual target machine as the bus output value of one run cycle of the virtual target machine.
[0048] 6. The data stimulus monitoring software reads data from the IMB output buffer of the virtual target machine and records the data as the bus output value of one cycle of the virtual target machine. After reading the data, the data stimulus monitoring software enters the waiting state, waiting for the next "ready to run" flag of the virtual target machine.
[0049] 7. After receiving the "stimulus ready" flag from the data stimulus monitoring software, the virtual target machine starts running the virtual target machine software, including: running the executable target code of the flight control computer on the virtual POWERPC755; reading bus input data from the IMB virtual input buffer; calculating the device's operation instructions; and outputting bus data to the IMB virtual output buffer.
[0050] 8. The virtual target machine executes the contents of step 7 until the 12.5ms interrupt of the virtual timer arrives again, and then loops through the contents of steps 2 to 7.
[0051] In other embodiments of the present application, the present invention provides a method for synchronizing a virtual target machine with data stimulus software, which belongs to the field of software synchronization. The method includes the following contents:
[0052] 1) The virtual target machine triggers a timer interrupt through a virtual timer;
[0053] 2) The virtual target machine transmits the ready-to-run signal to the data stimulus monitoring software;
[0054] 3) The data stimulus monitoring software injects simulation data into the virtual target machine and sends a stimulus ready signal;
[0055] 4) The data stimulus monitoring software reads the output of the virtual target machine and records it.
[0056] 5) After receiving the stimulus ready signal, the virtual target machine starts to execute the executable target code and runs the instructions on the virtual CPU;
[0057] 6) The CPU of the virtual target machine finishes running the instruction, the current cycle ends, and the virtual timer is waiting for the interrupt to be triggered, and steps 1-5 are repeated. The process of this method is as follows Figure 1 shown.
[0058] The method for synchronizing a virtual target machine with data excitation software provided by the present invention can ensure that the virtual target machine and the data excitation software are synchronously operated in the same cycle, thereby solving the problem of unreliable monitoring data caused by mismatch between the data excitation software and the virtual target machine.
Claims
1. A method for synchronizing a virtual target machine with data stimulus software, characterized in that: The method comprises: The virtual timer in the virtual target machine triggers a timer interrupt according to the timer time configured in the device executable target code; When the virtual timer interrupt is triggered, the virtual target machine sends a "ready to run" flag to the data stimulus monitoring software; When the data stimulus monitoring software receives the run-ready status of the virtual target machine, it starts running and performs two activities at the same time: feeding back the "stimulus ready" flag to the virtual target machine; and injecting data into the simulated input buffer in the virtual target machine as the bus input value of one run cycle of the virtual target machine.
2. The method according to claim 1, characterized in that: The method further comprises: The data stimulus monitoring software reads data from the output buffer of the virtual target machine and records the data as the bus output value of one cycle of the virtual target machine; After reading the data, the data stimulus monitoring software enters a waiting state, waiting for the next "ready to run" flag of the virtual target machine.
3. The method according to claim 1, characterized in that The method further comprises: After receiving the "stimulus ready" flag from the data stimulus monitoring software, the virtual target machine starts running the virtual target machine software.
4. The method according to claim 3, characterized in that: After receiving the "stimulus ready" sign from the data stimulus monitoring software, the virtual target machine starts running the virtual target machine software, including: Run executable object code on the virtual CPU; Read bus input data from the virtual input buffer; Operation instructions of a computing device; Output bus data to the virtual output buffer.
5. The method according to claim 1, characterized in that The method further comprises: Prepare the embedded device virtual target machine.
6. The method according to claim 5, characterized in that The virtual target machine should have the following characteristics: The virtual target machine should run on the WINDOWS / LINUX system PC to simulate an embedded device; the virtual target machine should have storage device simulation and CPU simulation, simulating the memory and processor of the real target machine to run the binary target code of the embedded device; the virtual target machine should have input buffer and output buffer simulation to simulate the input and output of the external bus; the virtual target machine should have timer simulation to simulate the timing mechanism of the device and generate interrupts to start periodic tasks.
7. The method according to claim 1, characterized in that The method further comprises: Prepare the data stimulus monitoring software.
8. The method according to claim 7, characterized in that The data incentive monitoring software should have the following features: The data stimulus monitoring software should run on the same WINDOWS / LINUX system PC as the virtual target machine; the data stimulus monitoring software should be able to inject bus data into the virtual target machine periodically; The data stimulus monitoring software should be able to read the bus data output by the virtual target machine periodically; The data stimulus monitoring software should be able to communicate with the virtual target machine and receive the virtual target machine's ready-to-run signal.