QGen User Guide
- 1. QGen Toolset Presentation
- 2. Installation Instructions
- 3. QGen Code Generator
- 3.1. Using
qgenc
- 3.2. Prerequisites
- 3.3. Generating Code from the Simulink GUI
- 3.4. Generating Code from the MATLAB Command Line
- 3.5. Generating Code from the System Command Line
- 3.6. Errors and Warnings
- 3.7. Calling the generated code
- 3.8. Multirate models
- 3.9. User-specific Headers
- 3.10. Bus Signals
- 3.11. Custom Data Types
- 3.12. Naming Convention
- 3.13. Customizing Arithmetic Functions
- 3.14. Customizing Block Implementations
- 3.15. Detailed Code Generation Options
- 3.1. Using
- 4. QGen Compatibility Checker
- 5. QGen Model Debugger
- 6. QGen Model Debugger: Step by Step Tutorial
- 7. Integrating external code
- 7.1. Background
- 7.2. Using custom data types defined in external modules
- 7.3. Importing variables and constants defined in external modules
- 7.4. Calling C or Ada code using S-Function block
- 7.5. Option A: specify library information in Simulink
- 7.6. Option B: generate S-Function wrappers
- 7.7. Compiling and linking the generated code
- 7.8. Calling C or Ada codebases using QGen-SFun block
- 8. QGen Constraints on Input Models
- 8.1. Simulink Version
- 8.2. Simulink Block Types and Constraints
- 8.3. Other Simulink Constraints
- 8.3.1. Model Configuration Parameters
- 8.3.2. Blocks Configuration
- 8.3.3. Signal Dimensions
- 8.3.4. Data Dictionaries
- 8.3.5. Library Factorization
- 8.3.6. Custom Data Types
- 8.3.7. Use of Callback Functions
- 8.3.8. Real-valued Computations Only
- 8.3.9. Bus Signals
- 8.3.10. Forwarding Tables in Libraries
- 8.3.11. MISRA Simulink Guidelines
- 8.3.12. Simulink Coder(TM) Parameters
- 8.4. MATLAB
- 8.4.1. MATLAB .p and .mat Files
- 8.4.2. MATLAB Code for Parameters in Workspace Containers and Block Parameters
- 8.4.3. MATLAB Operators
- 8.4.4. MATLAB Functions
- 8.4.5. MATLAB Expressions
- 8.4.6. MATLAB cell arrays
- 8.4.7. Supported Enumerations
- 8.4.8. Char Arrays
- 8.4.9. Empty Arrays
- 8.4.10. Evaluable Simulink Expressions
- 8.5. Stateflow chart modelling rules
- 8.5.1. Event broadcast for local events shall not to be used
- 8.5.2. Output event of a chart shall have the “Function call” trigger type
- 8.5.3. [REMOVED]
- 8.5.4. [REMOVED]
- 8.5.5. Transition actions shall not be used in graphical functions and pure flow-graph decompositions. Condition actions shall be used instead.
- 8.5.6. An OR decomposition must always have an unguarded default transition
- 8.5.7. [REMOVED]
- 8.5.8. Boxes shall only be used for grouping functions
- 8.5.9. Only bounded flow-graph loops should be used
- 8.5.10. The transition arc shall not leave its logical parent’s boundary
- 8.5.11. Super step semantics shall not be used
- 8.5.12. Variable-size arrays shall not be used
- 8.5.13. Only C action language shall be used
- 8.5.14. Moore charts shall not be used for breaking data loops
- 8.5.15. Simulink functions shall not be used
- 8.5.16. History junctions shall not be used
- 8.5.17. [CHANGED] Absolute-time temporal logic shall not be used
- 8.5.18. Change detection functions shall not be used
- 8.5.19. ‘in <state>’ operator shall not be used
- 8.5.20. Data stores shall only be accessed through chart’s I/O
- 8.5.21. Some C math functions are not supported
- 8.5.22. Messages and queued communication are not supported
- 8.5.23. An AND decomposition must not contain transitions or junctions
- 8.5.24. Nested graphical functions are not supported
- 8.5.25. Boxes are not supported in functions
- 8.5.26. Machine-level data are not supported
- 8.5.27. Box-level data are not supported
- 8.5.28. Simulink states are not supported
- 8.5.29. Custom C code is not supported
- 8.5.30. Literal code (the literal code symbol ‘$’) is not supported
- 8.5.31. The ‘change’ (‘chg’) event is not supported
- 8.5.32. The time symbol ‘t’ is not supported
- 8.5.33. The reference ‘*’ and dereference ‘&’ operators are not supported
- 8.5.34. The shorthand notation for combining multiple state action conditions is not supported
- 8.5.35. Explicit type cast operator ‘cast’ is not supported
- 8.5.36. The type reference operator ‘type’ is not supported
- 8.5.37. [CHANGED] The ‘bind’ keyword is not supported
- 8.5.38. The ‘Saturate on integer overflow’ property of a Stateflow chart must be set to “off”
- 8.5.39. The ‘Create output for monitoring’ property of a Stateflow chart or state must be set to “off”
- 8.5.40. Stateflow functions with multiple output data definitions are not supported
- 8.5.41. Stateflow functions with non-scalar output must only be used in simple assignments
- 8.5.42. Inlining graphical functions is not supported
- 8.5.43. The first index of non-scalar data must be 0 (default)
- 8.5.44. Atomic subcharts are not supported
- 8.5.45. Strong data typing with Simulink I/O must be used
- 8.5.46. Commented out elements are not supported
- 8.5.47. Object names must not coincide with keywords
- 8.5.48. Transition paths involving states must not contain flow-graph loops
- 8.5.49. Atomic boxes are not supported
- 8.5.50. “Data must resolve to signal object” is not supported for local data
- 8.5.51. “Treat Exported Functions as Globally Visible” option is not supported
- 8.6. Target Languages
- 8.7. XMI Support
- 9. Reporting Suggestions and Bugs
- 10. Appendix A: Errors and warnings
Acknowledgments
QGen was developed with support from FUI Project P and EuroStars project Hi-MoCo (E6037, EU40149).