Code Generation Verification – Assessing Numerical Equivalence between Simulink Models and Generated Code
G. Sandmann,M. Conrad,T. Erkkinen,Thomas Maier-Komor,Marty Pomeroy
Abstract:With the advent of Model-Based Design and production code generation, the ability to demonstrate that the generated object code correctly implements the model used for code generation, i.e. to show the correctness of the model-to-code transformation result, becomes inherent. Various approaches to verify the model-to-code translation result in practice, i.e., to efficiently and effectively assess the correctness of translating real word Simulink models into embedded C code, have been proposed and applied by engineering professionals. Unfortunately, many of these approaches do not exploit the advantages of Model-Based Design and more or less carry out the translation validation of generated code in the same manner as for hand-written code. In this paper, the authors will present Code Generation Verification (CGV) an automated, testing-based approach to assess the numerical equivalence between Simulink models and the generated code. In the CGV approach, each individual model-tocode translation is followed by a verification phase to assess that the input (i.e., the Simulink model used for code generation) and the output (i.e., the target code produced during code generation and compilation) of this translation produce the same numerical results when stimulated with identical inputs. The paper describes the proposed verification approach, and illustrates it by using Simulink and Real-Time Workshop Embedded Coder. It also discusses this approach in the context of high-integrity application development by embedding it into code verification workflows for IEC 61508 and ISO 26262.
Engineering,Computer Science