0

How can one initialize parameter type array in verilog where each of members are 32 bit hexadecimal notation numbers? I have tried the following but it gives me syntax error.

parameter [31:0] k[0:63] = {32'habc132, 32'hba324f, ...};

I'm using latest version of iverilog for compiling.

The amateur programmer
  • 1,238
  • 3
  • 18
  • 38

1 Answers1

4

On EDA Plyground The following example works using modelsim 10.1, the file has a .sv extension, causing it to be interpreted as SystemVerilog:

module test;
parameter [31:0] k [0:1] = {32'habc132, 32'hba324f};

  initial begin
    $displayh(k[0]);
    $displayh(k[1]);
  end
endmodule

If setting to SystemVerilog does not work or is not available for your simulator I suggest including the syntax error in the question.

Morgan
  • 19,934
  • 8
  • 58
  • 84