Embedded Code Generation
Production code generation converts models into production code for electronic control units (ECUs) in seconds or minutes instead of weeks or months, which has enabled OEMs and suppliers to complete complex ECU projects in 18 months, achieve 90% code reuse, and start a vehicle on the first attempt.
With millions of lines of code automatically generated using MathWorks products running in ECUs today, The MathWorks continues to develop innovative technologies that production organizations need for software architecture and design, production code generation and integration, code verification, and ISO 26262 certification.
Simulink and Stateflow are used by OEMs and suppliers to develop powertrain, chassis, safety, body, infotainment, and other automotive system designs. Using executable specifications instead of static diagrams accelerates design, clearly expresses the algorithm’s intended behavior, and enables early verification and validation. Key architecture and design features supported include AUTOSAR software component modeling and floating- to fixed-point data conversion using Fixed-Point Designer™.
Embedded Coder® generates embedded code from design models. The code can be used for on-target rapid prototyping or production code deployment. With on-target rapid prototyping, algorithms are run on the actual or emulated production ECU, reducing hardware cost and improving execution fidelity. With production code generation, ANSI/ISO C or C++ is generated by default for any device. In addition, code is easily optimized for specific MCUs or DSPs using flexible APIs. Integrating hand-written code during simulation or code generation is supported using the legacy code tool, preserving your software investment and enabling incremental adoption of code generation technology.
AUTOSAR Code Generation (Example)
Target-Optimized Code (PDF)
Software-in-the-loop (SIL) and processor-in-the-loop (PIL) testing form the cornerstone of production code verification by automating execution and comparison of code results with reference model behavior. Creating an environment to test your specific ECU is supported using PIL APIs. Bidirectional linking of model and code allows you to trace each line to every block and state in the model, aiding debugging and verification. Optional support for commonly used IDEs and processors is available using Embedded Coder. Finally, Polyspace® code verifiers let you examine generated or hand-written code for possible run-time errors and MISRA C®-2004 code compliance.
Creating a PIL Environment (Example)
ISO 26262 and IEC 61508 automotive safety standards are important for chassis and safety applications. TÜV SÜD has certified Embedded Coder and Polyspace code verifiers, including MISRA C-2004 code analysis, to ISO 26262 and IEC 61508. The TÜV SÜD certificates and certification reports are available in the IEC Certification Kit. TÜV SÜD certifications are based on application-specific verification and validation workflows that are also provided in the IEC Certification Kit.
"Simulink had a remarkable effect. It allowed us to design software in Simulink and automatically code it onto a real ECU."Read the story