step by step execution in modelsim
paradbird said:
I always meet this error when I simulate in modelsim:
# Iteration limit reached. Possible zero delay oscillation. See the manual.
what this mean and how can I do ?
Thanks.
A VHDL process will restarts when it reaches the 'end process' statement.
If you have a sensitivity list 'process(sig1, sig2, ...)' this is OK, because it will do a
wait on sig1, sig2, ...
at the start of the process.
However if you have a process without sensitivity list that doesn't wait explicitly either, you generate an infinite loop at some absolute simulation time.
E.g.
process
begin
report "this process will loop indefinitely at" & time'image(now);
end process;
you'll get
this process will loop indefinitely at 0 ns
this process will loop indefinitely at 0 ns
this process will loop indefinitely at 0 ns
...
After retriggering a certain process several hundreds of time without seeing simulation time (0 ns) advance Modelsim will abort and show this indefinite loop.
You can avoid this by inserting a wait statement for the signals that you want to keep track of, by adding the sensitivity list (which does basically the same since a sensitivity list gets expanded to a wait statement on the first line of the process.
Or by waiting indefinitely if you want to 'end' the process
process
begin
report "this process will print just once and then block";
wait;
end process;
This problem can also occur by feedback loops where a process keeps on triggering itself or a circular chain of processes without advancing actual simulation time.
E.g.
(concurrent statement)
Clk <= not Clk;
(equivalent to process with sequential statement:
process(Clk)
begin
Clk<=not Clk;
end process;
)
will loop indefinitely at 0 ns and produce the Modelsim error because each update of Clk retriggers the process at the same simulation time.
OK would be:
Clk <= not Clk after 1 ns;
because there there is only 1 execution of the process per simulation time step (1 ns).
Hope this helps.