Enabled Subsystem
Subsystem whose execution is enabled by external input
Libraries:
Simulink /
Ports & Subsystems
HDL Coder /
Ports & Subsystems
Description
The Enabled Subsystem block is a Subsystem block preconfigured as a starting point for creating a subsystem that executes when a control signal has a positive value.
Use Enabled Subsystem blocks to model:
Discontinuities
Optional functionality
Alternative functionality
For an explanation of the Enabled Subsystem block parameters, see Subsystem.
Examples

Illustration of Law of Large Numbers
Use MATLAB System blocks to illustrate the law of large numbers.
Ports
Input
In — Signal input to Subsystem block
scalar | vector | matrix
Signal input to a Subsystem block, specified as a scalar, vector, or matrix. Placing 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 receive signals from the local environment.
Data Types: half
| single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
| bus
| image
Enable — Control signal input to Subsystem block
scalar | vector | matrix
An Enable block in a subsystem adds an external input port to the Subsystem block and makes the block an Enabled Subsystem block.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
Output
Out — Signal output from Subsystem block
scalar | vector | matrix
Signal output from a Subsystem block, returned as a scalar, vector, or matrix. Placing an Outport block in a subsystem adds an external output port to the Subsystem block. The port label matches 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
| image
Block Characteristics
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Actual code generation support depends on block implementation.
HDL Code Generation
Generate Verilog and VHDL code for FPGA and ASIC designs using HDL Coder™.
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
When using enabled subsystems in models targeted for HDL code generation, it is good practice to consider the following:
For synthesis results to match Simulink® results, the Enable port must be driven by registered logic (with a synchronous clock) on the FPGA.
Put unit delays on Enabled Subsystem output signals. Doing so prevents the code generator from inserting extra bypass registers in the HDL code.
Enabled subsystems can affect synthesis results in the following ways:
In some cases, the system clock speed can drop by a small percentage.
Generated code uses more resources, scaling with the number of enabled subsystem instances and the number of output ports per subsystem.
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. |
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). |
Target Specification
This block cannot be the DUT, so the block property settings in the Target Specification tab are ignored.
HDL Coder supports HDL code generation for enabled subsystems that meet the following conditions:
The enabled subsystem is not the DUT.
The subsystem is not both triggered and enabled.
The enable signal is a scalar.
The input datatype for the enable signal is boolean.
If the output of the subsystem is a bus then Initial condition of the outport must be 0.
All inputs and outputs of the enabled subsystem (including the enable signal) run at the same rate.
The Show output port parameter of the Enable block is set to
Off
.The States when enabling parameter of the Enable block is set to
held
(i.e., the Enable block does not reset states when enabled).The Output when disabled parameter for the enabled subsystem output ports is set to
held
(i.e., the enabled subsystem does not reset output values when disabled).If the DUT contains the following blocks,
RAMArchitecture
is set toWithClockEnable
:Dual Port RAM
Simple Dual Port RAM
Single Port RAM
The enabled subsystem does not contain the following blocks:
CIC Decimation
CIC Interpolation
FIR Decimation
FIR Interpolation
Downsample
Upsample
HDL FIFO
HDL Cosimulation blocks (HDL Verifier™)
Rate Transition
NR Polar Encoder and NR Polar Decoder (Wireless HDL Toolbox™)
The Automatic Gain Controller example shows how you can use enabled subsystems in HDL code generation. To open the example, enter:
hdlcoder_agc
PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Actual data type support depends on block implementation.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)