RE: [sv-bc] Const cast of Mantis 2398

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu Aug 14 2008 - 15:27:54 PDT
I agree. The re-write example as a generate block is misleading because
it does not cover this case, or any case where a true constant
expression is required.

 

Dave

 

 

________________________________

From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On
Behalf Of Brad Pierce
Sent: Tuesday, August 12, 2008 11:34 PM
To: sv-bc@server.eda.org
Subject: [sv-bc] Const cast of Mantis 2398

 

As I understand the new const'() cast of

 

   http://www.eda-stds.org/svdb/view.php?id=2398

 

the following part-select would be illegal

 

       for (int i = 3; i >= 0; i--) begin

      y[ const'(i)*2 + 1 : const'(i)*2 ] = i;

   end

 

because const'(i) would be like a simulation-time const variable, not
like an elaboration-time constant expression.

 

An expression may be changed to a constant with a const cast.

 

             const'(x)

 

When casting an expression as a constant, the type of the expression to
be cast shall pass through unchanged. The only effect is to treat the
value as though it had been used to define a const variable of the type
of the expression.

 

Correct understanding?

 

*   Brad


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Aug 14 15:28:53 2008

This archive was generated by hypermail 2.1.8 : Thu Aug 14 2008 - 15:29:34 PDT