Skip to Main Content Skip to Search
Product Documentation

Understanding Code Generation

Code Generation with the Simulink Coder Product

You can use the DSP System Toolbox, Simulink Coder™, and Embedded Coder™ products together to generate code that you can use to implement your model for a practical application. For instance, you can create an executable from your Simulink model to run on a target chip.

This chapter introduces you to the basic concepts of code generation using these tools. For more information on code generation, see Program Building, Interaction, and Debugging the Simulink Coder documentation

Shared Library Dependencies

In general, the code you generate from DSP System Toolbox blocks is portable ANSI® C code. After you generate the code, you can deploy it on another machine. For more information on how to do so, see Relocate Code to Another Development Environment in the Simulink Coder documentation.

There are a few DSP System Toolbox blocks that generate code with limited portability. These blocks use precompiled shared libraries, such as DLLs, to support I/O for specific types of devices and file formats. To find out which blocks use precompiled shared libraries, open the DSP System Toolbox Block Support Table. You can identify blocks that use precompiled shared libraries by checking the footnotes listed in the Code Generation Support column of the table. All blocks that use shared libraries have the following footnote:

Host computer only. Excludes Real-Time Windows (RTWIN) target.

Simulink Coder provides functions to help you set up and manage the build information for your models. For example, one of the Build Information functions that Simulink Coder provides is getNonBuildFiles. This function allows you to identify the shared libraries required by blocks in your model. If your model contains any blocks that use precompiled shared libraries, you can install those libraries on the target system. The folder that you install the shared libraries in must be on the system path. The target system does not need to have MATLAB installed, but it does need to be supported by MATLAB.

Highly Optimized Generated ANSI C Code

All DSP System Toolbox blocks generate highly optimized ANSI C code. This C code is often suitable for embedded applications, and includes the following optimizations:

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS