RE: [sv-bc] Constant method calls

From: Feldman, Yulik <yulik.feldman_at_.....>
Date: Sat Feb 09 2008 - 23:27:26 PST
Shalom, where did you take this restriction from? I only see 6.19.5,
which says "SystemVerilog includes a set of specialized methods to
enable iterating over the values of enumerated types, which are defined
in 6.19.5.1 through 6.19.5.6.". Both enum variables and enum constants
have enum types, so I would assume that methods apply to both. 

But independently of what LRM says and how it can be interpreted, I
fully agree with Jonathan that such restriction would not make any
sense. I also don't see why an implementation should have a difficulty
with evaluating the methods on enum constants.

--Yulik.

-----Original Message-----
From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On
Behalf Of Jonathan Bromley
Sent: Friday, February 08, 2008 5:57 PM
To: sv-bc@server.eda.org; sv-ec@server.eda.org
Cc: Surya Pratik Saha; Greg Jaxon
Subject: RE: [sv-bc] Constant method calls

Shalom,

> next() is defined for enum variables, not enum constants. 

I guess you're right, but this is indeed a severe, unnecessary
and irritating restriction.  Just imagine if "+" were not 
defined over integer constants but only variables...

  parameter n_bits = 8;
  logic [n_bits-1:0];  //  oops, can't do that

but now it seems we have

  typedef enum {A,B,C} E;
  parameter E mode = B;
  initial $display (mode.name());  // can't do that :-(
  parameter next_mode = B.next();  // nor that :-(

System functions echoing the methods' behaviours would
be just as good, if there's some implementation difficulty
about applying methods to things that aren't variables.
Users could write constant functions, but that seems unfortunate.
-- 
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.


---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sat Feb 9 23:30:02 2008

This archive was generated by hypermail 2.1.8 : Sat Feb 09 2008 - 23:32:12 PST