cyboman
Member level 4
i have a very simple code, which i'm using as a testbench but when i check its syntax (ISE WebPack 11.1 has an option to check for it) i get an error:
ERROR:HDLCompiler:44 - Line 57: i is not a constant
does anybody know how i can fix this?
any help is appreciated
ps. i'm very new to digital design
ERROR:HDLCompiler:44 - Line 57: i is not a constant
Code:
integer i;
initial begin
clk = 0;
reset = 1;
#20;
reset = 0;
// enter correct code;
for (i = 9; i >= 0; i = i - 2) begin
btn = correct_code[i:i-1]; // <-- this is line 57
end
end
does anybody know how i can fix this?
any help is appreciated
ps. i'm very new to digital design