Target Language Compiler |
 |
Summary of Target File Usage
In the context of the Real-Time Workshop, there are two types of target files, system target files and block target files:
- System target files determine the overall framework of code generation. They determine when blocks get executed, how data gets logged, and so on.
- Block target files determine how each individual block uses its input signals and/or parameters to generate its output or to update its state.
You must write or modify a target file if you need to do one of the following:
- Customize the code generated for a block
- The code generated for each block is defined by a block target file. Some of the things defined in the block target file include what the block outputs at each major time step and what information the block updates.
- Inlining an S-function means writing a target file that tells the Target Language Compiler how to generate code for that S-function block. The Target Language Compiler can automatically generate code for noninlined C MEX S-functions. However, if you inline a C MEX S-function, the compiler can generate more efficient code. Noninlined C MEX S-functions are executed using the S-function Application Program Interface (API) and can be inefficient.
It is possible to inline an M-file or Fortran S-function; the Target Language Compiler can generate code for the S-function in both these cases.
- Customize the code generated for all models
- You may want to instrument the generated code for profiling, or make other changes to overall code generation for all models. To accomplish such changes, you must modify some of the system target files.
- Implement support for a new language
- The Target Language Compiler provides the basic framework to configure the entire Real-Time Workshop for code generation in another language.
Refer to Directives and Built-in Functions, for a description of the Target Language and A TLC Tutorial, for a tutorial on using the Target Language and a description of how to inline S-functions.
| Available Target Files | | System Target Files |  |