[sv-ac] RE: Two items for ease of assertion writing

From: Korchemny, Dmitry <dmitry.korchemny@intel.com>
Date: Mon Apr 12 2010 - 23:16:44 PDT

Hi Tom,

Please, see my comments below.

Thanks,
Dmitry

-----Original Message-----
From: Thomas Thatcher [mailto:thomas.thatcher@oracle.com]
Sent: Tuesday, April 13, 2010 12:47 AM
To: Korchemny, Dmitry
Cc: sv-ac@eda.org
Subject: Two items for ease of assertion writing

Hi Dmitry,

I have two question that my turn into enhancement
requests/clarifications if necessary.

1. Use of sampled values in action blocks: It appears that to get
meaningful messages in action blocks, you must explicitly $sample() all
variables that are used in the message, or you will get interesting results

for example
     assert property (@(posedge clk) req |-> req_id != 4'b0) else
         $display("Error, 0 is an invalid ID: req_id=%d", req_id);

If the sampled value is 0, but the signal changes to 1 in the same time
step, you'll get the following message:
     Error, 0 is an invalid ID: req_id=1

(I guess one approach would be to write the assertions inside a checker)

[Korchemny, Dmitry] Yes, this is a common pitfall. Inside a checker it will work correctly even without $sampled.

2. Is there a way to index an array enclosed by $past() using the
current sampled value of a variable?

for example
     txn_valid(txn_id) && $past(txn_valid[txn_id])
                         ^want to index with the
                          current sampled value
                          of txn_id

The only way I have figured out to make this work is to explicitly
create a delayed version of txn_valid and use that instead of the
$past() function.

Another option I thought of just now would be to extend the $stable()
system function to take an optional parameter for number of cycles.

[Korchemny, Dmitry] If I understand your question correctly, you can write it as:
txn_valid(txn_id) && $past(txn_valid[$sampled(txn_id)])

I can enter Mantis items if either of these turns out to be more than
just a user education issue.

Thanks,

Tom

On 04/12/10 10:15, Korchemny, Dmitry wrote:
> Hi all,
>
>
>
> In the reminder I sent was written that the meeting would take place in
> two weeks. This is a copy-paste mistake. The meeting will take place
> *tomorrow*. The date in the invitation Date: 2010-04-13 Time: 16:00 UTC
> (09:00 PDT) is correct.
>
>
>
> Thanks,
>
> Dmitry
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>
> --
> This message has been scanned for viruses and
> dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is
> believed to be clean.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Apr 12 23:19:51 2010

This archive was generated by hypermail 2.1.8 : Mon Apr 12 2010 - 23:19:59 PDT