Main Content

No-reset registers initialization

Specify whether you want to initialize registers without reset and the mode of initialization.

Settings

Default: Generate initialization inside module

The options are:

Do not initialize

HDL Coder™ does not initialize the registers without a reset port.

Generate an external script

HDL Coder generates a script to initialize registers that do not have a reset port in the generated code.

Generate initialization inside module

HDL Coder initializes the registers that do not have a reset port as part of the HDL code generated for the DUT. In Verilog, an initial construct in the corresponding module definition initializes the no-reset registers. In VHDL, the initialization code is part of the signal declaration statements.

Usage Notes

If you have blocks with ResetType set to none in your Simulink® model or specify the adaptive pipelining optimization, the generated HDL code can contain registers without a reset port. If you do not initialize these registers, there can be potential numerical mismatches in the HDL simulation results, because the registers are insensitive to the global reset logic. To avoid simulation mismatches, use this setting to initialize these registers in the generated code. For better simulation results, if you have registers without a reset port at the boundaries of the DUT, select Initialize test bench inputs in the Test Bench pane. Setting this property provides an initial value for the data driven to the DUT, and initializes the registers with these values.

FunctionalityScriptNone valueInsideModule
Generated HDL code for DUTThe script is generated externally and does not affect the HDL code for the DUT. HDL Coder does not initialize the registers in the generated code.The code for initializing the registers is part of the HDL code for the DUT.
HDL simulator supportThe syntax of the script is compliant with ModelSim® 10.2c or later. Other HDL simulators or older ModelSim versions do not support the syntax of the initialization script. This mode does not support enumeration types, and initializing the registers with non zero values.There can be numerical mismatches in the HDL simulation results, because this mode does not initialize the registers that do not have a reset port. All HDL simulators support this initialization mode, and initialize the no-reset registers with appropriate values.
Synthesis tool supportAs the script does not affect the HDL code generated for the DUT, all synthesis tools support this initialization mode.Synthesis tools do not initialize the no-reset registers in this mode.Later versions of synthesis tools support the initialization constructs in the generated code. However, it is possible that older versions do not synthesize the initialization constructs. To avoid such issues, make sure that synthesis tools can synthesize the generated code.

Command-Line Information

Property: NoResetInitializationMode
Type: character vector
Value: 'InsideModule' | 'None''Script'
Default: 'InsideModule'

To set this property, use hdlset_param or makehdl. To view the property value, use hdlget_param.

See Also

Minimize global resets