Target Language Compiler    

Input Signals, Output Signals, and Parameters

Look at the line that appear between %roll and %endroll.

The first argument, 0, corresponds to the input port index for a given block. The first input port has index 0. The second input port has index 1, and so on.

The second argument is reserved for advanced use. For now, specify the second argument as an empty string. In advanced applications, you could define your own variable name to be used as an index with %roll. In such a case, TLC declares this variable as an integer in an appropriate location in the generated code.

The third argument to the function LibBlockInputSignal is lcv. As described previously, lcv = RollThreshold was set in %roll to indicate that we will loop if RollThreshold (default value of 5) is exceeded. For example, if there are 6 contiguous inputs into the block, they will be rolled.

The fourth argument, sigIdx, allows TLC to perform some magic. In the event that the RollThreshold is not exceeded (for example, if the block is only connected to a scalar input signal) TLC will not roll it into a loop. Instead, TLC will insert an integer value on the appropriate variable and place the corresponding line of code as "straight-line" code.

If the RollThreshold is exceeded, (if there are 10 inputs to the block) TLC collapses the lines of code into a for loop and uses an index variable to index into lines within the for loop.


 Loop Rolling Through a TLC File TLC Function Library Reference