1. QGen Toolset Presentation

QGen is a Code Generation toolsuite for Simulink® and Stateflow®. Its primary function is code generation from Simulink® and Stateflow® model to C or Ada/SPARK code. The toolset also includes model-level and S-Function debugging with the QGen Debugger add-on.

_images/qgen_toolset.png

QGen is officially supported for MATLAB® R2015b up to R2020b. The toolset most likely works on older and more recent versions of MATLAB but there is no guarantee. We continue to support new MATLAB versions as they come out.

The QGen Code Generator section presents and details the usage of the QGen Code Generator.

The QGen Code Generator is being qualified at Tool Qualification Level 1, which is the highest level of qualification recognized by the FAA and DO-178C standard. For more information about the credits that can be claimed by a project using the Qualified tool and pricing information please visit the https://www.adacore.com/qgen/enterprise webpage or contact us through the ticket system within GNATtracker or by sending an email with your account number in the subject #XXXX to qgen@adacore.com.

The supported subset of QGen is made of 120 Simulink blocks with the majority of the settings available for each block, and a set of Stateflow features that are essential for embedded software. A variety of mechanisms for refining the model and tuning code generation is supported such as Simulink.Signal, Parameters, workspace containers (data dictionaries, model workspace), masks, Storage classes … The detail of the QGen supported subset can be found in the QGen Constraints on Input Models section.

QGen also comes with full IDE integration, with GNATStudio being used to provide a unique model level debugger, allowing to quickly compile the generated code and analyze its behavior in order to find modeling issues, see the QGen Model Debugger and QGen Model Debugger: Step by Step Tutorial sections. This also comes with the capability to build and debug S-Functions for C and Ada as well as debugging them while they are simulated in Simulink, see Calling C or Ada codebases using QGen-SFun block.