The article demonstrates how modeling design patterns can be used to generate efficient C code
| Date | Contributor | Description | Rating |
|---|---|---|---|
| 8 Oct 2009 | Linda Webb |
A key step in Model-Based Design is the generation of C code and deployment of an algorithm onto a target processor in the production environment. There are many different ways to implement the same algorithm in a Simulink® model; the quality of the generated C code will depend on
Using a do-while loop as an example, this article focuses on optimizing the algorithm at stage A. We demonstrate how modeling design patterns can be used to generate efficient C code. You can further optimize your algorithms when compiling C source code into object code by using Target Function Libraries. For details, see the paper “Generating Target-Optimized Code Using Target Function Libraries. A modeling design pattern is much like a software design pattern used in object-oriented literature. It is a template containing modeling elements that can be reused in commonly recurring design problems. Figure 2 shows an example of a modeling design pattern for do-while logic implemented in Stateflow®. This pattern can be used to generate the common do-while loop construct in the C code. By Bill Chou, The MathWorks This article was published in MATLAB Digest, September 2009 |
| Tag | Applied By | Date/Time |
|---|---|---|
| paper | Linda Webb | 8 Oct 2009 at 11:18am |
| article | Linda Webb | 8 Oct 2009 at 11:18am |
| whitepaper | Linda Webb | 8 Oct 2009 at 11:18am |
| design pattern wizard | Linda Webb | 8 Oct 2009 at 11:18am |
| stateflow | Linda Webb | 8 Oct 2009 at 11:18am |
| loc | Linda Webb | 8 Oct 2009 at 11:18am |
| lines of code | Linda Webb | 8 Oct 2009 at 11:18am |
| d-while loop | Linda Webb | 8 Oct 2009 at 11:18am |
| object code | Linda Webb | 8 Oct 2009 at 11:18am |
| modeling design pattern | Linda Webb | 8 Oct 2009 at 11:18am |
| modeling | Linda Webb | 8 Oct 2009 at 11:18am |
| source code | Linda Webb | 8 Oct 2009 at 11:18am |
| code generation | Linda Webb | 8 Oct 2009 at 11:17am |
| deployment | Linda Webb | 8 Oct 2009 at 11:17am |
| c code | Linda Webb | 8 Oct 2009 at 11:17am |
| model-based design | Linda Webb | 8 Oct 2009 at 11:17am |