Construct a Reg initialized on reset to the specified value.
Construct a Reg initialized on reset to the specified value.
Initial value that serves as a type template and reset value
Construct a Reg from a type template initialized to the specified value on reset
Utility for constructing hardware registers with an initialization value.
The register is set to the initialization value when the current implicit
reset
is highThe two forms of
RegInit
differ in how the type and width of the resulting Reg are specified.Single Argument
The single argument form uses the argument to specify both the type and reset value. For non-literal Bits, the width of the Reg will be inferred. For literal Bits and all non-Bits arguments, the type will be copied from the argument. See the following examples for more details:
1. Literal Bits initializer: width will be set to match
2. Non-Literal Element initializer - width will be inferred
3. Aggregate initializer - width will be set to match the aggregate
Double Argument
The double argument form allows the type of the Reg and the default connection to be specified independently.
The width inference semantics for
RegInit
with two arguments match those of Reg. The first argument toRegInit
is the type template which defines the width of theReg
in exactly the same way as the only argument to Wire.More explicitly, you can reason about
RegInit
with multiple arguments as if it were defined as: