Simulating in EdaPlayground the following code,
gives me the simulation results below the code
--CONCURRENT PROCEDURE CALL TIMING PROBLEM
ENTITY tb IS
END ENTITY tb;
ARCHITECTURE sim OF tb IS
SIGNAL cnt : integer RANGE 0 TO 3 := 0;
SIGNAL str : string(1 TO 5) := (OTHERS => ' ');
PROCEDURE test (CONSTANT number : IN integer RANGE 0 TO 3 := 0;
SIGNAL num_str : OUT string(1 TO 5)) IS
BEGIN
CASE number IS
WHEN 0 => num_str <= "zero "; REPORT "Zero";
WHEN OTHERS => num_str <= "one "; REPORT "One";
END CASE;
END PROCEDURE;
BEGIN
test(cnt, str); -- CONCURRENT CALL TO PROCEDURE TEST
PROCESS
BEGIN
FOR i IN 0 TO 3 LOOP
WAIT FOR 10 ns; --this timing is not OK. Second transaction is @20ns WHY not @10ns
cnt <= i;
--WAIT FOR 10 ns; --this timing is OK
END LOOP;
WAIT;
END PROCESS;
----Process
-- begin
--wait until cnt'transaction;
--report "*******************Transaction happen at report current time = " & time'image(now);
--end process;
END ARCHITECTURE sim;
My question is, why simulation Time advances 0ns,20ns, 30ns, 40ns and not
0ns, 10ns, 20ns, 30ns ?
If i move the ‘WAIT FOR 10 ns;’ after cnt <=i; simulation timing looks correct.
Is it some sort of race condition?
New contributor
user24973442 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.