Problem: I have N elements of X bits each, and have them concatenated into 1 vector and now I want to unpack them into a matrix M[N][X] using for loops. For example,
input [N*X-1:0]VECTOR;
integer i;
reg [X-1:0]M[N-1:0];
always@(*) begin
for(i=0; i<N; i=i+1) begin
M[i] = VECTOR[(X*(i+1)-1):(X*i)];
end
end
However, the above code gives me the following error:
Error (10734): Verilog HDL error at FILE.v(line_number): i is not a constant