RE: [sv-ec] New Mantis item on Coverage: bins rhs non-constant expressions

From: Jonathan Bromley <jonathan.bromley_at_.....>
Date: Tue May 08 2007 - 05:52:22 PDT
Doug,

> class myclass;
>      int id;
>      int ign_id;
>      covergroup cg;
>          coverpoint id {
>              ignore_bins ign = {ign_id};
>          }
>      endgroup
> endclass
>
> The need for requiring constant expressions isn't clear. It would be
> possible to accept non-constant expressions, and take a "snapshot" of
> the expression value at covergroup construction time.

I suggest it would be preferable, and easier to understand, if this were
expressed as an input argument to the covergroup:

  class myclass;
    int id;
    int ign_id;
    covergroup cg(input int IGN_ID);
      coverpoint id {
        ignore_bins ign = {IGN_ID};
      }
    endgroup
    initial begin
      // set up a value on ign_id, and then...
      cg = new(ign_id);
    end
  endclass

And I certainly don't see why an input argument to a 
covergroup shouldn't be treated as if it were a constant.

Without using the input argument, I think it would be very
hard for users to remember that this expression (unlike most others
in the context of a covergroup) is sampled at construction time.
Input arguments, though, are already clearly understood to be
a way to provide "lifetime constant" values that configure a
covergroup instance's behaviour.
-- 
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 Tue May 8 05:53:11 2007

This archive was generated by hypermail 2.1.8 : Tue May 08 2007 - 05:53:47 PDT