Constant

Generate constant value (HDL Coder)

Description

The Constant block is available with Simulink®.

For information about the simulation behavior and block parameters, see Constant.

Tunable Parameters

You can use a tunable parameter in a Constant block intended for HDL code generation. For details, see Generate DUT Ports for Tunable Parameters.

HDL Architecture

ArchitectureParametersDescription
default
Constant

None

This implementation emits the value of the Constant block.
Logic ValueNoneBy default, this implementation emits the character 'Z' for each bit in the signal. For example, for a 4-bit signal, the implementation would emit 'ZZZZ'.
{'Value', 'Z'}If the signal is in a high-impedance state, use this parameter value. This implementation emits the character 'Z' for each bit in the signal. For example, for a 4-bit signal, the implementation would emit 'ZZZZ'.
{'Value', 'X'}If the signal is in an unknown state, use this parameter value. This implementation emits the character 'X' for each bit in the signal. For example, for a 4-bit signal, the implementation would emit 'XXXX'.

HDL Block Properties

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 0. See also ConstrainedOutputPipeline.

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 0. See also InputPipeline.

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 0. See also OutputPipeline.

Complex Data Support

This block supports code generation for complex signals.

Restrictions

  • The Logic Value implementation does not support the double data type. If you specify this implementation for a constant value of type double, a code generation error occurs.

  • For Sample time, enter -1. Delay balancing does not support an inf sample time.

  • When Output data type is a bus object, Constant value cannot be 0.

Was this topic helpful?