Chapter 5
Generated Code Architecture
5-6
ni.com
Top-Level SuperBlock
The term Top-Level SuperBlock is often used. This term describes the
SuperBlock that was the root of the Analyzer’s processing of the
SuperBlock hierarchy into subsystems, that is, a starting point for the
translation. AutoCode uses this Top-Level SuperBlock to provide default
names for the entry point of the stand-alone simulation, and more
importantly defines a boundary to determine which signals are the external
inputs and outputs of the system. The Top-Level SuperBlock also gets
translated into a subsystem just like all of the other SuperBlocks.
Block Ordering
Another task of the Analyzer is to determine the execution order of the
basic blocks within a subsystem. In other words, the Analyzer sorts the
blocks. This sequence is controlled by a data-flow analysis of the signal
connectivity of the model. Parallel threads of execution can be sorted in any
order as long as data-flow integrity is maintained. There are special blocks
that have special sequencing requirements (for example,Variable Block)
that the Analyzer sorts.
There is a block called the Sequencer Block that provides additional
information about how to sort the blocks, which allows large-grain control
over sequencing. A Sequencer block divides the diagram into a left-side
frame and a right-side frame. Blocks in the left-side frame are guaranteed
to execute before the blocks in the right-side frame. Blocks within a frame
are sorted based on data-flow and any special rules, just like a subsystem.
Because block ordering is done before AutoCode is invoked, AutoCode
cannot change the ordering of the blocks within the generated code.
Interface Layers
There are three layers of interface within the framework generated by
AutoCode. The three layers are used to support the following:
•
Interfacing to hardware
•
Data type support
•
Multi-rate subsystem communication