Home Specman / e Ignorance Is A Bliss

Search

Ignorance Is A Bliss PDF Print E-mail
User Rating: / 0
PoorBest 
Thursday, 24 December 2009 15:29

There is a rather confusing feature in Specman’s coverage engine that I would like to share with you today. I’ve met several people (including myself) who had been struggling to understand what was going on there and gave up Recently I was called to the rescue again with the same problem so I guess it’s a good opportunity to tell you guys about it.

 

So imagine you have a struct called packet. And in the packet you have a length field which could be anything from 0 to 255. You’re doing a lot of things with this packet in your environment and you also want to add some coverage. Let’s see some code:

struct packet {
length: byte;
 event cover_me;
 cover cover_me is {
 item length;
 };
};

Very simple so far. Next we want to limit the coverage spectrum of this item because we’re not interested in values over 100. We will use the ignore command for that:

item length using ignore = length > 100;

For the less experienced guys out there - note that the coverage commands ignore and when may look as two alternatives for limiting the coverage collection, but in fact they are fundamentaly different from each other and should be used for different purposes. The ignore command is used to narrow down the coverage spectrum while the when command is used to narrow down the number of coverage collection occurrences.

Back to our business, after we’ve narrowed down the coverage spectrum to values below 100 only, we want to have an additional limitation, and ignore values under 90.  Let’s do this:

item length using ignore = length > 100, ignore = length < 90;

You think this is going to work? Not really. The code will compile and run successfully but the coverage engine will only take into consideration the last ignore command. Really disappointing. This problem typically arises with more complex items such as cross items.

 

Now for the good news: the workaround is to write all your ignores in one (long) line Not so comfortable with complex items, but it’s the only way it will work. Also, make sure to use or (and not and) as a separator between adjacent ignore conditions because we’re dealing with inverse logic here.

So let’s conclude with the full example again, and a few lines of code that demonstrate it (you’re gonna have to open the coverage window to see this).

 

Here we go:

 

struct packet {
 length: byte;
 event cover_me;
 cover cover_me is {
 item length using 
 // the 2 lines below will NOT do the job
 //ignore = length > 100, // this ignore will be ignored !!
 //ignore = length < 90;
 // the line below WILL do the job 
 ignore = length > 100 or length < 90;
 };
 };
extend sys {
 !packet: packet;
 run() is also {
 for i from 1 to 100 {
 gen packet; 
 emit packet.cover_me;
 };
 };
 };

 

 
More articles :

» Latest Buzz From The EDA & Verification Community

{loadposition pos101}{loadposition pos102}{loadposition pos103}{loadposition pos104}{loadposition pos105}{loadposition pos106}{loadposition pos107}{loadposition pos108}{loadposition pos109}{loadposition pos110}{loadposition pos111}{loadposition...

» Inside The Verifiers Cubicle

Have you ever watched ? You know, the show where James Lipton hosts famous actors in front of a small audience of students? Remember? Anyway, this is actually one of my favorite shows on TV (and there aren’t that many really). Towards the end of...

» We Hear Ya!

 During the last months we conducted a poll about what you guys would you like to read more about on ThinkVerification and here are the results: Verification Methodology - 41%SystemVerilog Tutorials - 31%e Tutorials - 13%Interviews - 12%...

» To Do List 2010

Introducing Philip Americus - a new guest blogger here on Think Verification. Phil is an ASIC veteran who's worked with every phase of ASIC design - from initial concept to tapeout, with an emphasis on verification, including management of both HW...

» How To Choose Your Verification Service Provider

If you’re looking for an outsourcing solution for your verification problem then a quick look around will tell you that there are many alternatives out there. The number of verification contractors has grown rapidly over the recent years and today...

Comments  

 
0 #1 2010-01-02 05:09
Or you can use the "in" and range to make the code look nicer.

e.g. ignore = length not in [90..100];
Quote
 
 
0 #2 2010-01-03 15:53
from the post it can be understood that you must write the all ignores on an item in one place,
but this is not true since you can use "prev"
cover cover_me is {
05. item length using
10. ignore = length > 100;
11. };
12. };

cover cover_me is {
05. item length using
10. ignore = prev or length < 90;
11. };
12. };
Quote
 
 
0 #3 2010-01-03 17:05
Quoting Horace Chan:
Or you can use the "in" and range to make the code look nicer.

e.g. ignore = length not in [90..100];


Correct. Like I mentioned in the article, this problem typically arises with more complex items such as cross items.
Quote
 
 
0 #4 2010-01-03 17:10
Thanks for the insight, Ronen. But what if you don't want to extend the cover group, you just want to refine the original ignore statement with additional ignores separated by comma?
Quote
 

Add comment


Security code
Refresh

Copyright © 2017 Think Verification - Tips & Insights on ASIC Verification. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.