R
Ronan Guivarc'h
Guest
Hello,
i discover something strange today concerning signal assignment.
I used to think that when a signal is reevaluated at time t,
the computed values of the future of t are destroyed and we computed
new ones with their delay assigment. Until the following example
entity evaluation is
end evaluation;
architecture arch_evaluation of evaluation is
signal A : integer := 0;
signal B : integer := 10;
begin
A <= 1, 2 after 10 ns;
process
begin
wait on A;
if(A = 1) then
B <= 2 after 30 ns;
elsif(A=2) then
B <= 2 after 25 ns;
end if;
end process;
end arch_evaluation;
I thought that
- the first assignment of A would produce the estimate of B
with the value 2 at 30 ns
- the second assignment of A (before 30 ns then before B assignment)
would destroy this estimate and produce the estimate of B
with the value 2 at 35 ns.
Then B would be assigned only at time 35 ns
In fact with my simulators (nclaunch or simili), B is assigned at 30 ns.
And when i put two different values in B,
if(A = 1) then
B <= 2 after 30 ns;
elsif(A=2) then
B <= 4 after 25 ns;
end if;
B is only assigned at 35 ns with the value 4 (the first estimate is
destroyed)
Is it normal ?
what is the physical explanation ? My example has perhaps no physical
reality ?
thanks for your answers
Ronan
i discover something strange today concerning signal assignment.
I used to think that when a signal is reevaluated at time t,
the computed values of the future of t are destroyed and we computed
new ones with their delay assigment. Until the following example
entity evaluation is
end evaluation;
architecture arch_evaluation of evaluation is
signal A : integer := 0;
signal B : integer := 10;
begin
A <= 1, 2 after 10 ns;
process
begin
wait on A;
if(A = 1) then
B <= 2 after 30 ns;
elsif(A=2) then
B <= 2 after 25 ns;
end if;
end process;
end arch_evaluation;
I thought that
- the first assignment of A would produce the estimate of B
with the value 2 at 30 ns
- the second assignment of A (before 30 ns then before B assignment)
would destroy this estimate and produce the estimate of B
with the value 2 at 35 ns.
Then B would be assigned only at time 35 ns
In fact with my simulators (nclaunch or simili), B is assigned at 30 ns.
And when i put two different values in B,
if(A = 1) then
B <= 2 after 30 ns;
elsif(A=2) then
B <= 4 after 25 ns;
end if;
B is only assigned at 35 ns with the value 4 (the first estimate is
destroyed)
Is it normal ?
what is the physical explanation ? My example has perhaps no physical
reality ?
thanks for your answers
Ronan