system-verilog

localparam of struct type - using default values - still requires initializer?


Should a localparam of a struct type still require an initializer if it has default initial values?

Eg

typedef struct {
 int a = 1;
} my_struct;

localparam my_struct m;

Solution

  • SystemVerilog syntax/semantics requires a declaration assignment for any localparam declaration, or a parameter declaration outside the module header (i.e. inside the module body).