Real-Time Workshop    

Control Files

System Target Files

The Target Language Compiler (TLC) generates target-specific C code from an intermediate description of your Simulink block diagram (model.rtw). The Target Language Compiler reads model.rtw and executes a program consisting of several target files (.tlc files.) The output of this process is a number of source files, which are fed to your development system's make utility.

The system target file controls the code generation process. You will need to create a customized system target file to set code generation parameters for your target. We recommend that you copy, rename, and modify one of the standard system target files:

Building an Application of the Getting Started Guide and Code Generation and the Build Process describe the role of the system target file in the code generation and build process. Guidelines for creating a custom system target file are given in Customizing the Build Process.

Template Makefiles

A template makefile (.tmf file) provides information about your model and your development system. Real-Time Workshop uses this information to create an appropriate makefile (.mk file) to build an executable program. Real-Time Workshop provides a large number of template makefiles suitable for different types of targets and development systems. The standard template makefiles are described in Template Makefiles and Make Options.

If one of the standard template makefiles meets your requirements, you can simply copy and rename it in accordance with the conventions of your project. If you need to make more extensive modifications, see Template Makefiles for a full description of the structure of template makefiles.

Hook Files for Communicating Target-specific Word Characteristics

In order to communicate details about target hardware characteristics, such as word lengths and overflow behavior, you need to supply an M-file named <target>_rtw_info_hook.m. Each system target file needs to implement a hook file. Those provided for built-in targets are placed in the respective target directories under toolbox/rtw/targets/.

Hook files provide an API to describe two essential aspects of hardware characteristics:

To supply a hookfile for the GRT target (grt.tlc), for example, you must name the file grt_rtw_info_hook.m, and place it somewhere on the MATLAB path. If the hook file is present, the target-specific information is extracted via the API found in this file. If the hookfile is not provided, default values based on the host's characteristics will be used, which may not be appropriate.

For an example, see toolbox/rtw/rtwdemos/example_rtw_info_hook.m.


  Run-Time Interface for Embedded Targets Tutorial: Creating a Custom Target Configuration