State Control

Properties and restrictions for HDL code generation

Description

The State Control block is available in the HDL Subsystems Block Library. For information about block parameters and simulation behavior, see State Control in the Simulink® documentation.

Use the State Control block to toggle subsystem behavior between the default Simulink simulation behavior and the synchronous hardware simulation behavior.

  • For default Simulink simulation behavior, set State control to Classic.

  • For synchronous hardware simulation behavior, set State control to Synchronous.

The Synchronous mode of the State Control block:

  • Provides efficient reset and enable simulation behavior on hardware.

  • Generates cleaner HDL code and uses fewer hardware resources.

See Synchronous Subsystem Behavior with the State Control Block.

HDL Architecture

This block has a single, default HDL architecture. HDL Coder™ does not generate HDL code specific to the State Control block. How you set the State Control block affects other blocks inside the subsystem that have state.

Restrictions

For the State Control block in Synchronous mode-

Supported block modes:

  • Delay block: When you have an external reset port, set the External reset to Level hold.

  • Enabled Subsystem:

    • You cannot have a Delay block with an external reset port inside the subsystem.

    • You cannot use the optional reset port on a FFT HDL Optimized or IFFT HDL Optimized block inside the subsystem.

  • Stateflow® Chart: Set the State Machine Type to Moore.

  • MATLAB Function block:

    • You cannot have System Objects inside the MATLAB Function block.

    • If you use nondirect feedthrough in a MATLAB Function block, do not program the outputs to rely on inputs or updated persistent variables. The MATLAB Function block must drive the outputs from persistent variables.

      If your MATLAB Function uses direct feedthrough and contains persistent variables, separate this MATLAB Function into two functions. One uses direct feedthrough and the other function contains persistent variables.

      To use nondirect feedthrough, in the Ports and Data Manager, clear the Allow direct feedthrough check box. See Use Nondirect Feedthrough in a MATLAB Function Block.

Unsupported blocks:

  • Enabled Delay

  • Enabled Resettable Delay

  • Resettable Delay

  • Triggered Subsystem

  • LMS Filter

  • HDL Minimum Resource FFT

  • DC Blocker

  • PN Sequence Generator

  • Convolutional Interleaver and Convolutional Deinterleaver

  • General Multiplexed Interleaver and General Multiplexed Deinterleaver

  • Convolutional Encoder and Viterbi Decoder

  • Sample and Hold

Was this topic helpful?