[sv-ec] RE: covergroup sample method

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Wed Oct 17 2007 - 12:14:59 PDT
> I would like to find a better way of moving data from assertions to
> covergroups.
[...]
> In general, multiple evaluation attempts or sub-attempts of the 
> assertion may want to post in the same timestep.  The order in 
> which they post is non-deterministic, but all the posts should get
> into the covergroup instance.  In general, there is no bound on 
> the number of posts in a timestep.
[...]
> Does the class wrapper method you are suggesting accommodate such
> usage?

Absolutely.  The assertion invokes a method of the wrapper class,
with its accumulated "interesting" values as arguments.  The
method copies those values to class data members using
blocking assignment in the ordinary way, and then calls the
covergroup's sample() method.  None of this consumes any 
simulation time, and none of it blocks.  

If you are really worried that pre-emptive scheduling might 
make this nondeterministic, you could protect the class method 
with some kind of mutex such as a semaphore.
 
> Even if it does, I guess that I am looking for something cleaner.

I don't really see what's "not clean" about it.  Instantiating 
and sampling the wrapper class is no more onerous and no more
verbose than doing those things for the covergroup itself, since
the wrapper class looks after the care and feeding of the 
covergroup.  (Side-issue: can covergroup instances be "local"
(private)?  I would probably wish them to be, in this usage.)
-- 
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223                   Email: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573                           Web: http://www.doulos.com

The contents of this message may contain personal views which 
are not the views of Doulos Ltd., unless specifically stated.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Oct 17 12:15:25 2007

This archive was generated by hypermail 2.1.8 : Wed Oct 17 2007 - 12:15:36 PDT