我已经定义了
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}}.
请帮忙
答案 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提供了更大的灵活性