EmbDev.net

Forum: FPGA, VHDL & Verilog FATAL_ERROR: Iteration limit 10000 is reached


Author: Rohan Narkhede (Company: student) (rohan_n)
Posted on:

Rate this post
0 useful
not useful
Hi all,

I need some help. I am coding for a 32 bit adder using two 16 bit adders 
in Time Division Multiplexing using Moore State Machine such that the 
lower 16 bit adder results the lower 16 bits of sum and then in next 
clock cycle, the upper 16 bits are added by the same adder such that the 
carry generated by the lower 16 bit sum becomes the carry in for the 
upper 16 bit addition. When I simulate, for the upper 16 bit addition, 
the simulation goes in a loop (as desired) but it continues there 
continuously till 10000 iterations and then I get an error :

"FATAL_ERROR: Iteration limit 10000 is reached. Possible zero delay 
oscillation detected where simulation time can not advance."

How to write code for feedback circuit without reaching the iteration 
limits? (This logic is part of a system whose code files are too huge 
and complicated)

Author: Loop (Guest)
Posted on:

Rate this post
0 useful
not useful
Rohan N. wrote:
> in a loop (as desired)

Post the loop. There is something wrong with your code.

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Rohan N. wrote:
> "FATAL_ERROR: Iteration limit 10000 is reached.
Its fairly simple: you have a combinatorial loop in your code. Try to 
synthesize your code. The synthesizer will report a "combinatorial loop" 
or at least several "latches".
Try that with Google translator, its German:
http://www.lothar-miller.de/s9y/categories/36-Komb...

> (This logic is part of a system whose code files are too huge and
> complicated)
So post "this logic". A combinatorial loop usually its fairly easy to 
recognize, even when it is a gated combinatorial loop (and therefore 
reported as a latch by the synthesizer)...

Author: Rohan Narkhede (Company: student) (rohan_n)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hi,

Thanks for the reply and the link. I made some changes but now the 
simulation goes to infinite loop. It shows the message - Current time : 
0 fs. Please see the code files for this logic attached with the 
screenshot of simulation message. You can also try to simulate the code 
at your end with the files attached. Please let me know the cause of 
this and also suggest meathod to fix it.

Thanks and regards,
Rohan Narkhede

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Maybe this loop does not what you want it:
    for i in 1 to N-2 loop
       c(i+1) <= g(i) or (p(i) and c(i));
    end loop;
When you unroll it then you will have this here:
    c(2) <= g(1) or (p(1) and c(1));
    c(3) <= g(2) or (p(2) and c(2));
    c(4) <= g(3) or (p(3) and c(3));
    c(5) <= g(4) or (p(4) and c(4));
    c(6) <= g(5) or (p(5) and c(5));
    c(7) <= g(6) or (p(6) and c(6));
And now you must be aware of the behavioural of signals: they don't 
change their values throughout a process. Finally at the end of the 
process the new value is taken over.
So you ca write down this loop without any change in behaviour(!!!) 
like this:
    c(7) <= g(6) or (p(6) and c(6));
    c(2) <= g(1) or (p(1) and c(1));
    c(3) <= g(2) or (p(2) and c(2));
    c(6) <= g(5) or (p(5) and c(5));
    c(4) <= g(3) or (p(3) and c(3));
    c(5) <= g(4) or (p(4) and c(4));
Or this very similar way:
    c(7) <= g(6) or (p(6) and c(6));
    c(6) <= g(5) or (p(5) and c(5));
    c(5) <= g(4) or (p(4) and c(4));
    c(4) <= g(3) or (p(3) and c(3));
    c(3) <= g(2) or (p(2) and c(2));
    c(2) <= g(1) or (p(1) and c(1));

Is that ok for the functionof your adder?
Or did you expect something like a "propagating carry"?

A hint: you must use a local variable for that carry.

: Edited by Moderator
Author: Lothar Miller (lkmiller) (Moderator)
Posted on:
Attached files:

Rate this post
1 useful
not useful
ISE in Version 13.2 says:
WARNING:HDLCompiler:1369 - "C:/Projekte/FPGA/adder_tdm/tb_add_tdm.vhd"
     Line 45: Possible infinite loop; process does not have a wait statement
And indeed: a process without wait will "run" forever. Add a "wait":
p1: process
begin

A <= X"FFFFFFFF";
B <= X"00000001";
wait for 10 ns; 

end process p1;
Or remove the process:
--p1: process
--begin

A <= X"FFFFFFFF";
B <= X"00000001";
--wait for 10 ns; 

--end process p1;
Both will be fine...

However the design will not run. But you will be able to simulate it.

Author: Rohan Narkhede (Company: student) (rohan_n)
Posted on:

Rate this post
0 useful
not useful
Hi Lothar,

Thanks a lot for suggestion. By adding a delay, I am able to simulate 
the code.

But to run this logic, expanding the for loop (as stated in previous 
thread) may not be desired as I want to use this cla as generic.(correct 
me if I am wrong)

I am planning to add a 1 bit register in the feedback loop - between 
carry out of adder, cout_fdbk and the mux_one and controlled by control 
unit. The control unit may introduce a new state for this. Does this 
idea makes some sense? or there could be a better approach for this?

Thanks and regards,
Rohan

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Rohan N. wrote:
> Does this idea makes some sense?
Of course you will need a 1 bit register to memorize the carry out of 
the "first" 16 bit addition. But thats a extremely minor aspect of a 
problem.

> But to run this logic, expanding the for loop (as stated in previous
> thread) may not be desired as I want to use this cla as generic.(correct
> me if I am wrong)
Hopefully you got the point: its alle the same!!!
Your loop is the very same like may "unrolled" loops and as my 
"shuffeled unrolled" loops. And none of them will work as you expect it. 
You need a variable for that "immediate" carry propagation inside a 
process!

> or there could be a better approach for this?
I can see no need for such a "handmande" adder-construct. Why don't you 
just use the '+' sign?

Ok, one step back...
Rohan N. wrote:
> I am coding for a 32 bit adder using two 16 bit adders in Time Division
> Multiplexing using Moore State Machine such that the lower 16 bit adder
> results the lower 16 bits of sum and then in next clock cycle, the upper
> 16 bits are added by the same adder such that the carry generated by the
> lower 16 bit sum becomes the carry in for the upper 16 bit addition.
Split up that problem in smaller problems: first design your "handmade 
16-bit-adder". Write the adder module and write a test bench to simulate 
exactly and only that adder module.
When it runs design your "handmande multiplexer"(**). Then write a test 
bench to simulate that multiplexer only.
When that runs start with the overlying FSM that controls the whole 
thing. Use the 2 function proved modules "handmade adder" and "handmade 
multiplexer" in that FSM module. Then write a test bench to check the 
behaviour of the whole thing. Thats the way to design the whole thing...

(**) a multiplexer in vhdl can be written in one simple line of code 
like that:
  result <= inputA when selA else inputB;

: Edited by Moderator

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.