Verilog中的2D阵列

时间:2013-04-10 16:34:25

标签: arrays verilog

我已经定义了

reg bricks[0:3][0:7]

在Verilog模块中。 如何将此二维数组指定为

{{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1}}.

请帮忙

1 个答案:

答案 0 :(得分:3)

reg bricks [0:3][0:7];     //creates an unpacked array 
                           // It means you can access individual bits

bricks[1][0] = 0 ;         // Assigns 0 to the bit referenced by 1 and 0 

bricks [2] = 0 ;           // Illegal Syntax

bricks [1][0:3] = 0 ;      //Illegal Syntax

系统verilog提供了更大的灵活性