Initial execution of the processes and sensitivity list

Discussion in 'VHDL' started by valtih1978, Jan 7, 2013.

  1. valtih1978

    valtih1978 Guest

    The processes must be executed only when sensitivity signals are
    changed. However, LRM says that "For each nonpostponed process P in the
    model, The process executes until it suspends" in the initialization.

    How is this related with sensitivity wait statement?
    valtih1978, Jan 7, 2013
    1. Advertisements

  2. valtih1978

    valtih1978 Guest

    I think that this is because given two processes,

    X <= A + 1;


    A <= 1;

    Both will execute but A has a wrong value during first execution. Then,
    X start waiting for A, which updated during first execution, will
    re-trigger X for the second time. This time, A value is ok and X is
    updated properly. *It does not matter if wait on A is located in the
    beginning of X or in the end.*

    Is it right? I am not sure what about wait in the middle of process and
    how (shared) variables, who take values immediately, react.
    valtih1978, Jan 7, 2013
    1. Advertisements

  3. What do you mean by "sensitivity wait statement"? There is a wait statement,
    and there is a sensitivity list.

    A process with a sensitivity list is the same as a process with a "WAIT ON"
    (with the same signals) at the end of the process.

    p1: PROCESS(a, b, c) IS

    p2: PROCESS IS
    WAIT ON a, b, c;

    Processes p1 an p2 are equivalent.

    At time zero and delta zero process p2 is run until it hits the WAIT
    statement and suspends until an event occurs on one of the signals.
    Paul Uiterlinden, Jan 7, 2013
  4. Written as processes with a wait statement:

    p_x: PROCESS IS
    x <= a + 1;
    WAIT ON a;
    END PROCESS p_x;

    p_a: PROCESS IS
    a <= 1;
    WAIT; -- for ever
    END PROCESS p_a;
    No. The result on x will be different from time 0 ns + 1 delta to 0 ns + 2
    A signal is updated one delta cycle after the signal assignment. First grasp
    the idea what that means.

    Run the above example with "AFTER 1 ns" in each signal assignment and look
    at the result in the wave form viewer. The deltas are now replaced by 1 ns.
    It should make things clear.

    By the way: ModelSim has the ability the show the deltas in the wave form
    viewer, so adding the 1 ns delays is not strictly necessary to be able to
    see the order of events. And there is also a list window that shows the
    events down to the delta level.
    Paul Uiterlinden, Jan 7, 2013
  5. It seems that I have discovered rationale for making sensitivity wait
    the last statement in the process. As Ashenden writes in the "Designer's
    is started and executes the sequentialstatements in its body. **We
    usually write a model so that at least some of these initial statements
    schedule some transactions to get the simulation under way, then suspend
    by executing a wait statement.** When all of the process instances have
    suspended, initialization is complete and the simulator can start the
    first simulation cycle."

    I have emphasized the key idea, IMO. If the wait statement would be the
    first one then all the processes would wait for another and execution
    would never start. Right?
    Valentin Tihhomirov, Jan 17, 2013
  6. valtih1978

    Jim Lewis Guest

    "Initialization" is the execution phase of time 0, delta cycle 0.
    "Elaboration + Initialization" are simply a specialized simulation
    cycle that starts all VHDL simulations.

    "The process executes until it suspends" means:
    Processes with sensitivity lists run in their entirety.
    Concurrent assignments are treated as their equivalent
    process with a sensitivity list.
    Processes with wait statements run until they hit the first wait statement.

    Jim Lewis, Jan 21, 2013
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.