Ignorance Is A Bliss Print
User Rating: / 0
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 :

» Top 10 Verification Myths

Let’s unveil the truth behind some of the common myths out there!

» VMM Hackers Guide - Default Behavior For Your BFM

Here's a short tutorial on how to implement a default behavior for your BFM using VMM. Some protocols require constant activity on their interface even when you don't have any data to transmit. This means you must have a mechanism that drives idle...

» 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...

» Cool Things You Can Do with Verdi

Wow it's been a while, but I'm back with a new series of YouTube videos. Hurray !!This time it's all about Verdi and all the cool things it can do for you.Since most of you guys already know it is the best debugger out there, my goal is to show you...

» Be Assertive

You know what they way - sometimes small things can make a big difference. Setting your A/C thermostat to a reasonable temperature can help save energy, sending flowers to someone you care about and so on. This is also true in programming. Sometimes...