Setting Real-Time Workshop® Category Options

Use the options in the Select tree under Real-Time Workshop to perform the following configuration tasks.

When you select one of the Embedded IDE Link VS system target files, the Embedded IDE Link VS category appears in the Select tree as shown in the following figure.

Target Selection

System target file

Clicking Browse opens the Target File Browser where you select vdsplink_grt.tlc as your Real-Time Workshop System target file. When you select your target configuration, Real-Time Workshop® software chooses the appropriate system target file, template make file, and make command. You can also enter the target configuration filename, and the software fills in the Template makefile and Make command selections.

If you are using Real-Time Workshop® Embedded Coder™ software, select the vdsplink_ert.tlc target file in System target file.

Build Process

Template makefile

Real-Time Workshop software uses template makefiles to generate the makefile for building the executable file. During the automatic build process, MATLAB® issues the make_rtw command. make_rtw extracts information from the template makefile vdsplink_grt.tmf and creates the actual makefile vdsplink.mk. When Real-Time Workshop software compiles the model, it uses the actual makefile to select the compiler to use to generate the compiled code.

Make command

When you generate code from your digital signal processing application, select Generate makefile and use the standard command make_rtw as the Make command. In the Build process area in the Real-Time Workshop category, enter make_rtw for the Make command. Parameters you set in this dialog box belong to the model you are building. They are saved with the model and stored in the model file.

Custom storage class

When you generate code from a model employing custom storage classes (CSC), clear Ignore custom storage classes. This setting is the default value for Embedded IDE Link VS software and for Real-Time Workshop Embedded Coder software.

When you select Ignore custom storage classes, storage class attributes and signals are affected in the following ways:

Ignore custom storage classes lets you switch to a processor that does not support CSCs, such as the generic real-time target (GRT), without reconfiguring your parameter and signal objects.

Generate code only

The Generate code only option does not apply to targeting with Embedded IDE Link VS software. To generate source code without building and executing the code on your processor, select Embedded IDE Link VS from the Select tree. Then, under Runtime, select Create_project for Build action.

Report Options

Two options control HTML report generation during code generation.

Create Code Generation report

After you generate code, this option tells the software whether to generate an HTML report that documents the C code generated from your model. When you select this option, Real-Time Workshop writes the code generation report files in the html subdirectory of the build directory. The top-level HTML report file is named modelname_codegen_rpt.html or subsystemname_codegen_rpt.html. For more information about the report, refer to the online help for Real-Time Workshop. You can also use the following command at the MATLAB prompt to get more information.

docsearch 'Create code generation report'

In the Navigation options, when you select Model-to-code and Code-to-model, your HTML report includes hyperlinks to various features in your Simulink model.

Launch report automatically

This option directs Real-Time Workshop to open a MATLAB Web browser window and display the code generation report. If you clear this option, you can open the code generation report (modelname_codegen_rpt.html or subsystemname_codegen_rpt.html) manually in a MATLAB Web browser window or in another Web browser.

Debug Pane Options

Real-Time Workshop software uses the Target Language Compiler (TLC) to generate C code from the model.rtw file. The TLC debugger helps you identify programming errors in your TLC code. Using the debugger, you can perform the following actions:

When you select Debug from the Select tree, you see the Debug options as shown in the next figure. In this pane, you set options that are specific to the Real-Time Workshop software process and TLC debugging.

For details about using the options in Debug, refer to About the TLC Debugger in your Real-Time Workshop Target Language Compiler documentation.

Optimization Pane Options

On the Optimization pane in the Configuration Parameters dialog box, you set options for the code that Real-Time Workshop software generates during the build process. Use these options to tailor the generated code to your needs. Select Optimization from the Select tree on the Configuration Parameters dialog box. The figure shows the Optimization pane when you select the system target file vdsplink_grt.tlc under Real-Time Workshop system target file.

The following options are typically selected for Real-Time Workshop software to provide optimized code generation for common code operations:

For more information about using these and the other Optimization options, refer to the Real-Time Workshop documentation.

Embedded IDE Link™ VS Pane Options

On the select tree, the Embedded IDE Link VS category provides options in these areas:

