D
Dave Smith
Guest
Greetings all -
I am currently writing a simple module that reads a value from a lookup
table based on two inputs, and then uses that value as a loop counter
for the suqsequent instructions. The code I have looks like the
following:
--InjTable is declared as an 8x8 table of integers
--enginespeed and engineload are input variables
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
widthcount := InjTable(enginespeed)(engineload);
PulseWidth:loop
InjPulse <= '1';
widthcount := widthcount -1;
exit when (widthcount = 0);
end loop PulseWidth;
I have also tried setting this up as a while loop and for loop, and
everytime I get the same compile error that "loop must terminate at or
before 10000 iterations". The largest table value is 64 so how can the
compiler deduce this? Is there something wrong with the logic I've
used to exit the loop??
Thanks in advance
I am currently writing a simple module that reads a value from a lookup
table based on two inputs, and then uses that value as a loop counter
for the suqsequent instructions. The code I have looks like the
following:
--InjTable is declared as an 8x8 table of integers
--enginespeed and engineload are input variables
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
widthcount := InjTable(enginespeed)(engineload);
PulseWidth:loop
InjPulse <= '1';
widthcount := widthcount -1;
exit when (widthcount = 0);
end loop PulseWidth;
I have also tried setting this up as a while loop and for loop, and
everytime I get the same compile error that "loop must terminate at or
before 10000 iterations". The largest table value is 64 so how can the
compiler deduce this? Is there something wrong with the logic I've
used to exit the loop??
Thanks in advance