导航

ACTA AERONAUTICAET ASTRONAUTICA SINICA ›› 2021, Vol. 42 ›› Issue (9): 325177-325177.doi: 10.7527/S1000-6893.2021.25177

• Electronics and Electrical Engineering and Control • Previous Articles     Next Articles

Tracing method from embedded processor P2020 machine code program to C language source program

XIE Wenguang1, LI Qi3, MA Chunyan3, WANG Kenian1, YIN Wei2, ZHANG Tao3   

  1. 1. Key Laboratory of Civil Aircraft Airworthiness Technology, College of Airworthiness, Civil Aviation University of China, Tianjin 300300, China;
    2. AVIC Radio Electronics Research Institute, Shanghai 200241, China;
    3. School of Software, Northwestern Polytechnical University, Xi'an 710072, China
  • Received:2020-12-29 Revised:2021-01-31 Published:2021-04-21
  • Supported by:
    National Natural Science Foundation of China (61601468); Aeronautical Science Foundation of China (20185853038,2015ZD53055)

Abstract: The processor PowerPC P2020 is widely used in aeronautical embedded systems. To satisfy the airworthiness requirements of the A-level software in RTCA/DO-178C, a method of tracing from the PowerPC P2020 machine code program to the C language source program is proposed on three levels of codes:file, function declaration, and function body. On the basis of obtaining the C language source and the PowerPC P2020 machine code program file name list, the traceability of the PowerPC P2020 machine code file name is realized. By traverse the C source program abstract syntax tree and PowerPC P2020 machine code to get the list of function names, traceability of the PowerPC P2020 machine code function declaration is realized. By defining the abstract syntax tree node of the C language program to generate the expected assembly instruction sequence rules, traceability of the PowerPC P2020 machine code function body is realized. By designing 245 C language source program files and 345 PowerPC P2020 machine code program files, 1 111 C language function declarations and 1 273 PowerPC P2020 machine code function declarations, as well as 460 test cases covering 23 types of syntax structures of C language programs, effectiveness of the automatic tracing method from the PowerPC P2020 machine code program to the C language source program is verified. The results show that the traceability matching rate of document traceability and function declaration traceability reaches 100%, and the average traceability matching rate of the PowerPC P2020 function body and the C language source program function body code reaches 97.22%. The traceability matching results can check whether exception codes are inserted into the P2020 machine code program during the compilation process, so as to prevent potential safety hazards and ensure the safety and reliability of the embedded safety critical software object codes used in aerospace.

Key words: P2020 machine code, C language source program, tracing, source code analysis, compiler validation

CLC Number: