[sv-ec] FW: BOUNCE sv-ec@eda.org: Non-member submission from [Andrzej Litwiniuk <Andrzej.Litwiniuk@synopsys.com>]


Subject: [sv-ec] FW: BOUNCE sv-ec@eda.org: Non-member submission from [Andrzej Litwiniuk ]
From: David W. Smith (david.smith@synopsys.com)
Date: Wed Feb 26 2003 - 11:21:29 PST


Forward Andrzej (SV-CC).

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org]
Sent: Wednesday, February 26, 2003 11:19 AM
To: owner-sv-ec@eda.org
Subject: BOUNCE sv-ec@eda.org: Non-member submission from [Andrzej Litwiniuk
<Andrzej.Litwiniuk@synopsys.com>]

>From owner-sv-ec Wed Feb 26 11:18:42 2003
Received: from boden.synopsys.com (boden.synopsys.com [204.176.20.19])
        by server.eda.org (8.12.0.Beta7/8.12.0.Beta7) with ESMTP id
h1QJIbpV004237;
        Wed, 26 Feb 2003 11:18:41 -0800 (PST)
Received: from maiden.synopsys.com (maiden.synopsys.com [146.225.100.170])
        by boden.synopsys.com (Postfix) with ESMTP
        id 3EF04EB9F; Wed, 26 Feb 2003 11:18:33 -0800 (PST)
Received: from boston.synopsys.com (localhost [127.0.0.1])
        by maiden.synopsys.com (8.9.1/8.9.1) with ESMTP id LAA04238;
        Wed, 26 Feb 2003 11:19:02 -0800 (PST)
Received: from lem.synopsys.com (lem [146.225.131.30])
        by boston.synopsys.com (8.9.1/8.9.1) with ESMTP id OAA00499;
        Wed, 26 Feb 2003 14:18:31 -0500 (EST)
From: Andrzej Litwiniuk <Andrzej.Litwiniuk@synopsys.com>
Received: by lem.synopsys.com (8.9.3+Sun) id OAA14973; Wed, 26 Feb 2003
14:18:31 -0500 (EST)
Message-Id: <200302261918.OAA14973@lem.synopsys.com>
Subject: Re: [sv-cc] Re: [sv-ec] default value and initialization for
handles
To: fm@cadence.com (Francoise Martinolle)
Date: Wed, 26 Feb 2003 14:18:30 -0500 (EST)
Cc: andytsay@yahoo.com (Andy Tsay), sv-ec@server.eda.org,
sv-cc@server.eda.org
In-Reply-To: <5.0.2.1.2.20030226123258.045c1008@otis.cadence.com> from
"Francoise Martinolle" at Feb 26, 2003 12:45:40 PM
X-Mailer: ELM [version 2.5 PL2]
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

1. Initial values of handles

   "Why would we require the tool to initialize systemVerilog variables
    which are pointer to C objects to NULL?"

   One way of another, everything has some initial value (accidental bits).
   Better it be defined.
   For a handle, NULL is the natural initial value.

2. Default value in function/task declarations for a handle

   "Default value in function/task declarations cannot be provided for
handle
    types because ..."

   Only literals/constants may be used as default values.
   There is only one constant (literal) for handle types: NULL.
   Hence it might seem redundant to provide NULL as a default value of a
handle
   if a handle type is initialized to NULL anyway.
   An argument cannot be omitted, however, if default value is not defined.

   It's irrelevant here whether NULL is classified as singular data type
   or not. If there are good reasons for NULL not be singular, then
   the restrictions (syntax or plain English) for default values should
   be changed to allow default values for handles.
 
Regards,
Andrzej

> Why would we require the tool to initialize systemVerilog variables
> which are pointer to C objects to NULL? Why not leaving the variable
> uninitialized until the variable object is assigned in some ways
> either in the SV code or when passed as an inout to a directC
> function?
>
> Default value in function/task declarations cannot be provided for
> handle
> types because they
> are not singular data types. The reason they are not singular data type
is
> that C handles cannot be cast to other data types.
>
> Francoise
> '
>
> At 08:16 AM 2/26/2003 -0800, Andy Tsay wrote:
> >Hi,
> >
> >In SV3.1 Draft 3, section 3.7 Handle data type:
> >Handles shall always be initialized to the value null,
> >which has a value of 0 on the C side, which ...
> >
> >Does the above paragraph require the tool to set
> >default value null for all handles?
> >
> >Thanks,
> >Andy
> >
> >--- Francoise Martinolle <fm@cadence.com> wrote:
> > > section 10.5.3 states that you can have a default
> > > value for any singular
> > > data type.
> > > A singular type excludes handles.
> > > Why wouldn't we allow a default value of null for
> > > handle types?
> > >
> > > Are we allowing array and structure literals as
> > > argument default values if
> > > the array/struct or union is packed? The section on
> > > array and struct
> > > literals only shows unpacked arrays and literal
> > > examples.
> > >
> > > Example:
> > > typedef struct packed {
> > > logic [3:0] a;
> > > logic [5:0] b;
> > > } mystruct
> > >
> > > function void foo(mystruct s = {4'b1, 5});



This archive was generated by hypermail 2b28 : Wed Feb 26 2003 - 11:23:32 PST