0

I have this module. The question is gameArray[0][x][y-1] doesn't work. What is the correct way to perform this kind of operation? Basically it is similar to C++ syntax but can not get it to work.

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);

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

    end
end

endmodule
4
  • How did you declare gameArray? Commented Feb 17, 2013 at 15:17
  • Is there something wrong with the ports of the module? The 4'the port... Or is it just a simple cut and wast error? Commented Feb 17, 2013 at 15:33
  • @vermaete @ timrau edited. refresh tnx Commented Feb 17, 2013 at 15:38
  • What error are you seeing? gameArray[] is an array of wires so procedural assignments won't work. The left hand side must be a variable(like reg). Commented Feb 17, 2013 at 16:23

1 Answer 1

2

gameArray is declared as an input so you can't assign to it. If you want you want to modify it declare a separate 'in' and 'out' version where out <= f(in); i.e.

gameArray_out <= gameArray_in;
gameArray_out[1][x][y] <= procesedcell;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.