RE: [sv-cc] Proposal for 526: vpiValid for dynamic variables

From: Warmke, Doug <doug_warmke_at_.....>
Date: Thu Apr 07 2005 - 23:09:35 PDT
Jim,

The vpiValid scheme seems good in principle.
I've been trying to think of wording for automatics,
but I'm not sure about some other more basic things.

First, implementations might reallocate dynamic objects
such as dynamic arrays and associative arrays.  This can
happen due to resizing.

Other objects, such as queues, are suitable for linked list
implementation and shouldn't need to be reallocated
by a simulator as they change in size. Thus one can in theory
safely keep a reference to an element of a queue and use it
as long as the element hasn't been explicitly deleted by user code.

Is a vpi handle to an element of a dynamic object like a
SystemVerilog reference to an element of a dynamic object?
If so, then it could be invalidated when the dynamic object
is moved around in memory.

Also, strings are dynamic objects.
They may be moved around in memory as the string changes
in size.  And strings may be completely deleted by user code.
Are there issues with handles to string variables?
If someone gets a handle to a valid string, then SV
code destroys the string such that it is a NULL variable,
how would that be reflected in the handle object the user has?

What about handles to basic dynamic and associative arrays?
(i.e. not just array elements).  Those can shift around from
being completely NULL to being objects with valid contents.

For automatics, remember that in SystemVerilog one can have
automatic variables in all kinds of scopes, not just tasks
and functions.  They can exist in named block scopes, straight
in always/initial blocks, in fork/joins, and probably
elsewhere I'm not thinking about.

Talk to you guys tomorrow (early!)

Regards,
Doug 

> -----Original Message-----
> From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org
<mailto:owner-sv-cc@eda.org> ] On
> Behalf Of Jim Vellenga
> Sent: Thursday, April 07, 2005 1:44 PM
> To: SV-CC
> Cc: Rohit Rana
> Subject: [sv-cc] Proposal for 526: vpiValid for dynamic variables
>
> We have uploaded a proposal for adding the vpiValid
> property to variables.  The note says that this property
> indicates whether or not a non-static variable from
> within a class or within a dynamic array is still
> valid, i.e., its memory has not yet been reclaimed.
>
> vpiValid also applies to automatic variables in
> tasks and functions.  Does anyone have some good
> wording to add to this note for that?
>
> Regards,
> Jim Vellenga
>
> ---------------------------------------------------------
> James H. Vellenga                            978-262-6381
> Engineering Director                   (FAX) 978-262-6636
> Cadence Design Systems, Inc.         vellenga@cadence.com
> 270 Billerica Rd
> Chelmsford, MA 01824-4179
> "We all work with partial information."
> ----------------------------------------------------------
>  
>
> 
Received on Thu Apr 7 23:09:47 2005

This archive was generated by hypermail 2.1.8 : Thu Apr 07 2005 - 23:09:50 PDT