You can configure a nonvirtual subsystem to inline the subsystem
code with the model code. In the Subsystem Parameters dialog box,
setting the Function packaging parameter to
the generated code of the subsystem.
Auto option is the default. When
there is only one instance of a subsystem in the model, the
inlines the subsystem code. When multiple instances of a subsystem
Auto option results in a single
copy of the function (as a reusable function). For function-call subsystems
with multiple callers, the subsystem code is generated as if you specified
To inline subsystem code, select
Inline option explicitly directs the
code generator to inline the subsystem unconditionally.
To configure your subsystem for inlining:
Right-click the Subsystem block. From the context menu, select Block Parameters (Subsystem).
In the Subsystem Parameters dialog box, if the subsystem is virtual, select Treat as atomic unit. This option makes the subsystem nonvirtual. On the Code Generation tab, the Function packaging option is now available.
If the system is already nonvirtual, the Function packaging option is already selected.
Click the Code Generation tab
the Function packaging parameter.
Click Apply and close the dialog box.
The border of the subsystem thickens, indicating that it is nonvirtual.
When you generate code from your model, the code generator
inlines subsystem code within
in its parent system's source file). You can identify this code by
system/block identification tags, such as:
/* Atomic SubSystem Block: <Root>/AtomicSubsys1 */
There are certain cases in which the code generator does not inline a nonvirtual subsystem, even though the Inline option is selected.
If the subsystem is a function-call subsystem that is called by a noninlined S-function, the Inline option is ignored. Noninlined S-functions make calls by using function pointers. Therefore, the function-call subsystem must generate a function with all arguments present.
In a feedback loop involving function-call subsystems, the code generator forces one of the subsystems to be generated as a function instead of inlining it. Based on the order in which the subsystems are sorted internally, the software selects the subsystem to be generated as a function.
If a subsystem is called from an S-function block
that sets the option
it is not inlined. When user-defined Async Interrupt blocks
or Task Sync blocks are present, this result might
occur. Such blocks must be generated as functions. These blocks are
located in the
vxlib1 block library
and use the
This library demonstrates integration with an example RTOS (VxWorks®).
 VxWorks is a registered trademark of Wind River® Systems, Inc.