SystemVerilog Topic - Localparam
Let’s discuss localparam in relation to previous topics of parameters and defparam statements.
Localparam prevents the values to be overwritten (directly) from outside the module. Once the variables are declared with ‘localparam’ the values stays constant. When the module is instantiated within another module the values can’t be passed for these data types.
Example use of localparam: To achieve best results from the localparam avoid using the assignments with expressions containing parameters. Examples below