Link Automation

When you use Real-Time Workshop software to build a model to an Analog Devices processor, Embedded IDE Link VS software makes a connection between MATLAB software and the VisualDSP++® IDE. MATLAB software represents that connection as an adivdsp object. The properties of the adivdsp object contain information about the IDE instance it refers to, such as the session and processor it accesses. In this pane, the IDE link handle name option instructs Embedded IDE Link VS software to export the adivdsp object created during code generation to your MATLAB workspace with the name you enter. Replace the default name VDSP_obj with your own name for the object to export.

Code Generation

From this category, you select options that define the way your code is generated:

To enable the real-time execution profile capability, select Profile real-time task execution. When you select this option, the build process instruments your code to provide performance profiling at the task level. When you run your code, the executed code reports the profiling information in both a graphical presentation and an HTML report form.

To allow you to specify whether the functions generated from blocks in your model are used inline or by pointers, Inline run-time library functions tells the compiler to inline each Signal Processing Blockset™ and Video and Image Processing Blockset™ function. Using inline functions optimizes your code to run more efficiently. However, such optimization requires more memory.

As shown in the following figure, the default setting uses inlining to optimize your generated code.

When you designate a block function as inline, the compiler replaces each call to a block function with the equivalent function code from the static run-time library. If your model use the same block four times, your generated code contains four copies of the function.

While this redundancy uses more memory, inline functions run more quickly than calls to the functions outside the generated code.

Project Options

Before you run your model as an executable on any processor, configure the Project options for the model. By default, the setting for the project options is Custom, which applies MathWorks™ software specified compiler and linker settings for your generated code.

Compiler options string

To let you determine the degree of optimization provided by the Analog Devices optimizing compiler, you enter the optimization level to apply to files in your project. For details about the compiler options, refer to your VisualDSP++ documentation. When you create new projects, Embedded IDE Link VS software sets the optimization to Function(-o2).

Linker options string

To let you specify the options provided by the Analog Devices linker during link time, you enter the linker options as a string. For details about the linker options, refer to your VisualDSP++ documentation. When you create new projects, Embedded IDE Link VS software sets no linker options.

System stack size (bytes)

Enter the amount of memory to use for the stack. For more information on memory requirements, refer to Local block outputs on the Optimization pane of the Configuration Parameters dialog box. The block output buffers are placed on the stack until the stack memory is fully allocated. When the stack memory is full, the output buffers go in global memory. Refer to the online Help system for more information about Real-Time Workshop software options for configuring and building models and generating code.

Runtime

Before you run your model as an executable on any Analog Devices processor, you must configure the run-time options for the model.

By selecting values for the options available, you configure the operation of your model build process and overrun handling.

Build action

To specify to Real-Time Workshop software what to do when you click Build, select one of the following options.:

Your selection for Build action determines what happens when you click Build or press Ctrl+B. Your selection tells Real-Time Workshop software at which stage to stop the code generation and build process.

To run your model on the processor, select the default build action, Build_and_execute. Real-Time Workshop software automatically downloads and runs the model on your processor.

Interrupt overrun notification method

To enable the overrun indicator, choose one of three ways for the processor to respond to an overrun condition in your model:

Interrupt overrun notification function

When you select Call_custom_function from the Interrupt overrun notification method list, you enable this option. Enter the name of the function the processor should use to notify you that an overrun condition occurred. The function must exist in your code on the processor.

Overrun Indicator and Software-Based Timer

Embedded IDE Link VS software includes code that generates interrupts in models that use multiple clock rates. In the following cases, the overrun indicator does not work:

PIL block action

If you have Real-Time Workshop Embedded Coder software installed and you select the vdsplink_ert.tlc system target file, you can choose to use the processor-in-the-loop (PIL) feature provided by Embedded IDE Link VS software. Selecting Create_processor_in_the_loop_project for the Build action enables the PIL block action option. PIL block action specifies whether Real-Time Workshop software builds the PIL block and downloads the block to the processor.

Choose one of the following three actions for creating a PIL block:

Your selections affect how you use the resulting PIL block. The following list describes the build process and actions you take based on the PIL block action setting:

Embedded IDE Link™ VS Default Project Options — Custom

Although VisualDSP++ software offers standard project configurations, Release and Debug, models you build with Embedded IDE Link VS software use Custom for a custom configuration that provides a third combination of build and optimization.

Project configurations define sets of project build options. When you specify the build options at the project level, the options apply to all files in your project. For more information about the build options, refer to your Analog Devices VisualDSP++ documentation.

The default settings for Custom are the same as the Release project configuration in VisualDSP++ software, except for the compiler options discussed in the next section Default Project Options in Custom. Custom uses different compiler optimization levels to preserve important features of the generated code.

Default Project Options in Custom

When you create a new project or build a model to your Analog Devices processor, your project and model inherit the build configuration settings from the configuration Custom. The settings in Custom differ from the settings in the default Debug and Release configurations in VisualDSP++ software in the compiler settings.

For the compiler options, Custom uses the Function(-o2) compiler setting. The VisualDSP++ software default Release configuration uses File(-o3), a slightly more aggressive optimization model.

For memory configuration, where Release uses the default memory model that specifies near functions and data, Custom specifies near functions and data—the -ml1 memory model—because some custom hardware might not support far data or aggregate data. Your VisualDSP++ documentation provides complete details on the compiler build options.

You can change the individual settings or the build configuration within VisualDSP++ IDE. Build configuration options that do not appear on these panes default to match the settings for the Release build configuration in VisualDSP++ software.

Target Function Library and Embedded IDE Link™ VS Software

If you are using vdsplink_ert.tlc as your system target file, Embedded IDE Link VS software supports generating code that is optimized for the processor by using compiler intrinsics and assembly code to replace certain mathematical operator functions. Embedded IDE Link VS software accomplishes this optimization through the Target Function Library (TFL) replacement mechanism that Real-Time Workshop Embedded Coder software provides. TFL replacement requires Real-Time Workshop Embedded Coder software and the embedded real-time target—vdsplink_ert.tlc.

Some code generation stages launch TFL queries. Based on the processor you select, TFL replaces the default Real-Time Workshop software sum and multiply functions and other arithmetic and mathematical operators with processor-specific compiler intrinsics and assembly code functions. For more general information about TFL, look for TFL in the Interface options in Configuring Real-Time Workshop® Code Generation Parameters.

TFL Replacement Functions

When you enable TFL replacement, Real-Time Workshop Embedded Coder software uses compiler intrinsics and assembly code functions provided by Embedded IDE Link VS software to replace the sums and multiplies in your generated code. The replacement functions provide optimized operations that enable your generated code to run more efficiently and quickly.

TFL Viewer

TFL replacement does not provide direct feedback when you generate code. To help you review the TFL replacement operators and code, Real-Time Workshop Embedded Coder software provides the TFL Viewer. To start the viewer with all of the available math libraries listed, enter the following command at the MATLAB prompt:

RTW.viewTFL

The viewer enables you to see the content of target function library tables that were created using Real-Time Workshop Embedded Coder software. The following figure shows the TFL viewer displaying the libraries for the Blackfin® 53x processor family. Follow the instructions in the viewer to see the operators and the TFL code associated with each operator.

Enabling TFL for Code Generation

You use an option in the Configuration Parameters for your model to enable TFL replacement during code generation. Perform the following steps to enable the TFL replacement process when you generate code from a model.

To use the TFL replacement capability when you generate code, you must install Real-Time Workshop Embedded Coder software and select the system target file vdsplink_ert.tlc.

  1. Open the Configuration Parameters for your model by selecting Simulation > Configuration Parameters from the model menu bar.

  2. On the Select tree in the Configuration Parameters dialog box, choose Real-Time Workshop.

  3. Set the System target file to vdsplink_ert.tlc. Use Browse to select the file.

  4. On the Select tree, choose Interface.

  5. From the Target function library list, select the Analog Devices processor family that matches your processor.

  6. Click OK to save your changes and close the dialog box.

With TFL enabled, your generated code uses the TFL replacement libraries provided for your processor.

  


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