Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
....
lp1: for i in 10 downto 0 loop
if abs(input) <= bnds(i) then
catVal := cats(i);
else
if input(10) = '0' then
addBitsTemp := input;
else
addBitsTemp := input + bnds(i+1);
end if;
exit lp1;
end if;
end loop;
....
lp2: while zeros >= 16 loop
zeros := zeros - 16;
zrlBuf(count1) <= X"F";
catBuf(count1) <= X"0";
addBitsBuf(count1) <= (others => '0');
count1 := count1 + 1;
end loop lp2;
....[\code]
The first is a for loop, so probably doesn't cause this error. The second loops exit is dependant on the value of [code]zeros[\code], so may cause the problem. Thing is, the behavioural simulation of the code works perfect.
What do you think?
lp2: for i in 3 downto 0 loop
exit lp2 when zeros < 16;
zeros := zeros - 16;
zrlBuf(count1) <= X"F";
catBuf(count1) <= X"0";
addBitsBuf(count1) <= (others => '0');
count1 := count1 + 1;
end loop lp2;[\code]
zeros is a 8-bit wide std_logic_vector. When that value is over 16, I need to place "1111" on the zrlBuf array, and "0000" on the catBuf array. I need to do this until zeros is less than 16.
I realised that the loop did not need to iterate more than 4 times, so I added the for loop. I don't get that error when I synthesise it now, but I get an unrelated error, which I'll start a new thread for.
Thanks,
Ciaran
P.S. I do know that if something simulates correctly it doesn't necessarily mean that it will synthesise.
if zeros >= 48 then
zrlBuf(count1) <= X"F";
zrlBuf(count1 + 1) <= X"F";
zrlBuf(count1 + 2) <= X"F";
catBuf(count1) <= X"0";
catBuf(count1 + 1) <= X"0";
catBuf(count1 + 2) <= X"0";
count := count + 3;
elsif zeros >= 32 then
zrlBuf(count1) <= X"F";
zrlBuf(count1 + 1) <= X"F";
catBuf(count1) <= X"0";
catBuf(count1 + 1) <= X"0";
count := count + 2;
elsif zeros >= 16 then
zrlBuf(count1) <= X"F";
catBuf(count1) <= X"0";
count := count + 1;
end if;[\code]
Thanks
Ciaran
if zeros >= 16 then
zrlBuf(count1) <= X"F";
catBuf(count1) <= X"0";
count := count + 1;
zeros := zeros - 1;
end if;
if zeros >= 16 then
zrlBuf(count1) <= X"F";
catBuf(count1) <= X"0";
count := count + 1;
zeros := zeros - 1;
end if;
if zeros >= 16 then
zrlBuf(count1) <= X"F";
catBuf(count1) <= X"0";
count := count + 1;
zeros := zeros - 1;
end if;[\code]