[sv-ac] Ambiguous return value for $past

From: Stuart Sutherland <stuart_at_.....>
Date: Thu Apr 14 2005 - 01:28:13 PDT
LRM 18.7.3 does not fully specify the return value of $past when the
optional "expression2" is used.  It states:

-------------
When expression2 is specified, the sampling of expression1 is performed
based on its clock gated with expression2. For example,

always @(posedge clk)
  if (enable) q <= d;

always @(posedge clk)
assert (done |=> (out == $past(q, 2,enable)) ;

In this example, the sampling of q for evaluating $past is based on the
clocking expression
-------------

There are two ambiguities, at least in how I read the LRM.

First is the statement "the sampling of expression1 is performed based on
its clock gated with expression2".  Is the gating based on the current
sampled value of expression2, or the sampled value of expression2 at the
specified number of clock ticks in the past?

Second, since $past is a function, and can also be called from procedural
code, it must return a value for when the enabling expression is either true
or false.  The return value for when expression2 is true is clear, but the
LRM does not define the return value for when the enabling expression is
false.  At least I didn't find a definition. 

Does anyone know the answers to these questions?

Thanks,

Stu
~~~~~~~~~~~~~~~~~~~~~~~~~
Stuart Sutherland
stuart@sutherland-hdl.com
+1-503-692-0898
 
Received on Thu Apr 14 01:28:22 2005

This archive was generated by hypermail 2.1.8 : Thu Apr 14 2005 - 01:30:05 PDT