Subject: Re: DirectC memory ownership - proposed rules
From: Kevin Cameron (sv-xx@grfx.com)
Date: Sat Dec 14 2002 - 11:43:16 PST
> From - Sat Dec 14 08:54:56 PST 2002
>
> In general the rule is very simple: C code owns all the memory it creates,
> SystemVerilog owns all its own memory.
>
> Details:
>
> strings:
> on input ports:
....
>
> NOTE: according to sv-ec, strings are a SystemVerilog 3.1 class type. You cannot
> nest strings (or any other class) inside a SystemVerilog structure. This implies
> that strings can only be passed directly to a DirectC function, never indirectly.
> Because of this the specific layout used to represent the string class does not
> need to be described for the DirectC interface (ie implicit conversion in both
> directions across the interface).
> NOTE: no classes other than strings can cross the DirectC interface.
In accordance with that I would suggest that all class objects are handled through
VPI (handles are passed) and that VPI supports the class methods for the object.
In the particular case of string we can also define how string converts to char* or
char[] for pass-by-reference/value - it should be easy/fast to convert string to
const char* for inputs, and safe (if slower) to convert to char[] for inout/output.
Kev.
>
> pointers:
> SystemVerilog cannot perform any operations on the opaque pointers, so nothing
> extra needs to be said than the general rule.
>
>
> Joao
> ==============================================================================
> Joao Geada, PhD Principal Engineer Verif Tech Group
> Synopsys, Inc TEL: (508) 263-8083
> 154 Crane Meadow Road, Suite 300, FAX: (508) 263-8069
> Marlboro, MA 01752, USA
> ==============================================================================
This archive was generated by hypermail 2b28 : Sat Dec 14 2002 - 11:43:51 PST