Verification Guild
A Community of Verification Professionals

 Create an AccountHome | Calendar | Downloads | FAQ | Links | Site Admin | Your Account  

Login
Nickname

Password

Security Code: Security Code
Type Security Code
BACKWARD

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Modules
· Home
· Downloads
· FAQ
· Feedback
· Recommend Us
· Web Links
· Your Account

Advertising

Who's Online
There are currently, 47 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

  
Verification Guild: Forums

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile  ProfileDigest    Log inLog in 

Help in understanding an assertion

 
Post new topic   Reply to topic    Verification Guild Forum Index -> Main
View previous topic :: View next topic  
Author Message
tzar
Senior
Senior


Joined: Nov 28, 2007
Posts: 69

PostPosted: Mon Mar 12, 2012 5:02 am    Post subject: Help in understanding an assertion Reply with quote

Hi all,
I have no doubt that this is a classic gotcha I have fallen into but I am falling to understand the way the following assertion works:

Code:

property pTEST;
   @(posedge CLK)
   $rose(A) |-> ##[0:$]$rose(B) ##4 $rose(C);
endproperty
aTEST: assert property(pTEST);


What I was hoping this assertion would do was, after the rising edge on A, it would check for the 1st rising edge on B and the make sure that 4 cycles after B that C occurred. The assertion works fine (passes) if this occurs but does not fail if B is not followed by C. What actually happens if C does not follow B is that it waits for the next occurrence of B, checks if C occurs after that, if not it waits for the next occurrence of B and checks for C after than, and so on. That is, the assertion never fails.

I have no doubt that this is expected behavior but I would like to understand why as intuitively I think the assertion looks correct.

Just to note that I have rewritten the assertion as follows which does do what I require:

Code:

property pTEST;
   @(posedge CLK)
   $rose(A) |-> !B[*0:$] ##1 B ##4 $rose(C);
endproperty
aTEST: assert property(pTEST);


Thank all.
Back to top
View user's profile
vhdlcohen
Industry Expert
Industry Expert


Joined: Jan 05, 2004
Posts: 1240
Location: Los Angeles, CA

PostPosted: Mon Mar 12, 2012 9:56 am    Post subject: Reply with quote

Quote:
but I would like to understand why as intuitively I think the assertion looks correct.

a |-> ##[0:$] seq; // seq is some sequence
is same as
a |-> (##0 seq) or (##1 seq) or (##2 seq) or .... (##n seq);
// where n is infinity, and "or" is the sequence or operator.

the a |-> b[->1] ##4 c; // is the same as your solution where you're looking for the first occurrence of b and then 4 cycles later b. That can fail if b occurs.
_________________
Ben Cohen http://www.systemverilog.us/
* SystemVerilog Assertions Handbook, 3rd Edition, 2013
* A Pragmatic Approach to VMM Adoption
* Using PSL/SUGAR ... 2nd Edition
* Real Chip Design and Verification
* Cmpt Design by Example
* VHDL books
Back to top
View user's profile Send e-mail Visit poster's website
tzar
Senior
Senior


Joined: Nov 28, 2007
Posts: 69

PostPosted: Mon Mar 12, 2012 11:17 am    Post subject: Reply with quote

Ah, now it makes sense. Perfect and simple explanation. Thanks.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Verification Guild Forum Index -> Main All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Verification Guild © 2006 Janick Bergeron
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.208 Seconds