Subsystem whose execution is enabled by external input
Simulink / Ports & Subsystems
HDL Coder / Ports & Subsystems
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
In
— Signal input to a subsystem blockPlacing an Inport block in a subsystem block adds an external input port to the 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
Enable
— Control signal input to a subsystem blockPlacing an Enable block in a subsystem block adds an external input port to the block and changes the block to an Enable Subsystem block.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fixed point
Out
— Signal output from a subsystemPlacing an Outport block in a subsystem block adds an output port from the 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
Use MATLAB System blocks to illustrate the law of large numbers.
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
[a] Actual data type or capability support depends on block implementation. |
Actual code generation support depends on block implementation.
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.
Outputs of the enabled subsystem have an initial value of 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 to
WithClockEnable
:
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
Actual data type support depends on block implementation.