|
From: Evan L. <sa2...@cy...> - 2018-07-02 15:18:55
|
On 02/07/2018 13:14, Martin Whitaker wrote: > Using 1364-2005 as a reference, section 11.6.3 states: > > "A blocking assignment statement (see 9.2.1) with a delay computes the > right-hand side value using the current values, then causes the > executing process to be suspended and scheduled as a future event. If > the delay is 0, the process is scheduled as an inactive event for the > current time. > > When the process is returned (or if it returns immediately if no delay > is specified), the process performs the assignment to the left-hand side > and enables any events based upon the update of the left-hand side. The > values at the time the process resumes are used to determine the > target(s). Execution may then continue with the next sequential > statement or with other active events." So your reading of 11.6.3 is that everything is statement-based, and the blocking assignment must be executed before the next statement, which is the event control (@(...)). Since the event control hasn't been executed yet, the process isn't sensitive to the update, so clk stops toggling. That makes sense, of course. But, at the same time, the actual algorithm in 11.4 isn't statement-based, and the algorithm couldn't run after every statement, or the scheduler wouldn't work - it can only run after suspend points such as delay or event controls (as is the case with VHDL and SystemC). I remember Steven Sharp confirming this in c.l.v, but I don't have a record. In this sense, it seems to me that 11.4 conflicts with 11.6.3. So, if you only ran the algorithm at the next event control, at the *same* simulation time, you'd discover an update event on clk at the *current* sim time, and you might be tempted to re-enable the process (in this case, 'clk' would start toggling), but no simulators I've tried actually do this. Maybe the fix is that processes are only sensitive to future events, and not events in the current time slot? I think my basic confusion is that 11.4 must be wrong. Some of the algorithm must run between statements, or blocking assignments wouldn't work. Some of it can't run between statements, such as enabling other processes which are sensitive to blocking assignments - this has to wait until a suspend point. |