Re: [sv-cc] elaboration time calls of DPI functions


Subject: Re: [sv-cc] elaboration time calls of DPI functions
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Mon Mar 10 2003 - 17:00:39 PST


> DOUG:
>
> Not clear on why you feel so strongly about prohibiting
> extern functions from being called at elab time.
> Mechanically, non-context elab-time DPI functions should
> be easy enough to support, and theoretically 100% safe
> (provided the user didn't do crazy stuff, as they can
> always do almost anywhere).

The boundaries between compilation, elaboration and simulation seem
blurred. I see major issues with SV compiler calling a function intended
as a part of a design (although interpreters may have no problems with it).
External functions shall not be classified as "constant functions".
Think about cross-compilation. (For example, VCS can run on 64-bit platform
and yet generate a code to be run on 32-bit platform)
External function may happen to be unexecutable from compiler or unavailable
at compile time.

> My feeling is that if we disallow any external function
> from being called at elab time, usability will decrease.
> Because it's not clear to users exactly *when* elaboration
> is occuring. So a function call at one site will produce
> a system error, whereas in at another site it will be OK.
> Do we want to explicitly list out all call sites that would
> be considered "elaboration time"?
>
> If we allow any non-context function to be called, the
> incidence of users getting compile errors will decrease.
> I am open to restricting to pure as well.

The above makes me wondering, whether all external functions are
"equal". (Most likely they are not.) Is it so that depending on a call site
(a syntactical context of a call) and a property pure/context/default,
a particular function is allowed or not?

Regards,
Andrzej



This archive was generated by hypermail 2b28 : Mon Mar 10 2003 - 17:01:58 PST