|
Chapter start Previous page Next page 10.14 ExecutionTwo successive statements may execute in either a concurrent or sequential fashion depending on where the statements appear. statement_1; statement_2; In sequential execution, entity Sequential_1 is end; architecture Behave of Sequential_1 is
signal s1, s2 : INTEGER := 0;
begin
process begin
s1 <= 1; -- sequential signal assignment 1
s2 <= s1 + 1; -- sequential signal assignment 2
wait on s1, s2 ;
end process;
end;
Time(fs) + Cycle s1 s2
---------------------- ------------ ------------
0+ 0: 0 0
0+ 1: * 1 * 1
0+ 2: * 1 * 2
0+ 3: * 1 * 2
If the two statements are
outside a entity Concurrent_1 is end; architecture Behave of Concurrent_1 is
signal s1, s2 : INTEGER := 0; begin
L1 : s1 <= 1; -- concurrent signal assignment 1
L2 : s2 <= s1 + 1; -- concurrent signal assignment 2
end;
Time(fs) + Cycle s1 s2
---------------------- ------------ ------------
0+ 0: 0 0
0+ 1: * 1 * 1
0+ 2: 1 * 2
The two concurrent signal
assignment statements in the previous example are equivalent to the two
processes, labeled as entity Concurrent_2 is end; architecture Behave of Concurrent_2 is
signal s1, s2 : INTEGER := 0; begin
P1 : process begin s1 <= 1; wait on s2 ; end process;
P2 : process begin s2 <= s1 + 1; wait on s1 ; end process;
end;
Time(fs) + Cycle s1 s2
---------------------- ------------ ------------
0+ 0: 0 0
0+ 1: * 1 * 1
0+ 2: * 1 * 2
0+ 3: * 1 2
Notice that the results are
the same (though the trace files are slightly different) for the architectures
The various concurrent and sequential statements in VHDL are summarized in Table 10.18.
|
|
|||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||