Re: [sv-cc] RE: Version 2 of DPI LRM


Subject: Re: [sv-cc] RE: Version 2 of DPI LRM
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Thu Mar 13 2003 - 07:22:26 PST


> MICHAEL wrote:
> There are three handle types that we need to distinguish:
> a) the generic, opaque handle defined on the SV side
> b) the handle provided when having an open array as param
> c) the handle provided for the context
> all three are in my eyes different and I think we need to reflect this by providing three different handle types.

Yes, they are different. And they come from two different worlds.

On SV side there is only primitive type 'handle', which corresponds to 'void*'
in C. It ain't that different from SV 'string' reflected in C as 'char*'.
A notion of any handle to an open array or to a context is simply nonexistent
in SV.

On C side they are two different and unrelated types of handles (which may
or may not be implemented as pointers): a handle to an open array and a handle to a context/scope/instance.

[BTW, isn't it so, that a term 'scope' refers to a source code, while 'instance'
refers to an execution? Besides, blcoks with local declarations also define
'scopes', while they do not create instances.]

> IM(very H)O there are two good ways here:
> A) have a base type; e.g. 'svHandle'
> . derive three types from it; e.g.
> svOpaqueHandle
> svOpenArrayHandle
> svContextHandle

svOpaqueHandle is not needed at all, remaining two types of handles are
unrelated, most likely implemented differently and used in absolutely different
a context of use (in non-instance/scope sense).

> B) just have three handle types
> svHandle
> svOpenArrayHandle
> svContextHandle
>
> I am more for the second one, which gives also my name preferences; although I really don't care here. I as many other user's will
> do Cut&Paste and as such the lenght of a type name does not really count ...

Oh, well. I heavily use Copy&Paste, too. So the lenght is not an issue, right?
Thus I opt for:

        svOpenArrayHandle
        svScopeHandle (Scope or Context or Instance?)

Regards,
Andrzej

PS. Since we are already polling (yet informally), may we revive the poll
on include files names?

1) svc.h + svc_src.h
2) dpi.h + dpi_src.h
3) svdpi.h + svdpi_src.h
4) sv_dpi.h + sv_dpi_src.h
5) sv_dpi_c.h + sv_dpi_c_src.h

I opt for 5) because: SV + DPI + C; layers for other languages are
conceivable for DPI, similarly like other interfaces are conceivable for SV
(and they even do exist, e.g. VPI).

> > Team, quick poll from Andrzej and me for renaming svHandle:
> > svArrayHandle
> > svOpenArrayHandle
> > svArrHandle
> > <your suggestion here>
> >
> > Thanks and regards,
> > Doug



This archive was generated by hypermail 2b28 : Thu Mar 13 2003 - 07:23:11 PST