| Fully and comprehensive testing of various intelligent embedded software before the deployment of the vehicle infrastructure cooperative systems is a key technology to ensure the large-scale application of the system.The testing of embedded software of the system usually requires collecting and analyzing various kinds of information when the software is running.The traditional software tracing method requires additional resource overhead,and the cost of customized debugging hardware is too high and the flexibility is poor,which cannot meet the requirements of embedded software testing of the system.Hardware-assisted tracing technology uses the processor’s internal on-chip tracing unit to help the embedded software developers to obtain the detailed execution trajectory of the application with limited resource overhead.However,hardware-assisted tracing technology will generate a large amount of tracing data(a single node generates GB-level tracing data every minute),and the existing offline analysis methods of tracing data are not applicable.Based on the national key research and development program of China(No.2018YFB1600800),this paper researches and implements the testing platform HATBED2 based on hardware-assisted tracing data online collection and analysis.The main work of this paper is as follows:(1)Design and realization of the testbed.HATBED2 is composed of a three-layer structure of the targets,observers,and controller,which can realize the functions of distributed embedded software testing,tracing data storage and offline analysis,software quality online evaluation,networked timing online analysis,and state machine online testing.The targets are the MCU running embedded software in the system.The observers take the Zynq development platform as the core,can realize the tracing data storage,code coverage(function,sentence,basic block,function profile)and state machine coverage(state coverage and state transition path coverage)online analysis function.HATBED2 builds an accuracy in the ns level of interested key event time-marking system through the combination of FPGA clock counting and GPS time.The controller is a high-performance computer server that runs Python automated data processing scripts to realize online test data preprocessing and tracing data offline analysis functions.(2)Benchmark performance evaluation of the testbed.The benchmark performance test of the testbed HATBED2 was carried out from the three aspects of program running tracing data collection,code coverage,and time accuracy.In terms of tracing data collection,HATBED2 can realize continuous online collection and analysis of the tracing data output by the measured target at the highest frequency,effectively solving the problem of loss of key events.In terms of code coverage testing,HATBED2 tested the EEMBC benchmark program Coremark,and the error between the test results of function,statement and basic block coverage and the theoretical value was within 4%.In terms of time accuracy performance,HATBED2 can realize ns level time accuracy analysis of key events among multiple measured targets.(3)Construction and testing of typical vehicle infrastructure cooperative systems examples.Starting from the real application scenarios of the system,the intersection was selected as the test scenario,and a test case composed of on-board units and roadside units was constructed.For the test case,HATBED2 tested the embedded software from three aspects: the vehicle-toroad communication timing,the state machine of the on-board unit,and the UDP network protocol stack of the road-side unit.HATBED2 performs detailed time sequence analysis on vehicle-to-vehicle conflict reduction scenarios based on vehicle-to-road communication,and provide high-precision time sequence analysis results.For the state machine of the on-board unit,tests are carried out from two aspects: states coverage and transition path coverage.The UDP communication process in the RIOT-OS environment is analyzed by function coverage,basic block coverage,and function profile.The test results show that Hatbed2 can effectively and adequately test and evaluate the embedded software of vehicle infrastructure cooperative systems. |