Re: [sv-bc] system functiions in constant expressions

From: Steven Sharp <sharp_at_.....>
Date: Tue Aug 22 2006 - 15:13:03 PDT
>From: "Brad Pierce" <Brad.Pierce@synopsys.com>

>What are the reasons to not allow any pure system functions in constant
>expressions, or at least any that are defined in the LRM and have not
>been redefined by the user?

For one thing, whether something is "pure" may be unclear for some of
the unusual functionality provided by some system functions.

For example, is $test$plusargs pure?  Its value remains the same
during a particular elaboration for any given input argument value,
and calling it has no side effects.  But if you think beyond a
particular elaboration, it is not pure.  It does not depend on just
the value of its arguments, but also the command line options that were
used.  The value might be different during simulation and compilation
(or different phases of separate compilation tools), and also synthesis.
So it was not included in the constant system functions in 1364.

Some of the system functions, such as $bits and $dimensions, are not
pure in a strict sense.  They don't depend only on the values of their
arguments.  They depend on side-attributes of their arguments, such
as their type.  Regarding them as pure can introduce new kinds of
issues with dependencies that were not considered when allowing all
"pure" functions.

The new functions that are truly pure, such as the new conversion
functions for shortreals, don't pose a problem.  But anything that
deviates from that at all needs to be considered individually before
being allowed.

Steven Sharp
sharp@cadence.com
Received on Tue Aug 22 15:13:15 2006

This archive was generated by hypermail 2.1.8 : Tue Aug 22 2006 - 15:13:24 PDT