Technical data

Coding Conventions
3-13
Notes about this TLC code:
Note 1 The code section for each block begins with a comment specifying
the block type and name.
Note 2 Include a blank line immediately after the end of the function in
order to create consistent spacing between blocks in the output
code.
Note 3 Try to stay within 80 columns per line for the function banner. You
might set up an 80 column comment line at the top of each function.
As an example, see
constant.tlc.
Note 4 For consistency, use the variables sysIdx and blkIdx for system
index and block index, respectively.
Note 5 Use the variable rollVars when using the %roll construct.
Note 6 Use these conventions to name the loop control variables:
- Use
sigIdx and lcv when looping over RollRegions.
- Use
xidx and xlcv when looping over the states.
Example:
Output function in gain.tlc
%roll sigIdx = RollRegions, lcv = RollThreshold, ...
block, "Roller", rollVars
Example: InitializeConditions function in linblock.tlc
%roll xidx = [0:nStates-1], xlcv = RollThreshold,...
block, "Roller", rollVars
8
The Target Language Compiler function library files are conditionally
included so that they may be included multiple times. For example, the main