RE: [sv-bc] Is '1 allowed in a concatenation?

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Mon Mar 22 2010 - 07:47:16 PDT

Hi, Cliff.

It is clear that if '1 is legal in a concatenation, then it is a single bit.
The question is whether it is legal.

At best, the LRM is ambiguous about it.

Since 11.4.12 says that unsized constants are not allowed in concatenations and 5.7.1 calls '1 unsized, it is reasonable to conclude that it is not legal. As pointed out, a simple unsized constant is also not allowed even though its size is well-defined (32 bits).

Regards,
Shalom

> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On
> Behalf Of Clifford E. Cummings
> Sent: Monday, March 22, 2010 4:40 PM
> To: sv-bc@eda.org
> Subject: Re: [sv-bc] Is '1 allowed in a concatenation?
>
> Hi, Shalom -
>
> There may be a wording problem in the standard, but adding '1 or '0
> to a concatenation is the same as adding 1'b1 or 1'b0.
>
> I point this out as an exception to '0 and '1 expansion in my
> training classes.
>
> Rationale:
> What would be expected if you had declared:
> logic [15:0] data1 = {'1,8'hAA};
> logic [15:0] data2 = {8'hAA, '1};
> logic [15:0] data3 = {'0, 8'hAA,'0, '1};
>
> There would have to be some rather interesting assumptions on the
> part of the compiler to determine the intended size of the '0 or '1
> expansion, including a number of special cases. The assumptions might
> not be obvious to an end user and debugging these declarations might
> be rather time-consuming.
>
> It was just easier to say that in these self-determined contexts,
> each '1 or '0 is just a single bit.
>
> Regards - Cliff
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Mar 22 07:48:25 2010

This archive was generated by hypermail 2.1.8 : Mon Mar 22 2010 - 07:48:29 PDT