module concat(
input [7:0] data_in,
input rst,
input clk,
output reg[127:0] data_out,
output reg valid_out
);
integer i;
reg[127:0] datatemp=0;
always@(data_in)
begin
if(rst)
begin
data_out<=0;
datatemp<=0;
end
else
begin
for(i=0;i<=127;i=i+8)
begin
datatemp[i:i+7]<=data_in;
end
if(i==127)
begin
valid_out<=1;
data_out<=datatemp;
end
end
end
endmodule
This code is showing the following error:
Line 44: i is not a constant
Please tell me how to remove it. I'd be really grateful.