RE: [sv-cc] DPI context - setting/preserving&resetting a scope


Subject: RE: [sv-cc] DPI context - setting/preserving&resetting a scope
From: Francoise Martinolle (fm@cadence.com)
Date: Mon Mar 17 2003 - 06:12:59 PST


I disagree with the fact that non context functions could call SV functions.
I completely agree with Michael and with Andrzej who states that it will
complicate the
implementation.
Getting the context, setting the context and switching context will not
only be complex but will create some performance hit.

If you remember our initial goal for having the "context" qualifier:
   1. it was to indicate the SV compiler that this external C function was
context
       sensitive and therefore a scope handle needed to be constructed and
passed to that C
       function. This allowed to optimize non context functions and to have
better performance
       for the execution of these.
   2. The context qualifier indicated that some VPI or PLI calls will be
guaranteed to work
       properly if called inside the context extern C function.

Are we going to allowing a corner case of :
    SV -> context C function -> non context C function -> SV
to work and break the initial rules just for convenience of a corner case ?

I don't think we should do that.
Moreover, the user who writes the non context C function either has to
assume that it will
be called from a context function or use the set/get scope rules.
The first assumption causes his code to be dependent on who called that
function,
the second assumption using the set/get scope rules is against our initial
requirement
to have non context function NOT depending on a context.

Francoise
        '

Now we are allowing to have extern non context C functions called from some
previous
context C function to assume that they can have the default context and
event set their
context.

Adding context functions At 06:50 PM 3/14/2003 -0500, Joao Geada wrote:
>As long as the user ensures that there is a valid context prior to making the
>call, I have no objection.
>
>All that the standard says is that only context calls have context
>automatically
>initialized to something sensible.
>
>Joao
>==============================================================================
>Joao Geada, PhD Principal Engineer Verif Tech Group
>Synopsys, Inc TEL: (508) 263-8083
>344 Simarano Drive, Suite 300, FAX: (508) 263-8069
>Marlboro, MA 01752, USA
>==============================================================================
>
>
>-----Original Message-----
>From: owner-sv-cc@eda.org [mailto:owner-sv-cc@eda.org]On Behalf Of
>Warmke, Doug
>Sent: Friday, March 14, 2003 5:56 PM
>To: 'Andrzej Litwiniuk'; Stickley, John
>Cc: sv-cc@eda.org
>Subject: RE: [sv-cc] DPI context - setting/preserving&resetting a scope
>
>
>Andrzej, John,
>
>I think it's OK to have the behavior specified by Andrzej
>for non-context external functions. It's even OK if the user
>enters their C code by some other means, say a PLI callback.
>All Andrzej is saying is that you can't count on the default
>scope being set if you didn't follow the rules.
>
>More important to me is that we don't make it illegal to call
>an SV export function from non-context C code. That would have
>lots of consequences on users, and no benefits for implementors.
>(Drat, Andrzej! :) ) Here, John's example of explicitly setting
>scope and then making the call is reasonable and should be
>quite useful in practice.
>
>Thanks and regards,
>Doug
>
>
> > -----Original Message-----
> > From: Andrzej Litwiniuk [mailto:Andrzej.Litwiniuk@synopsys.com]
> > Sent: Friday, March 14, 2003 2:44 PM
> > To: Stickley, John
> > Cc: sv-cc@server.eda.org
> > Subject: Re: [sv-cc] DPI context -
> > setting/preserving&resetting a scope
> >
> >
> > > johnS:
> > > Most likely it will be safer however, if the current
> > context is set to
> > > NULL by the infrastructure whenever a non-context function
> > is called.
> >
> > John,
> >
> > this is exactly what I want to avoid!
> > I don't want =any= overhead on simple calls of non-context
> > functions. The implementation that I had in mind would
> > instrument only the calls of context functions.
> >
> > My take on this is that an overhead is acceptable if it buys
> > you something important and useful. I don't think that the
> > rule "NULL if called directly from non-context" is worth the price.
> >
> > It shouldn't happen that we carelessly and without due
> > diligence specify a functionality of a function, and then all
> > simulators will have to bear
> > an overhead in order to be compliant with a standard.
> > I may be wrong whether a specific rule is needed or not, or
> > whether the price
> > overweights the benefits, but it's my job to figure out the
> > consequences from
> > compiler's perspective. As you see, I'm a little biased :-)
> >
> > Regards,
> > Andrzej
> >
> >



This archive was generated by hypermail 2b28 : Mon Mar 17 2003 - 06:14:03 PST