Electronicdesign 8938 Adacorepromo
Electronicdesign 8938 Adacorepromo
Electronicdesign 8938 Adacorepromo
Electronicdesign 8938 Adacorepromo
Electronicdesign 8938 Adacorepromo

Generate Qualifiable and Tunable Code Using Model-Based Tools

Oct. 31, 2016
Adacore’s QGen generates qualifiable and tuneable MISRA C or SPARK code based on Mathworks Simulink and Stateflow models.

The demand for qualified code is rising. It is already a requirement for applications such as avionics where the process is rigorous. A completely different process is needed for automotive and medical applications, but the need for using the proper process and tools is there, as well.

Many applications can be defined using model-based development tools like the Mathworks Simulink and Stateflow tools. There are other graphically oriented model-based tools like National Instruments' LabView. There is also the Object Management Group's (OMG) Unified Modeling Language (UML). UML is available from a number of vendors, and the open-source Eclipse project supports UML with its Model Development Tools (MDT).

Most of these model-based tools can be used to generate code using languages like C, C++, and Java. For example, The Eclipse UML to Java Generator uses the Acceleo code generator to transform UML code to Java code. This allows for the creation of applications directly from models without requiring manual translation. The challenge for developers requiring qualified code is that the process starts with the generated code. This can be challenging if changes need to be on the generated code side.

Adacore’s QGen generates qualifiable and tuneable MISRA C or SPARK, a subset of Ada 2012, code based on Mathworks Simulink and Stateflow models (Fig. 1). The keyword is qualifiable.

1. Adacore’s QGen generates qualifiable and tunable MISRA C or SPARK code based on Mathworks Simulink and Stateflow models like this.

Adacore provides DO-178B/C, EN 50128 and ISO 26262 qualification material for both the code generator and the model verification tools that are part of QGen. The QGen code generator also has a TQL1 qualification kit.

In addition, QGen uses static analysis to detect errors. This addresses safety and logic errors, and run time checking can be included, as well. Functional and safety properties are modeled using the Assertion block.

There are some restrictions, though, because QGen works on a safe subset of more than 120 Simulink block types. This allows the models to be provable, and is also why MISRA C and SPARK are the targets. Both are subsets of their respective languages, C and Ada, that target qualifiable applications. Part of the idea is to remove error prone code before it can be included in an application. QGen is integrated with Simulink to allow compatibility checking of models (Fig. 2).

2. QGen is integrated with Simulink to allow compatibility checking of models for compatibility with the code generator.

QGen is integrated with AdaCore’s GNATemulator and GNATcoverage tools. This allows streamlined Processor-In-the-Loop (PIL) testing. GNATcoverage structural coverage analysis is provided up to MC/DC without any code instrumentation during PIL testing.

Not all applications will require the level of qualification that QGen can deliver, but that does not mean it should not be considered for applications where qualification is not a requirement. One of the reasons for qualifying an application is to greatly reduce the number of or eliminate all errors. This is usually a goal for most applications, although attaining that level can be costly. Using a code generator like QGen can move towards that goal while reducing programming and debugging costs.

Sponsored Recommendations

Understanding Thermal Challenges in EV Charging Applications

March 28, 2024
As EVs emerge as the dominant mode of transportation, factors such as battery range and quicker charging rates will play pivotal roles in the global economy.

Board-Mount DC/DC Converters in Medical Applications

March 27, 2024
AC/DC or board-mount DC/DC converters provide power for medical devices. This article explains why isolation might be needed and which safety standards apply.

Use Rugged Multiband Antennas to Solve the Mobile Connectivity Challenge

March 27, 2024
Selecting and using antennas for mobile applications requires attention to electrical, mechanical, and environmental characteristics: TE modules can help.

Out-of-the-box Cellular and Wi-Fi connectivity with AWS IoT ExpressLink

March 27, 2024
This demo shows how to enroll LTE-M and Wi-Fi evaluation boards with AWS IoT Core, set up a Connected Health Solution as well as AWS AT commands and AWS IoT ExpressLink security...

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!