RE: [sv-bc] Bit/Part select of modport named argument

From: Steven Sharp <sharp@cadence.com>
Date: Tue Feb 08 2011 - 19:18:08 PST

 
There are certainly situations where a simple operand is treated differently from a more complex expression. Unfortunately, the LRM doesn't do a very good job of specifying them.

For example, the LRM says that "Enumerated variables are auto-cast into integral values, but assignment of arbitrary expressions to an enumerated variable requires an explicit cast." It doesn't say what causes enums to be auto-cast into integral values. Since it is supposed to be legal to assign an enum to another enum of the same type without a cast, using them as the RHS of an assignment to an enum doesn't cause it. It is reasonable to assume that it is the application of an operator that requires an integral type (including assignment to a non-enum type) that causes the casting.

The type operator is more relevant to the current discussion, since it uses similar terminology: "The type operator applied to an expression shall represent the self-determined result type of that expression." I admit that I would expect the type operator to be able to extract the full type of a variable, including packed dimensions. It is less useful if it can't. But the LRM doesn't seem to contain any text or examples that indicate that it can. I had thought that the description might distinguish simple operands from more complex expressions, but it just refers to expressions.
 

-----Original Message-----
From: Greg Jaxon [mailto:Greg.Jaxon@synopsys.com]
Sent: Tuesday, February 08, 2011 11:06 AM
To: Steven Sharp
Cc: brad_pierce@acm.org; Surya Pratik Saha; sv-bc@eda.org
Subject: Re: [sv-bc] Bit/Part select of modport named argument

On 2/7/2011 1:20 PM, Steven Sharp wrote:
> interface iface;
> logic [2:0] [2:0] [2:0] x;
> modport mport (input .j (x));
> endinterface
>
> The type of the identifier x is a 3-dimensional packed array. The self-determined type of the port expression x is a 27-bit vector.

I disagree.

If you'd said x+1'b1, I'd agree; + ignores x's shape, but until that shape is consumed somewhere, it is the part of the self-determined type of any reference to x.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Feb 8 19:18:55 2011

This archive was generated by hypermail 2.1.8 : Tue Feb 08 2011 - 19:19:09 PST