Re: [sv-bc] SV_BC #26 - Enumerated Literals in Packages - Feedback Requested

From: Clifford E. Cummings <cliffc@sunburst-design.com>
Date: Mon Nov 29 2004 - 09:51:41 PST

Hi, All -

Steve and Brad have raised good questions (see below). I will be traveling
Tuesday and unable to attend the call. Feel free to modify my proposal and
use or discard the examples that I attached to my previous email.

Brad's link points to an email by Greg Jaxon discussing passing types as
parameters and asks:

1) if the passed type is a struct, can the fields of a passed type be
referenced using mytype.field1 notation or not?
2) if the passed type is an enumerated type, can the enumerated literals be
referenced directly?

I thought the answer to both questions was yes, but Greg Jaxon suggests
that in both cases, SV should be extended to reference passed type struct
fields using the :: operator (mytype::field1) and passed enum type literals
also be referenced using the :: operator (myenum::literal1).

I prefer to use the mytype.field1 and literal1 notation and leave :: for
importing packages and package contents (just my preference).

Steve thinks that we had agreed to not automatically import enum literals
but emails from Francoise and Dave Rich (included in the bug description)
tend to suggest other options:

Date: Fri, 25 Jun 2004 09:25:44 -0400
From: Francoise Martinolle <fm@cadence.com>

Actually my opinion is now that enumeration literals should not be imported
if only the enumeration type is imported. Only import p::* should make
everything visible.

My examples do not import everything with "import p::*"

Reason: everywhere else in SystemVerilog package importation, the *
importation does not really import anything until the specific package
type, etc., is actually referenced.

At 01:55 PM 6/24/2004 -0700, Dave Rich wrote:

When importing an enumerated type from a package in SV, should all the
enumerated labels be imported also? So far, the prevailing opinion is that
yes they should be imported.

This is what my proposal does.

Sorry I cannot be on the call to close this bug personally.

Regards - Cliff

At 06:39 PM 11/23/2004, Brad Pierce wrote:
>As Dave wrote -- "label names should not get imported for both type
>parameters and package imports". Also, we should still seriously
>consider making the "right fix" for this issue --
>
> http://www.eda.org/sv-bc/hm/2041.html
>
>namely, enabling access to enum labels via their type name by extending
>the scope resolution operator (my_colors::blue).
>
>-- Brad
>
>
>-----Original Message-----
>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of
>Steven Sharp
>Sent: Tuesday, November 23, 2004 6:16 PM
>To: sv-bc@eda.org; cliffc@sunburst-design.com
>Subject: Re: [sv-bc] SV_BC #26 - Enumerated Literals in Packages -
>Feedback Requested
>
>
>Didn't we decide that importing an enum type did not automatically import
>the enum literals? That seems to be the gist of the emails on this erratum.
>
>Steven Sharp
>sharp@cadence.com

----------------------------------------------------
Cliff Cummings - Sunburst Design, Inc.
14314 SW Allen Blvd., PMB 501, Beaverton, OR 97005
Phone: 503-641-8446 / FAX: 503-641-8486
cliffc@sunburst-design.com / www.sunburst-design.com
Expert Verilog, SystemVerilog, Synthesis and Verification Training
Received on Mon Nov 29 09:54:26 2004

This archive was generated by hypermail 2.1.8 : Mon Nov 29 2004 - 09:54:35 PST