Chapter 6
Vectorized Code Generation
©
National Instruments Corporation
6-5
addition to issues with the standard block library, all general BlockScript
Blocks within the diagram are implemented as 1-based arrays. If the
subscript can be evaluated at generation-time, the 0-based subscript will be
used.
Note
The extra computation of the subscripts represents a compatibility issue.
Elimination of the 1-based array representation in BlockScript will be addressed in a future
release.
Signal Connectivity
One of the greatest modeling capabilities provided in the SystemBuild
model is the ability to connect any output signal to many input pins. That
requirement, coupled with increased traceability, necessitated the use of
scalars in the generated code. Vectorized code generation requires a more
disciplined design if vectorization is to improve the generated code.
Although it is not necessary to redesign your model, you should be aware
that the flexibility of the SystemBuild Editor lets you design models that
vectorize poorly, which means they require the code to be unrolled. In other
words, generating arrays is not enough for vectorized code; the
connectivity of the model is vital in enabling loops in the generated code.
Block Outputs
The outputs of a block always can be generated as one or more arrays. The
outputs of one block cannot be part of the same array used for outputs of
another block. The creation of the arrays are controlled by the vectorization
mode and labels of the individual output pins.
Block Inputs
The inputs of a block are either SuperBlock (subsystem) external inputs
and/or outputs from other basic blocks. Those inputs might or might not be
an array and/or might not be connected in a way that allows for the code to
be rolled into a loop. The diagram in Figure 6-1 represents poor input
connectivity that prevents a rolled loop. Refer to Example 6-3.