RE: [sv-bc] "Assignment ... to a constant expression"

From: Steven Sharp <sharp_at_.....>
Date: Fri Apr 25 2008 - 16:27:28 PDT
>From: "Brad Pierce" <Brad.Pierce@synopsys.com>

>I don't think it's a fact that any arbitrary non-constant expression can
>be used as the initializer of a static variable.  Where does the LRM say
>that?

I agree that the LRM is not clear on what is allowed.  I think I sent
out an email a long time ago on this.

The LRM says that initializers "are not constrained to simple constants;
they can include run-time expressions, including dynamic memory allocation."
It also explicitly allows randomization calls.

My original reading of this was that initializers were still constrained
somehow, but that the exact constraints were never specified.  Either as
a result of responses to my email (Dave Rich comes to mind), or repeated
readings, I concluded that this text was intended to say that initializers
could be arbitrary expressions.  If one assumes that the text is a full
specification of the rules, with none missing, then I think that is the
only way it can be interpreted.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Apr 25 16:27:57 2008

This archive was generated by hypermail 2.1.8 : Fri Apr 25 2008 - 16:28:12 PDT