Way to initialize synthesizable 2D array with constant values in Verilog

前端 未结 4 1139
陌清茗
陌清茗 2021-01-06 00:58

in VHDL, I can easily do this:

constant    cmdbytes       : bytearray(0 to Total) := (x\"05\", x\"00\", x...};

I want synthesizable constan

4条回答
  •  有刺的猬
    2021-01-06 01:31

    Does this work?

    reg [31:0] array2d[3:0]
    ....
    array2d[3:0] = {{32'd0}};
    

    or

    array2d[3:0] = {32'd0, 32'd0, 32'd0, 32'd0}
    

提交回复
热议问题