2013-02-17 108 views
0

我有这个模块。问题是gameArray[0][x][y-1]不起作用。执行这种操作的正确方法是什么?基本上它类似于C++语法,但不能让它工作。verilog阵列引用

module write_init_copy(
    input clk, 
    input gameArray [1:0][63:0][127:0], writecell, processedcell, 
    input [5:0] x, 
    input [6:0] y, 
    input initialize, copyover, 
    output reg done_initialize, done_copy, done_writecell); 

[email protected](posedge clk) 
begin 
    if(writecell == 1) 
    begin 
     gameArray[1][x][y] <= processedcell; 
     done_writecell <= 1; 
    end 
    else if(initialize == 1) 
    begin 

    end 
end 

endmodule 
+0

你是怎么声明'gameArray'的? – timrau 2013-02-17 15:17:54

+0

模块的端口有问题吗? 4'端口...或者它只是一个简单的切割和瓦斯错误? – vermaete 2013-02-17 15:33:08

+0

@vermaete @ timrau编辑。刷新tnx – WantIt 2013-02-17 15:38:00

回答

2

gameArray被声明为输入,所以你不能分配给它。如果你想要修改它,则声明一个单独的'in'和'out'版本,其中< = f(in);即

gameArray_out <= gameArray_in; 
gameArray_out[1][x][y] <= procesedcell;