Context Sensitive Function Calls - more constrains


Subject: Context Sensitive Function Calls - more constrains
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Tue Nov 26 2002 - 08:35:53 PST


IMO some constrains should be put on the exported SV functions (to be
called from C).

If a module is parametrized (with defparams, or type parameters),
then a function defined inside such a module may have different signature
(i.e. different result type or types of formal arguments) for different
instances.

Please remember that SV allows not only to use different constants
as module's parameters (what would in the worst case affect only bounds/sizes
of arrays/vectors), but also "type" parameter, what can make function
headers absolutely incompatible across different instances.

Thereofore it should be an error to export a function such that
its signature may vary from an instance to an instance.

I propose to impose rigid constraints:

        The function header for exported a function
        must not depend on module's parameters.

Note that the above restriction eliminates any possibility for
variations in a function's header.

This may seem to restrictive if for a particular design all instances
of a module share the same function header.
On the other hand, it would be confusing, if - with less rigid constrains -
an addition of a new instance (with another value of module's parameters)
would invalidate otherwise correct a design because it would create
a clone of the exported function with the header inconsitent with
headers of the same function from other instances.

Note, however, that functions defined in $root scope are not subject
to these problems.

Andrzej



This archive was generated by hypermail 2b28 : Tue Nov 26 2002 - 08:36:43 PST