Quantcast
Channel: Cadence Functional Verification
Viewing all articles
Browse latest Browse all 652

Full Sequence Coverage in a Single Line of e Code?

$
0
0

I was asked recently about how to easily collect coverage on the sequences generated by the verification environment.  Since this question has come up before, I thought I would take this opportunity to write a short blog on how to quickly and easily collect coverage on generated sequences. 

A comprehensive coverage plan contains coverage of the DUT output, internals, and also the stimuli created and sent by the verification environment.  One of the easiest ways to collect coverage on the stimulus generated is by collecting coverage information on the sequences themselves. To do this, you can use the built-in sequence ended event as a sampling event and, for starters, collect coverage on the built-in kind field.  Later on, you can add more coverage items based on sequence related information.

For example, to collect coverage of the ethernet_seq sequence:

<'
extend ethernet_seq {
    event cover_seq is cycle@ended;
    cover cover_seq is {item kind;}; 
};
‘>

This coverage definition will collect information of all created sequences, including, for example, the MAIN sequence. Since there is always one MAIN sequence, you might decide not to have it affecting the coverage information, and in that case we recommend this slight modification to above code:

<'
extend ethernet_seq {     
    event cover_seq is cycle@ended;
    cover cover_seq is {
        item kind using ignore = (kind == RANDOM or kind == MAIN);
    }; 
};
‘>

To make users lives even easier, the UVM e package provides a small macro that reduces simple sequence coverage collection down to a single line statement. The statement adds a cover_seq event that, by default, is connected to the ended event and also adds one cover item -  the kind field.

The below statement collects coverage on the ethernet_seq, for example:

<‘
cover_sequence ethernet_seq;
‘>

Hope this helps!

Efrat Shneydor - Specman R&D, Methodology


Viewing all articles
Browse latest Browse all 652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>