Group blocks to create model hierarchy
Simulink / Ports & Subsystems
A Subsystem block contains a subset of blocks within a model or system. The Subsystem block can represent a virtual subsystem or a nonvirtual subsystem.
Nonvirtual subsystem – Control when the contents of the subsystem are evaluated as a single unit (atomic execution). Create conditionally executed subsystems that run only when an event occurs on a triggering, function-call, action, or enabling input (see Conditionally Executed Subsystems and Models).
Virtual subsystem – Subsystem is neither conditionally nor atomically
executed. Virtual subsystems do not have checksums. To determine if a subsystem
is virtual, use the get_param
function for the
Boolean block parameter IsSubsystemVirtual
.
An atomic subsystem is a Subsystem block with the block parameter Treat as atomic unit selected.
A codereuse subsystem is a Subsystem block with the parameter
Treat as atomic unit selected and the parameter
Function packaging set to Reusable function
,
specifying the function code generation format for the subsystem.
To create a subsystem, do one of the following:
Copy a Subsystem block from the Ports & Subsystems library into your model. Then add blocks to the subsystem by opening the Subsystem block and copying blocks into it.
Select all blocks and lines that make up the subsystem, and then in the Multiple tab, click Create Subsystem. Simulink® replaces the blocks with a Subsystem block, along with the necessary Inport and Outport blocks to reflect signals entering and leaving the subsystem.
The number of input ports drawn on the Subsystem block icon corresponds to the number of Inport blocks in the subsystem. Similarly, the number of output ports drawn on the block corresponds to the number of Outport blocks in the subsystem.
The Subsystem block supports signal label propagation through subsystem Inport and Outport blocks.
Note
A referenced subsystem is a subsystem stored in a separate file that is referenced using a Subsystem Reference block. To reuse that subsystem, add multiple Subsystem Reference blocks that reference that same subsystem file. A referenced subsystem behaves identically to a regular subsystem during run-time.
In
— Signal input to a subsystemPlacing an Inport block in a subsystem adds an external input port to the Subsystem block. The port label matches the name of the Inport block.
Use Inport blocks to get signals from the local environment.
Data Types: half
| single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
Out
— Signal output from a subsystemPlacing an Outport block in a subsystem adds an output port from the Subsystem block. The port label on the Subsystem block is the name of the Outport block.
Use Outport blocks to send signals to the local environment.
Data Types: half
| single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
Parameters on the Code Generation tab require a Simulink Coder™ or Embedded Coder® license.
Show port labels
— Display options for port labelsFromPortIcon
(default) | FromPortBlockName
| SignalName
Select how to display port labels on the Subsystem block icon.
none
Do not display port labels.
FromPortIcon
If the corresponding port icon displays a signal name, display the signal name on the Subsystem block. Otherwise, display the port block name.
FromPortBlockName
Display the name of the corresponding port block on the Subsystem block.
SignalName
If a signal name exists, display the name of the signal connected to the port on the Subsystem block. Otherwise, display the name of the corresponding port block.
Parameter:
ShowPortLabels |
Type: character vector |
Value:
'FromPortIcon' |
'FromPortBlockName' |
'SignalName' |
Default:
'FromPortIcon' |
Read/Write permissions
— Levels of access to contents of subsystemReadWrite
(default) | ReadOnly
| NoReadOrWrite
Control user access to the contents of the subsystem.
ReadWrite
Enable opening and modification of subsystem contents.
ReadOnly
Enable opening but not modification of the subsystem. If the subsystem resides in a block library, you can create and open links to the subsystem and can make and modify local copies of the subsystem but cannot change the permissions or modify the contents of the original library instance.
NoReadOrWrite
Disable opening or modification of subsystem. If the subsystem resides in a library, you can create links to the subsystem in a model but cannot open, modify, change permissions, or create local copies of the subsystem.
Note
You do not receive a response if you attempt to view the contents
of a subsystem whose Read/Write permissions
parameter is set to NoReadOrWrite
. For
example, when double-clicking such a subsystem, Simulink does not open the subsystem and does not display any
messages.
Parameter:
Permissions |
Type: character vector |
Value:
'ReadWrite' |
'ReadOnly' |
'NoReadOrWrite' |
Default:
'ReadWrite' |
Name of error callback function
— Name of function to be called if error occurs''
(default) | function nameEnter name of a function to be called if an error occurs while Simulink is executing the subsystem.
Simulink passes two arguments to the function: the handle of the subsystem and a character vector that specifies the error type. If no function is specified, Simulink displays a generic error message if executing the subsystem causes an error.
Parameter:
ErrorFcn |
Type: character vector |
Value:
'' | '<function
name>' |
Default:
'' |
Permit hierarchical resolution
— Resolution for workspace variable namesAll
(default) | ExplicitOnly
| None
Select whether to resolve names of workspace variables referenced by this subsystem.
For more information, see Symbol Resolution and Symbol Resolution Process.
All
Resolve all names of workspace variables used by this
subsystem, including those used to specify block parameter
values and Simulink data objects (for example, Simulink.Signal
objects).
ExplicitOnly
Resolve only names of workspace variables used to specify block parameter values, data store memory (where no block exists), signals, and states marked as “must resolve”.
None
Do not resolve any workspace variable names.
Parameter:
PermitHierarchicalResolution |
Type: character vector |
Value:
'All' | 'ExplicitOnly'
| 'None' |
Default:
'All' |
Treat as atomic unit
— Option to execute subsystem as one unitCauses Simulink to treat the subsystem as a unit when determining the execution order of block methods.
Treat all blocks in the subsystem as being at the same level in the model hierarchy as the subsystem when determining block method execution order. This can cause execution of methods of blocks in the subsystem to be interleaved with execution of methods of blocks outside the subsystem.
Treat the subsystem as a unit when determining the execution order of block methods. For example, when it needs to compute the output of the subsystem, Simulink invokes the output methods of all the blocks in the subsystem before invoking the output methods of other blocks at the same level as the Subsystem block.
Parameter:
TreatAsAtomicUnit |
Type: character vector |
Value:
'off' | 'on' |
Default:
'off' |
Minimize algebraic loop occurrences
— Option to eliminate artificial algebraic loopsTry to eliminate any artificial algebraic loops that include the atomic subsystem
Do not try to eliminate any artificial algebraic loops that include the atomic subsystem.
Try to eliminate any artificial algebraic loops that include the atomic subsystem.
To enable this parameter, select the Treat as atomic unit parameter.
Parameter:
MinAlgLoopOccurrences |
Type: character vector |
Value:
'off' | 'on' |
Default:
'off' |
Schedule As
— Type of schedulingSample Time
(default) | Periodic Partition
| Aperiodic Partition
Specify how to schedule the subsystem.
Sample time
Specify whether all blocks in this subsystem must run at the same rate or can run at different rates.
Periodic Partition
Schedule the subsystem as a periodic partition. Specify a partition name and a sample time corresponding to the rate at which the partition runs.
Aperiodic Partition
Schedule the subsystem as an aperiodic partition. Specify a partition name.
To enable this parameter, select the Treat as atomic unit parameter.
Parameter:
ScheduleAs |
Type: character vector |
Value:
'SampleTime' |
'DiscretePartition' |
'UnconstrainedPartition' |
Default:
'SampleTime' |
Partition Name
— Name of partitionSpecify name of the partition for the subsystem.
To enable this parameter, select the Treat as atomic
unit parameter, and set Schedule
As to Periodic Partition
or Aperiodic Partition
.
Parameter:
PartitionName |
Type: character vector |
Value:
'' |
Default:
'' |
Sample time
— Time interval-1
(default) | [Ts 0]
Specify whether all blocks in this subsystem must run at the same rate or can run at different rates.
If the blocks in the subsystem can run at different
rates, specify the subsystem sample time as inherited
(-1
).
If all blocks must run at the same rate, specify the sample time corresponding to this rate as the value of the Sample time parameter.
If any of the blocks in the subsystem specify a different
sample time (other than -1
or
inf
), Simulink displays an error message when you update or
simulate the model. For example, suppose all the blocks in
the subsystem must run 5
times a second.
To ensure this, specify the sample time of the subsystem as
0.2
. In this example, if any of the
blocks in the subsystem specify a sample time other than
0.2
, -1
, or
inf
, Simulink displays an error when you update or simulate
the model.
-1
Specify inherited sample time. Use this sample time if the blocks in the subsystem can run at different rates.
[Ts 0]
Specify periodic sample time.
To enable this parameter, select the Treat as atomic unit parameter.
Parameter:
SystemSampleTime |
Type: character vector |
Value:
'-1' | '[Ts 0]'
|
Default:
'-1' |
Variant control
— Variant control (condition) expressionVariant
(default) | logical expressionSpecify variant control (condition) expression that executes a variant
Simulink Function block when the expression evaluates
to true
.
For more information, see Simulink.Variant
.
Variant
Default name for a logical (Boolean) expression.
A logical (Boolean) expression or a
Simulink.Variant
object representing a
logical expression.
The function is activated when the expression evaluates to
true
.
If you want to generate code for your model, define the
variables in the expression as
Simulink.Parameter
objects.
Enable this parameter by adding a Subsystem block inside a Variant Subsystem block.
Block parameter:
VariantControl |
Type: character vector |
Value:
'Variant' | '<logical
expression>' |
Default:
'Variant' |
Treat as grouped when propagating variant conditions
— Option to treat subsystem as unit when propagating variant conditionson
(default) | off
Causes Simulink to treat the subsystem as a unit when propagating variant conditions from Variant Source blocks or to Variant Sink blocks.
Simulink treats the subsystem as a unit when propagating variant conditions from Variant Source blocks or to Variant Sink blocks. For example, when Simulink computes the variant condition of the subsystem, it propagates that condition to all the blocks in the subsystem.
Simulink treats all blocks in the subsystem as being at the same level in the model hierarchy as the subsystem itself when determining their variant condition.
Parameter:
TreatAsGroupedWhenPropagatingVariantConditions |
Type: character vector |
Value:
'on' | 'off' |
Default:
'on' |
Function packaging
— Code formatAuto
(default) | Inline
| Nonreusable function
| Reusable function
Select the code format to be generated for an atomic (nonvirtual) subsystem.
Auto
Simulink Coder and Embedded Coder choose the optimal format for you based on the type and number of instances of the subsystem that exist in the model.
Inline
Simulink Coder and Embedded Coder inline the subsystem unconditionally.
Nonreusable function
If Filename options is set to
Auto
, Simulink
Coder and Embedded Coder package separate functions in the model file.
If File name options is set to
Use subsystem name
,
Use function name
, or
User specified
using
different file names, Simulink
Coder and Embedded Coder package separate functions in separate
files.
Subsystems with this setting generate functions that might have arguments depending on the Function interface parameter setting. You can name the generated function and file using parameters Function name and File name (no extension). These functions are not reentrant.
Reusable function
Simulink Coder and Embedded Coder generate a function with arguments that allows reuse of subsystem code when a model includes multiple instances of the subsystem.
This option also generates a function with arguments that allows subsystem code to be reused in the generated code of a model reference hierarchy that includes multiple instances of a subsystem across referenced models. In this case, the subsystem must be in a library.
For more information, see:
Control Generation of Functions for Subsystems (Simulink Coder)
Generate Code and Executables for Individual Subsystems (Simulink Coder)
Inline Subsystem Code (Simulink Coder)
Generate Subsystem Code as Separate Function and Files (Simulink Coder)
Generate Reusable Code from Library Subsystems Shared Across Models (Simulink Coder)
When you want multiple instances of a subsystem to be
represented as one reusable function, you can designate each
one of them as Auto
or as
Reusable function
. It is best
to use one or the other, as using both creates two reusable
functions, one for each designation. The outcomes of these
choices differ only when reuse is not possible. Selecting
Auto
does not allow control
of the function or file name for the subsystem code.
The Reusable function
and
Auto
options both try to
determine if multiple instances of a subsystem exist and if
the code can be reused. The difference between the options'
behavior is that when reuse is not possible:
Auto
yields inlined
code, or if circumstances prohibit inlining,
separate functions for each subsystem
instance.
Reusable function
yields a separate function with arguments for each
subsystem instance in the model.
If you select Reusable function
while your generated code is under source control, set
File name options to
Use subsystem name
,
Use function name
, or
User specified
. Otherwise,
the names of your code files change whenever you modify your
model, which prevents source control on your files.
This parameter requires Simulink Coder for code generation.
To enable this parameter, select Treat as atomic unit.
Parameter:
RTWSystemCode |
Type: character vector |
Value:
'Auto' | 'Inline' |
'Nonreusable function' |
'Reusable function' |
Default:
'Auto' |
Function name options
— How to name generated functionAuto
(default) | Use subsystem name
| User specified
Select how Simulink Coder names the function it generates for the subsystem.
If you have an Embedded Coder license, you can control function names with options on the Configuration Parameter Code Generation > Identifiers pane.
Auto
Assign a unique function name using the default naming
convention,
,
where model
_subsystem
()model
is the name of the
model and subsystem
is the name
of the subsystem (or that of an identical one when code is
being reused).
If you select Reusable function
for the Function packaging parameter
and there are multiple instances of the reusable subsystem
in a model reference hierarchy, in order to generate
reusable code for the subsystem, Function name
options must be set to
Auto
.
Use subsystem name
Use the subsystem name as the function name. By default,
the function name uses the naming convention
.model
_subsystem
Note
When a subsystem is in a library block and the
subsystem parameter Function packaging is set
to Reusable function
, if you
set the Use subsystem name
option, the code generator uses the name of the library
block for the subsystem function name and file
name.
User specified
Enable the Function name field. Enter any legal C or C++ function name, which must be unique.
For more information, see Control Generation of Functions for Subsystems (Simulink Coder).
This parameter requires a Simulink Coder license.
To enable this parameter, set Function
packaging to Nonreusable
function
or Reusable
function
.
Parameter:
RTWFcnNameOpts |
Type: character vector |
Value:
'Auto' | 'Use subsystem
name' | 'User
specified' |
Default:
'Auto' |
Function name
— Name of function for subsystem code''
(default) | function nameSpecify a unique, valid C or C++ function name for subsystem code.
Use this parameter if you want to give the function a specific name instead of allowing the Simulink Coder code generator to assign its own autogenerated name or use the subsystem name. For more information, see Control Generation of Functions for Subsystems (Simulink Coder).
This parameter requires a Simulink Coder license.
To enable this parameter, set the Function
name options parameter to
User specified
.
Parameter:
RTWFcnName |
Type: character vector |
Value:
'' | '<function
name>' |
Default:
'' |
File name options
— How to name generated fileAuto
(default) | Use subsystem name
| Use function name
| User specified
Select how Simulink Coder names the separate file for the function it generates for the subsystem.
Auto
Depending on the configuration of the subsystem and how
many instances are in the model,
Auto
yields different
results:
If the code generator does
not generate a separate file
for the subsystem, the subsystem code is generated
within the code module generated from the subsystem
parent system. If the subsystem parent is the model
itself, the subsystem code is generated within
or
model
.c
.model
.cpp
If you select Reusable
function
for the Function
packaging parameter and your generated
code is under source control, consider specifying a
File name options value other
than Auto
. This prevents
the generated file name from changing due to
unrelated model modifications, which is problematic
for using source control to manage
configurations.
If you select Reusable
function
for the Function
packaging parameter and there are
multiple instances of the reusable subsystem in a
model reference hierarchy, in order to generate
reusable code for the subsystem, File name
options must be set to
Auto
.
Use subsystem name
The code generator generates a separate file, using the subsystem (or library block) name as the file name.
Note
When File name options is set
to Use subsystem name
,
the subsystem file name is mangled if the model
contains Model blocks, or if a model
reference target is being generated for the model.
In these situations, the file name for the subsystem
consists of the subsystem name prefixed by the model
name.
Use function name
The code generator uses the function name specified by Function name options as the file name.
User specified
This option enables the File name (no
extension) text entry field. The code
generator uses the name you enter as the file name. Enter
any file name, but do not include the .c
or .cpp
(or any other) extension. This
file name need not be unique.
Note
While a subsystem source file name need not be
unique, you must avoid giving nonunique names that
result in cyclic dependencies (for example,
sys_a.h
includes
sys_b.h
,
sys_b.h
includes
sys_c.h
, and
sys_c.h
includes
sys_a.h
).
This parameter requires a Simulink Coder license.
To enable this parameter, set Function
packaging to Nonreusable
function
or Reusable
function
.
Parameter:
RTWFileNameOpts |
Type: character vector |
Value:
'Auto' | 'Use subsystem
name' | 'Use function name' |
'User specified' |
Default:
'Auto' |
File name (no extension)
— Name of generated file ''
(default) | file name The file name that you specify does not have to be unique. However,
avoid giving non-unique names that result in cyclic dependencies (for
example, sys_a.h
includes sys_b.h
,
sys_b.h
includes sys_c.h
, and
sys_c.h
includes sys_a.h
).
For more information, see Control Generation of Functions for Subsystems (Simulink Coder).
This parameter requires a Simulink Coder license.
To enable this parameter, set File name
options to User
specified
.
Parameter:
RTWFileName |
Type: character vector |
Value:
'' | '<file
name>' |
Default:
'' |
Function interface
— Select to use arguments with generate functionvoid_void
(default) | Allow arguments (Optimized)
| Allow arguments (Match graphical
interface)
Select to use arguments with generated function.
void_void
Generate a function without arguments and pass data as global variables. For example:
void subsystem_function(void)
Allow arguments (Optimized)
Generate a function that uses arguments instead of passing data as global variables. This specification reduces global RAM. It might reduce code size and improve execution speed and enable the code generator to apply additional optimizations. For example:
void subsystem_function(real_T rtu_In1, real_T rtu_In2, real_T *rty_Out1)
Allow arguments (Match graphical
interface)
Generate a function interface that uses arguments that match the Subsystem graphical block interface. The generated function interface is predictable and does not change. A predictable interface can be useful for debugging and testing your code and integrating with external applications. For example, if a model has two Inports and two Outports, then the generated function interface is:
void subsystem_function(real_T rtu_In1, real_T rtu_In2, real_T *rty_Out1, real_T *rty_Out2)
For more information, see:
Reduce Global Variables in Nonreusable Subsystem Functions (Embedded Coder)
Generate Predictable Function Interface to Match Graphical Block Interface (Embedded Coder)
Generate Modular Function Code for Nonvirtual Subsystems (Embedded Coder)
This parameter requires Embedded Coder and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
.
Parameter:
FunctionInterfaceSpec |
Type: character vector |
Value:
'void_void' | 'Allow arguments
(Optimized)' | 'Allow arguments (Match
graphical interface)' |
Default:
'void_void' |
Function with separate data
— Control code generation for subsystemGenerate subsystem function code in which the internal data for an atomic subsystem is separated from its parent model and is owned by the subsystem.
Do not generate subsystem function code in which the internal data for an atomic subsystem is separated from its parent model and is owned by the subsystem.
Generate subsystem function code in which the internal
data for an atomic subsystem is separated from its parent
model and is owned by the subsystem. The subsystem data
structure is declared independently from the parent model
data structures. A subsystem with separate data has its own
block I/O and DWork
data structure. As a
result, the generated code for the subsystem is easier to
trace and test. The data separation also tends to reduce the
maximum size of global data structures throughout the model,
because they are split into multiple data structures.
For details on how to generate modular function code for an atomic subsystem, see Generate Modular Function Code for Nonvirtual Subsystems (Embedded Coder).
For details on how to apply memory sections to atomic subsystems, see Override Default Memory Placement for Subsystem Functions and Data (Embedded Coder).
This parameter requires a license for Embedded Coder and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
.
Parameter:
FunctionWithSeparateData |
Type: character vector |
Value:
'off' | 'on' |
Default:
'off' |
Memory section for initialize/terminate functions
— Select how to apply memory sectionsInherit from model
(default) | Default
| The memory section of interest
Select how Embedded Coder applies memory sections to the subsystem initialization and termination functions.
Inherit from model
Apply the root model memory sections to the subsystem function code
Default
Do not apply memory sections to the subsystem system code, overriding any model-level specification
The memory section of
interest
Apply one of the model memory sections to the subsystem
The possible values vary depending on what (if any) package of memory sections you have set for the model configuration. See Control Data and Function Placement in Memory by Inserting Pragmas (Embedded Coder) and Model Configuration Parameters: Code Generation (Simulink Coder).
If you have not configured the model with a package,
Inherit from model
is the
only value that appears. Otherwise, the list includes
Default
and all memory
sections the model package contains.
These options can be useful for overriding the model memory section settings for the given subsystem. For details on how to apply memory sections to atomic subsystems, see Override Default Memory Placement for Subsystem Functions and Data (Embedded Coder).
This parameter requires a license for Embedded Coder software and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
or Reusable
function
.
Parameter:
RTWMemSecFuncInitTerm |
Type: character vector |
Value: 'Inherit
from model' | 'Default' |
'The memory section of interest' |
Default: 'Inherit
from model' |
Memory section for execution functions
— Select how to apply memory sectionsInherit from model
(default) | Default
| The memory section of interest
Select how Embedded Coder applies memory sections to the subsystem execution functions.
Inherit from model
Apply the root model memory sections to the subsystem function code
Default
Do not apply memory sections to the subsystem system code, overriding any model-level specification
The memory section of
interest
Apply one of the model memory sections to the subsystem
The possible values vary depending on what (if any) package of memory sections you have set for the model configuration. See Control Data and Function Placement in Memory by Inserting Pragmas (Embedded Coder) and Model Configuration Parameters: Code Generation (Simulink Coder).
If you have not configured the model with a package,
Inherit from model
is the
only value that appears. Otherwise, the list includes
Default
and all memory
sections the model package contains.
These options can be useful for overriding the model memory section settings for the given subsystem. For details on how to apply memory sections to atomic subsystems, see Override Default Memory Placement for Subsystem Functions and Data (Embedded Coder).
This parameter requires a license for Embedded Coder software and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
or Reusable
function
.
Parameter:
RTWMemSecFuncExecute |
Type: character vector |
Value: 'Inherit
from model' | 'Default' |
'The memory section of interest' |
Default: 'Inherit
from model' |
Memory section for constants
— Select how to apply memory sectionsInherit from model
(default) | Default
| The memory section of interest
Select how Embedded Coder applies memory sections to the subsystem constants.
Inherit from model
Apply the root model memory sections to the subsystem data
Default
Not apply memory sections to the subsystem data, overriding any model-level specification
The memory section of
interest
Apply one of the model memory sections to the subsystem
The memory section that you specify applies to the corresponding global data structures in the generated code. For basic information about the global data structures generated for atomic subsystems, see Standard Data Structures in the Generated Code (Simulink Coder).
The possible values vary depending on what (if any) package of memory sections you have set for the model configuration. See Control Data and Function Placement in Memory by Inserting Pragmas (Embedded Coder).
If you have not configured the model with a package,
Inherit from model
is the
only value that appears. Otherwise, the list includes
Default
and all memory
sections the model package contains.
These options can be useful for overriding the model memory section settings for the given subsystem. For details on how to apply memory sections to atomic subsystems, see Override Default Memory Placement for Subsystem Functions and Data (Embedded Coder).
This parameter requires a license for Embedded Coder and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
and select the
Function with separate data
parameter.
Parameter:
RTWMemSecDataConstants |
Type: character vector |
Value: 'Inherit
from model' | 'Default' |
'The memory section of interest' |
Default: 'Inherit
from model' |
Memory section for internal data
— Select how to apply memory sectionsInherit from model
(default) | Default
| The memory section of interest
Select how Embedded Coder applies memory sections to the subsystem internal data.
Inherit from model
Apply the root model memory sections to the subsystem data
Default
Not apply memory sections to the subsystem data, overriding any model-level specification
The memory section of
interest
Apply one of the model memory sections to the subsystem
The memory section that you specify applies to the corresponding global data structures in the generated code. For basic information about the global data structures generated for atomic subsystems, see Standard Data Structures in the Generated Code (Simulink Coder).
The possible values vary depending on what (if any) package of memory sections you have set for the model configuration. See Control Data and Function Placement in Memory by Inserting Pragmas (Embedded Coder).
If you have not configured the model with a package,
Inherit from model
is the
only value that appears. Otherwise, the list includes
Default
and all memory
sections the model package contains.
These options can be useful for overriding the model memory section settings for the given subsystem. For details on how to apply memory sections to atomic subsystems, see Override Default Memory Placement for Subsystem Functions and Data (Embedded Coder).
This parameter requires a license for Embedded Coder and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
and select the
Function with separate data
parameter.
Parameter:
RTWMemSecDataInternal |
Type: character vector |
Value: 'Inherit
from model' | 'Default' |
'The memory section of interest' |
Default: 'Inherit
from model' |
Memory section for parameters
— Select how to apply memory sectionsInherit from model
(default) | Default
| The memory section of interest
Select how Embedded Coder applies memory sections to the subsystem parameters.
Inherit from model
Apply the root model memory sections to the subsystem function code
Default
Not apply memory sections to the subsystem system code, overriding any model-level specification
Apply one of the model memory sections to the subsystem
The memory section that you specify applies to the corresponding global data structure in the generated code. For basic information about the global data structures generated for atomic subsystems, see Standard Data Structures in the Generated Code (Simulink Coder).
The possible values vary depending on what (if any) package of memory sections you have set for the model configuration. See Control Data and Function Placement in Memory by Inserting Pragmas (Embedded Coder).
If you have not configured the model with a package,
Inherit from model
is the
only value that appears. Otherwise, the list includes
Default
and all memory
sections the model package contains.
These options can be useful for overriding the model memory section settings for the given subsystem. For details on how to apply memory sections to atomic subsystems, see Override Default Memory Placement for Subsystem Functions and Data (Embedded Coder).
This parameter requires a license for Embedded Coder and an ERT-based system target file.
To enable this parameter, set Function
packaging to Nonreusable
function
and select the
Function with separate data
parameter.
Parameter:
RTWMemSecDataParameters |
Type: character vector |
Value: 'Inherit
from model' | 'Default' |
'The memory section of interest' |
Default: 'Inherit
from model' |
Subsystem file name
— File name for referenced subsystemTo access this parameter, click the Convert button.
For more information on how to convert a subsystem to a referenced subsystem, see Convert an Existing Subsystem to a Referenced Subsystem.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
[a] Actual data type or capability support depends on block implementation. |
Actual data type or capability support depends on block implementation.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
Architecture | Description |
---|---|
Module (default) | Generate code for the subsystem and the blocks within the subsystem. |
BlackBox | Generate a black box interface. The generated HDL code includes only the input/output port definitions for the subsystem. Therefore, you can use a subsystem in your model to generate an interface to existing, manually written HDL code. The black-box interface generation for subsystems is similar to the Model block interface generation without the clock signals. |
| Remove the subsystem from the generated code. You can use the subsystem in simulation, however, treat it as a “no-op” in the HDL code. |
For the BlackBox
architecture, you
can customize port names and set attributes of the external component
interface. See Customize Black Box or HDL Cosimulation Interface (HDL Coder).
General | |
---|---|
AdaptivePipelining | Automatic pipeline insertion based on the synthesis tool, target frequency, and
multiplier word-lengths. The default is |
BalanceDelays | Detects introduction of new delays along one path and inserts
matching delays on the other paths. The default is |
ClockRatePipelining | Insert pipeline registers at a faster clock rate instead of the slower data rate. The
default is |
ConstrainedOutputPipeline | Number of registers to place at
the outputs by moving existing delays within your design. Distributed
pipelining does not redistribute these registers. The default is
|
DistributedPipelining | Pipeline register distribution, or register retiming. The default
is |
DSPStyle | Synthesis attributes for multiplier mapping. The default is |
FlattenHierarchy | Remove subsystem hierarchy from generated HDL code. The default
is |
InputPipeline | Number of input pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
OutputPipeline | Number of output pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is
|
SharingFactor | Number of functionally equivalent resources to map to a single shared resource. The default is 0. See also Resource Sharing (HDL Coder). |
StreamingFactor | Number of parallel data paths, or vectors, that are time multiplexed to transform into serial, scalar data paths. The default is 0, which implements fully parallel data paths. See also Streaming (HDL Coder). |
If this block is not the DUT, the block property settings in the Target
Specification tab are ignored. In the HDL Workflow Advisor, if you use the
IP Core Generation workflow, these target specification block
property values are saved with the model. If you specify these target specification block
property values using hdlset_param
, when you open HDL Workflow Advisor,
the fields are populated with the corresponding values.
Target Specification | |
---|---|
AdditionalTargetInterfaces |
Additional target interfaces, specified as a character vector. To save this block property on the model, in the Set Target Interface task of the IP Core Generation workflow, corresponding to the DUT ports that you want to add more interfaces, select Add more.... You can then add more interfaces in the Add New Target Interfaces dialog box. Specify the type of interface, number of additional interfaces, and a unique name for each additional interface. Values: Example:
|
ProcessorFPGASynchronization | Processor/FPGA synchronization mode, specified as a character vector. To save this block property on the model, specify the Processor/FPGA Synchronization in the Set Target Interface task of the IP Core Generation workflow. Values: Example: |
TestPointMapping | To save this block property on the model, specify the mapping of test point ports to target platform interfaces in the Set Target Interface task of the IP Core Generation workflow. Values: Example: |
TunableParameterMapping | To save this block property on the model, specify the mapping of tunable parameter ports to target platform interfaces in the Set Target Interface task of the IP Core Generation workflow. Values: Example: |
AXI4RegisterReadback | To save this block property on the model, specify whether you want to enable readback on AXI4 slave write registers in the Generate RTL Code and IP Core task of the IP Core Generation workflow. To learn more, see Model Design for AXI4 Slave Interface Generation (HDL Coder). Values: |
AXI4SlaveIDWidth |
To save this block property on the model, specify the number of AXI Master interfaces that you want to connect the DUT IP core to by using the AXI4 Slave ID Width setting in the Generate RTL Code and IP Core task of the IP Core Generation workflow. To learn more, see Define Multiple AXI Master Interfaces in Reference Designs to access DUT AXI4 Slave Interface (HDL Coder). Values: |
AXI4SlavePortToPipelineRegisterRatio |
To save this block property on the model, specify the number of AXI4 slave ports for which you want a pipeline register to be inserted by using the AXI4 Slave port to pipeline register ratio setting in the Generate RTL Code and IP Core task of the IP Core Generation workflow. To learn more, see Model Design for AXI4 Slave Interface Generation (HDL Coder). Values: |
GenerateDefaultAXI4Slave | To save this block property on the model, specify whether you want to disable generation of default AXI4 slave interfaces in the Generate RTL Code and IP Core task of the IP Core Generation workflow. Values: |
IPCoreAdditionalFiles | Verilog® or VHDL® files for black boxes in your design. Specify the full path to each file, and separate file names with a semicolon (;). You can set this property in the HDL Workflow Advisor, in the Additional source files field. Values: Example: |
IPCoreName | IP core name, specified as a character vector. You can set this property in the HDL Workflow Advisor, in the IP core name field. If this property is set to the default value, the HDL Workflow Advisor constructs the IP core name based on the name of the DUT. Values: Example: |
IPCoreVersion | IP core version number, specified as a character vector. You can set this property in the HDL Workflow Advisor, in the IP core version field. If this property is set to the default value, the HDL Workflow Advisor sets the IP core version. Values: Example: |
IPDataCaptureBufferSize |
FPGA Data Capture buffer size, specified as a character vector. Use FPGA Data Capture to observe signals in a design when running on an FPGA. The buffer size uses values that are 128*2^n, where n is an integer. By default, the buffer size is 128 (n=0). The maximum value of n is 13, which means that the maximum value for buffer size is 1048576 (=128*2^13). Values: Example: |
If your DUT is a masked subsystem, you can generate code only if it is at the top level of the model.
For more information, see:
External Component Interfaces (HDL Coder)
Generate Black Box Interface for Subsystem (HDL Coder)
Actual data type or capability support depends on block implementation.
Enabled and Triggered Subsystem | Enabled Subsystem | Function-Call Subsystem | Triggered Subsystem