Guest
Hi,
I am trying to monitor the loop index within a procedure in a VHDL
testbench as follows:
procedure test (signal Clock : std_logic;
Times : integer;
signal Data : std_logic_vector(7 downto 0) ) is
variable wait_index : integer;
variable i : integer;
variable j_help : integer;
variable ln : line;
begin
wait_index := Times;
LOOP1_OUT : for i in 0 to 15000 loop
j_help := i;
if (i <= wait_index) then
if i=wait_index then
writeline(OUTPUT,ln);
write(ln,string'("loop "));
write(ln,j_help);
end if;
wait on Clock, Data;
exit LOOP1_OUT when Data="10000100";
end if;
end loop;
end test;
-- Calling procedure within main process
process
begin
test(t_Clock, 50, t_Data);
wait;
end process;
I get no monitoring in Modelsim at all. Why?
("Data" remains "00000000" all the time so that no
loop exit comes into question)
When I comment the inner if-statement out
if (i <= wait_index) then
--if i=wait_index then
writeline(OUTPUT,ln);
write(ln,string'("loop "));
write(ln,j_help);
--end if;
wait on Clock, Data;
exit LOOP1_OUT when Data="10000100";
end if;
I get monitored in Modelsim
loop 0
loop 1
....
loop 49
But loop 50 is missing. Why?
Changings to
writeline(OUTPUT,ln);
write(ln,string'("loop "));
write(ln,i);
do not change anything.
Thank you for your help.
Rgds
André
I am trying to monitor the loop index within a procedure in a VHDL
testbench as follows:
procedure test (signal Clock : std_logic;
Times : integer;
signal Data : std_logic_vector(7 downto 0) ) is
variable wait_index : integer;
variable i : integer;
variable j_help : integer;
variable ln : line;
begin
wait_index := Times;
LOOP1_OUT : for i in 0 to 15000 loop
j_help := i;
if (i <= wait_index) then
if i=wait_index then
writeline(OUTPUT,ln);
write(ln,string'("loop "));
write(ln,j_help);
end if;
wait on Clock, Data;
exit LOOP1_OUT when Data="10000100";
end if;
end loop;
end test;
-- Calling procedure within main process
process
begin
test(t_Clock, 50, t_Data);
wait;
end process;
I get no monitoring in Modelsim at all. Why?
("Data" remains "00000000" all the time so that no
loop exit comes into question)
When I comment the inner if-statement out
if (i <= wait_index) then
--if i=wait_index then
writeline(OUTPUT,ln);
write(ln,string'("loop "));
write(ln,j_help);
--end if;
wait on Clock, Data;
exit LOOP1_OUT when Data="10000100";
end if;
I get monitored in Modelsim
loop 0
loop 1
....
loop 49
But loop 50 is missing. Why?
Changings to
writeline(OUTPUT,ln);
write(ln,string'("loop "));
write(ln,i);
do not change anything.
Thank you for your help.
Rgds
André