Target Language Compiler    

Exercise

The files for this exercise are in the tlctutorial/dualportram directory of the TLC examples directory.

You are given the C code S-function dp_read.c. Write your own TLC file to inline this S-function. The dp.mdl model file contains the dual port read model. The mask for the dp_read S-function allows you to enter parameters for:

Parameter
Description
offset

Scalar offset value

gain
Gain
varType
Data type for the value read from dual port RAM
hwAddress
Memory address that your (fictitious) custom hardware needs to access

The S-function dp_read.c is written with error handling to ensure dialog box entries are consistent with the types of data that are to be included in the generated code. This error handling functionality is only needed in the S-function, and is not needed in the generated code.

To simplify your assignment, the file dp_read_assign.tlc is included. You must:

This is the file you will need, dp_read_assign.tlc. Copy it to dp_read.tlc.


 Inlined S-Function for Dual Port RAM Further Hints