Multirate Model Requirements for HDL Code Generation - MATLAB & Simulink (original) (raw)

Main Content

Model Configuration Parameters

Before generating HDL code, configure the parameters of your model using thehdlsetup command. This sets up your multirate model for HDL code generation. This section summarizes settings applied to the model byhdlsetup that are relevant to multirate code generation. These include:

To learn more about the settings that hdlsetup configures, see Check for model parameters suited for HDL code generation.

Sample Rate

HDL Coder™ requires that at least one valid sample rate (sample time > 0) must exist in the model. If all rates are 0, –1, or –2, the code generator (makehdl) and compatibility checker (checkhdl) terminates with an error message.

Blocks to Use for Rate Transitions

Use Rate Transition blocks, rather than the following blocks, to create rate transitions in models intended for HDL code generation:

The Delay blocks listed should be configured to have the same input and output sample rates.

Zero-Order Hold blocks must be configured with inherited (-1) sample times.