From: Shalom Bresticker (Shalom.Bresticker@motorola.com)
Date: Wed Feb 14 2001 - 01:30:17 PST
<x-html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Consider this and the following mail.
<p>While we understand what we intended, I think Ben is right that
the standard is not explicit and clear enough on this issue.
<p>Shalom
<p>-------- Original Message --------
<table BORDER=0 CELLSPACING=0 CELLPADDING=0 >
<tr>
<th ALIGN=RIGHT VALIGN=BASELINE NOWRAP>Subject: </th>
<td>LRM 5.x: Unclear about when block refires on same event that changed</td>
</tr>
<tr>
<th ALIGN=RIGHT VALIGN=BASELINE NOWRAP>Date: </th>
<td>Tue, 13 Feb 2001 13:39:51 EST</td>
</tr>
<tr>
<th ALIGN=RIGHT VALIGN=BASELINE NOWRAP>From: </th>
<td>VhdlCohen@aol.com</td>
</tr>
<tr>
<th ALIGN=RIGHT VALIGN=BASELINE NOWRAP>To: </th>
<td>vlog-synth@eda.org</td>
</tr>
</table>
<p><font face="arial,helvetica"><font size=-1>This is in reference to blocking
assignment.</font></font>
<p><font face="arial,helvetica"><font size=-1>LRM 5.6.3 says "When the
process is returned, the process performs the</font></font>
<br><font face="arial,helvetica"><font size=-1>assignment</font></font>
<br><font face="arial,helvetica"><font size=-1>to the left-hand side and
enables any events based upon the update of the</font></font>
<br><font face="arial,helvetica"><font size=-1>left-hand side.</font></font>
<br><font face="arial,helvetica"><font size=-1>LRM 5.4 shows the
Verilog simulation reference model, and says "while (there</font></font>
<br><font face="arial,helvetica"><font size=-1>are events) ".</font></font>
<br><font face="arial,helvetica"><font size=-1>Thus, you could argue that
after ther #10, ben gets ~ben, and that generates</font></font>
<br><font face="arial,helvetica"><font size=-1>an "active event",</font></font>
<br><font face="arial,helvetica"><font size=-1>that sould be re-examined.
Thus, it would seem that the "always block"</font></font>
<br><font face="arial,helvetica"><font size=-1>should be</font></font>
<br><font face="arial,helvetica"><font size=-1>invoked again. Searched
LRM for more info on that, and could not find any.</font></font>
<p><font face="arial,helvetica"><font size=-1>Referencing Cummings SNUG
presentation "Nonblocking Assignments in Verilog</font></font>
<br><font face="arial,helvetica"><font size=-1>Synthesis, Coding</font></font>
<br><font face="arial,helvetica"><font size=-1>Styles That Kill!",
section 7.0 Self-triggering always blocks, and</font></font>
<br><font face="arial,helvetica"><font size=-1>based upon what is observed,
I came up with this equivalent rule.</font></font>
<br><font face="arial,helvetica"><font size=-1>My defintion of "time T"
is current sim time. Time T + delta is a different</font></font>
<br><font face="arial,helvetica"><font size=-1>time T.</font></font>
<br><font face="arial,helvetica"><font size=-1>Rule</font></font>
<br><font face="arial,helvetica"><font size=-1>"At any time T, if a block
is fired because of an event on a signal in its</font></font>
<br><font face="arial,helvetica"><font size=-1>senstivity list, then that
block will NOT</font></font>
<br><font face="arial,helvetica"><font size=-1>be refired in the same time
T as a result of a change of the same signal.</font></font>
<br><font face="arial,helvetica"><font size=-1>That rule makes sense because
if at any sim time, a block fires as a reselt</font></font>
<br><font face="arial,helvetica"><font size=-1>of an event in its sensitivity
list,</font></font>
<br><font face="arial,helvetica"><font size=-1> it does not need to
refire because of the same event.</font></font>
<p><font face="arial,helvetica"><font size=-1>HOWEVER, this rule is NOT
in the LRM. Can soimeone explain to me, from an</font></font>
<br><font face="arial,helvetica"><font size=-1>LRM definition, why</font></font>
<br><font face="arial,helvetica"><font size=-1>a Verilog always block cannot
trigger itself?</font></font>
<p><font face="arial,helvetica"><font size=-1>Thus,</font></font>
<br><font face="arial,helvetica"><font size=-1>always(@ a or @ b)
// P1 block</font></font>
<br><font face="arial,helvetica"><font size=-1>
begin</font></font>
<br><font face="arial,helvetica"><font size=-1>
#10 a =~ a;</font></font>
<br><font face="arial,helvetica"><font size=-1>
c = b;</font></font>
<br><font face="arial,helvetica"><font size=-1>
end</font></font>
<p><font face="arial,helvetica"><font size=-1>initial
// P2 block</font></font>
<br><font face="arial,helvetica"><font size=-1> begin</font></font>
<br><font face="arial,helvetica"><font size=-1>
a = 1;</font></font>
<br><font face="arial,helvetica"><font size=-1>
d = 0;</font></font>
<br><font face="arial,helvetica"><font size=-1>
#10;</font></font>
<br><font face="arial,helvetica"><font size=-1>
b = ~ d;</font></font>
<br><font face="arial,helvetica"><font size=-1> end</font></font>
<p><font face="arial,helvetica"><font size=-1>P1 is scheduled to fire on
an event in "a" or "b"</font></font>
<br><font face="arial,helvetica"><font size=-1>AT time 10, if P1
fires first (P2 could fire first) then</font></font>
<br><font face="arial,helvetica"><font size=-1> reg (or signal) "a"
changes to 0, thus an event.</font></font>
<br><font face="arial,helvetica"><font size=-1>But, P1 will not refire
because of "a" event.</font></font>
<br><font face="arial,helvetica"><font size=-1>P2 fires next, and "b" changes.</font></font>
<br><font face="arial,helvetica"><font size=-1>P1, scheduled to fire on
event "b" refires.</font></font>
<p><font face="arial,helvetica"><font size=-1>However, if at time 10, P2
fires first. then then P1 fires because of events</font></font>
<br><font face="arial,helvetica"><font size=-1>"a" and "b".</font></font>
<br>
<p><font face="arial,helvetica"><font size=-1>------------------------------------------------------------------------------</font></font>
<p><font face="arial,helvetica"><font size=-1>--------------------------------------</font></font>
<br><font face="arial,helvetica"><font size=-1>Ben Cohen
Publisher, Trainer, Consultant (310) 721-4830</font></font>
<br><font face="arial,helvetica"><font size=-1>http://www.vhdlcohen.com/>
vhdlcohen@aol.com</font></font>
<br><font face="arial,helvetica"><font size=-1>Author of following textbooks:</font></font>
<br><font face="arial,helvetica"><font size=-1>* Component Design by Example
... a Step-by-Step Process Using</font></font>
<br><font face="arial,helvetica"><font size=-1> VHDL with UART as
Vehicle", 2001 isbn 0-9705394-0-1</font></font>
<br><font face="arial,helvetica"><font size=-1>* VHDL Coding Styles and
Methodologies, 2nd Edition, 1999 isbn 0-7923-8474-1</font></font>
<br><font face="arial,helvetica"><font size=-1>* VHDL Answers to Frequently
Asked Questions, 2nd Edition, isbn 0-7923-8115</font></font>
<br><font face="arial,helvetica"><font size=-1>------------------------------------------------------------------------------</font></font>
<p><font face="arial,helvetica"><font size=-1>--------------------------------------</font></font></html>
</x-html>
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:54:39 PDT
and
sponsored by Boyd Technology, Inc.