PCIe Bus Simulation Method for Airborne Embedded Software Based on Network Communication
Through network communication, the PCIe bus communication is simulated and the same driver software interface is designed, which solves the problem of lack of PCIe hardware in onboard embedded software testing, and effectively verifies the PCIe communication function, improving the test quality and efficiency.
Patent Information
- Application Number
- CN202210993808.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2042-08-18
AI Technical Summary
In onboard embedded software testing, the lack of PCIe bus hardware makes it impossible to verify software functions involving PCIe communications, and the customization cycle of dedicated test environments is long and costly.
Through network communication, simulate PCIe bus communication, design the same driver software interface, replace the real hardware driver with analog driver, and realize the simulation and verification of PCIe bus communication.
In a test environment lacking PCIe hardware, the PCIe communication function in the tested software can be effectively verified, improve the adequacy and quality of the test, and reduce the testing cost.
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer software testing, and particularly relates to a method for simulating a PCIe bus of airborne embedded software based on network communication. Background Art
[0002] When testing airborne embedded software, there is a situation where the general test platform lacks PCIe bus hardware, and it is impossible to construct a test scenario composed of multiple PCIe buses and multiple PCIe bus device nodes. As a result, it is impossible to verify the functions related to PCIe communication in the software under test, making the dynamic software testing unable to cover the corresponding software requirements, resulting in insufficient software testing and affecting the test quality. If a dedicated test environment is established for sporadic test tasks involving PCIe communication, additional dedicated hardware needs to be customized, and the customization cycle is long, the cost is high, and the overall cost-effectiveness is low. Summary of the Invention
[0003] In order to overcome the deficiencies of the prior art, the present invention provides a method for simulating a PCIe bus of airborne embedded software based on network communication. By simulating PCIe bus communication through network communication, and simulating multiple PCIe buses and multiple device nodes on each bus, using network communication to perform data reception / transmission between device nodes, and simulating data reading and writing operations between multiple device nodes, through monitoring and recording network communication data, real-time monitoring of the simulated PCIe bus communication process and communication data recording are achieved. By designing the same driver software interface, it is possible to support replacing the real PCIe bus driver with a simulated driver without modifying the embedded software code, overcoming the problem that the lack of PCIe bus hardware in the test environment makes it impossible to verify relevant functions, and improving the sufficiency and quality of airborne embedded software testing.
[0004] A method for simulating a PCIe bus of airborne embedded software based on network communication, characterized by the following steps:
[0005] Step 1: Connect each test platform involved in the PCIe bus communication function test in the software test scenario to the same local area network using network cables;
[0006] Step 2: Configure PCIe simulation driver parameter files for each test platform, including setting the same bus number for the test platforms mounted on the same PCIe bus and assigning different PCIe device numbers to each device;
[0007] Step 3: Use network communication to perform data reception / transmission between device nodes, and combine the data caching mechanism within the nodes to simulate data reading and writing operations between device nodes;
[0008] The process of data writing operation between the simulated device nodes is as follows: The device node initiating the writing operation sends the written data and the target memory address to the device node to be written through the network; the device node to be written receives the data and address information, and writes the data at the target memory address in the buffer area;
[0009] The process of data reading operation between the simulated device nodes is as follows: The device node initiating the reading operation sends a reading command and the target memory address to the device node to be read through the network; the device node to be read receives the command and memory information, reads the data at the target memory address in the buffer area, and returns the read data through the network.
[0010] Step 4: Design the PCIe simulation driver interface to be the same software interface as the real PCIe hardware driver. In each tested software code project on each test platform, use the PCIe simulation driver file to replace the original real PCIe hardware driver file as a whole, and add the configured parameter file to each tested software code project, and then compile and deploy them to the test platform in sequence;
[0011] Step 5: Connect the computer with the communication monitoring and recording software to the established local area network to monitor and record the simulated PCIe communication process and data in the local area network;
[0012] Step 6: Run the test cases involving the PCIe bus communication function on each test platform to verify the relevant functions in the tested software.
[0013] The beneficial effect of the present invention is that: based on network communication, the functions and characteristics of the PCIe bus are simulated, so that when there is a lack of PCIe hardware in the airborne embedded software test environment, the commonly existing Ethernet hardware can be used to test and verify the PCIe communication function in the tested software. Specific embodiments
[0014] The present invention provides a method for simulating the PCIe bus of airborne embedded software based on network communication, and its specific embodiments are as follows:
[0015] 1) Connect each test platform involved in the PCIe bus communication function test in the software test scenario to the same local area network using network cables, that is, build a local area network by using Ethernet cables and switches to realize simulating PCIe bus communication with Ethernet communication. In this way, it is possible to transmit the data originally transmitted in the PCIe bus through the Ethernet based on TCP and UDP communication, and replace the PCIe bus hardware to simulate the data communication between the devices mounted on the PCIe bus. Among them, the bandwidth, fault tolerance, rate, etc. of the PCIe bus communication simulated based on the network are the same as those of the real PCIe bus communication.
[0016] 2) Configure PCIe simulation driver parameter files for each test platform, set the same bus number for the test platforms mounted on the same PCIe bus, and assign different PCIe device numbers to each device. In this way, multiple PCIe buses can be simulated simultaneously within a local area network, and multiple device nodes on each bus can be simulated. Moreover, the simulated multiple PCIe buses do not interfere with each other and operate independently for communication functions. The simulated multiple device nodes belong to their respective PCIe buses, and the communication between devices is restricted within the simulated PCIe buses.
[0017] 3) Use network communication to receive / send data between device nodes, and combine the data caching mechanism within the nodes to simulate the data reading and writing operations between device nodes.
[0018] The process of data writing operation is as follows: The device node initiating the writing operation sends the written data and the target memory address to the device node to be written through the network; the device node to be written receives the data and address information, and writes the data at the target memory address in the buffer.
[0019] The process of data reading operation is as follows: The device node initiating the reading operation sends a reading command and the target memory address to the device node to be read through the network; the device node to be read receives the command and memory information, reads the data at the target memory address in the buffer, and returns the read data through the network.
[0020] 4) Design the PCIe simulation driver interface into the same software interface as the PCIe real hardware driver. In the software code project of the software under test on each test platform one by one, use the PCIe simulation driver file to replace the original PCIe real hardware driver file as a whole, and add the configured parameter file to each software code project under test, and then compile and deploy them to the test platform in sequence.
[0021] Since the PCIe simulation driver interface is designed into the same software interface as the PCIe real hardware driver, it can support directly replacing the PCIe bus real driver file with the simulation driver file without modifying the embedded software code, and at the same time does not affect the compilation and deployment of the software code.
[0022] 5) Connect the computer with communication monitoring and recording software to the previously established local area network to achieve real-time monitoring of the simulated PCIe bus communication process and recording of communication data.
[0023] 6) Run the test cases involving PCIe bus communication functions on each test platform to verify the relevant functions in the software under test.
Claims
1. An airborne embedded software PCIe bus simulation method based on network communication, characterized in that The steps are as follows: Step 1: Connect each test platform involved in the PCIe bus communication function test in the software test scenario to the same local area network using network cables; Step 2: Configure the PCIe simulation driver parameter files for each test platform, including setting the same bus number for the test platforms mounted on the same PCIe bus and assigning different PCIe device numbers to each device; Step 3: Use network communication to perform data reception / transmission between each device node, and combine the data caching mechanism within the node to simulate the data reading and writing operations between device nodes; The process of simulating the data writing operation between device nodes is as follows: The device node initiating the writing operation sends the written data and the target memory address to the device node to be written through the network; the device node to be written receives the data and address information and writes the data at the target memory address in the buffer; The process of simulating the data reading operation between device nodes is as follows: The device node initiating the reading operation sends the read command and the target memory address to the device node to be read through the network; the device node to be read receives the command and memory information, reads the data at the target memory address in the buffer, and returns the read data through the network; Step 6: Design the PCIe simulation driver interface into the same software interface as the PCIe real hardware driver. In the tested software code project of each test platform one by one, use the PCIe simulation driver file to replace the original PCIe real hardware driver file as a whole, add the configured parameter file to each tested software code project, and compile and deploy them to the test platform in sequence; Step 7: Connect the computer with the communication monitoring and recording software installed to the established local area network to monitor and record the simulated PCIe communication process and data within the local area network; Step 8: Run the test cases involving the PCIe bus communication function on each test platform to verify the relevant functions in the tested software.
Citation Information
Patent Citations
Model-based airborne embedded software test environment construction method
CN107678946A
Embedded bus communication detection system and reliability detection method thereof
CN110650066A