process getting called more than once

G

googler

Guest
I have a process like below.

alu: process (ain, bin, sel, cinflag)
begin
....
end process alu;

Inside this process, it is modifying another signal cout based on the
values of the parameters. Basically, cout <= ain (op) bin. When the
signals ain and cout are identical, this ends up invoking the process
again (since the value of ain in the sensitivity list changes). How can
I prevent this from happening?

Thanks in advance.
 
Thanks for the reply. I understand this. But I was asking how do we
make sure that such a thing does not happen.

alu: process (ain, bin)
begin
cout <= {some function of ain and bin}
end process alu;

I mean the above process is getting called with a signal that is
serving as both ain and cout. So a change in the output cout results in
change in ain in the sensitivity list (in the next delta simulation
time). Is there any way I do not let the process be entered during this
next delta simulation time?



Egbert Molenkamp wrote:
I added two examples:

I added two example processes. Process no_problem assigns a value to b and
in the next delta that value is assigned to c.
In hardware this would result in a wire between a,b and c. No problem!

The next process, comb_loop, is more complicated. b is assigned the value of
a (after a delta). In the next delta a is assigned the inverse of b.
This will not be stable during simulation (assuming initial vlaue is
'0'/'1'). Synthesis will result in a combinational loop (output of inverter
connected with the input).

no_problem:process(a,b)
begin
b<= a;
c <=b;
end process;

comb_loop:process(a,b)
begin
b<=a;
a<=not b;
end process;

Egbert Molenkamp

"googler" <pinaki_m77@yahoo.com> schreef in bericht
news:1117428397.874853.285270@o13g2000cwo.googlegroups.com...
I have a process like below.

alu: process (ain, bin, sel, cinflag)
begin
...
end process alu;

Inside this process, it is modifying another signal cout based on the
values of the parameters. Basically, cout <= ain (op) bin. When the
signals ain and cout are identical, this ends up invoking the process
again (since the value of ain in the sensitivity list changes). How can
I prevent this from happening?

Thanks in advance.
 
HI

googler schrieb:
alu: process (ain, bin, sel, cinflag)
begin
...
end process alu;

Inside this process, it is modifying another signal cout based on the
values of the parameters. Basically, cout <= ain (op) bin. When the
signals ain and cout are identical, this ends up invoking the process
again (since the value of ain in the sensitivity list changes). How can
I prevent this from happening?
There should nothing happen as long as the sensitivity list contains no
signal that is inside the process on the left side.
I assume, that your cout has a feedback to ain outside the process.
There is no way to prevent a trigger on the process, but you could use
a after statement to prevent your signal toggling in deltas.
A typical code like
process (a,b)
begin
a <= a xor b
end process

would simulate ways faster when using
a <= a xor b after 2 ns
nevertheless you have a combinational feedback which should only be
used, as long as you know what you are doing.

bye Thomas
 

Welcome to EDABoard.com

Sponsor

Back
Top