Re: [sv-bc] unsized number literals

From: Dhiraj Kumar Prasad <dhiraj@cal.interrasystems.com>
Date: Wed Aug 04 2010 - 21:54:39 PDT

Hello Surya,

Regarding warning than LRM section 10.7 says that

"Implementations can, but are not required to, warn or report any errors
related to assignment size mismatch
or truncation.".

So most of standard tool shows warning for port size miss match which is
good for designer.

-dhiRAj

Brad Pierce wrote:
> A port connection is an assignment. Whatever happens with any other
> assignment should happen here, so 2'b11.
>
> -- Brad
>
> On Wed, Aug 4, 2010 at 5:52 AM, Surya Pratik Saha
> <spsaha@cal.interrasystems.com <mailto:spsaha@cal.interrasystems.com>>
> wrote:
>
> Hi Logie,
> In page 37, it is also mentioned:
> *An unsized single-bit value can be specified by preceding the
> single-bit value with an apostrophe ( ' ), but without the base
> specifier. All bits of the unsized value shall be set to the value
> of the specified bit. In a self-determined context, an unsized
> single-bit value shall have a width of 1 bit, and the value shall
> be treated as unsigned.*
>
> Question is whether here '1 will be treated as context sensitive
> or not. If it is context sensitive then it will be 2'b11 otherwise
> it will be 2'b01.
>
>
> Regards
> Surya
>
>
>
>
> -------- Original Message --------
> Subject: Re:[sv-bc] unsized number literals
> From: Loganath Ramachandran <lrcrsr@hotmail.com>
> <mailto:lrcrsr@hotmail.com>
> To: 'Dhiraj Kumar Prasad' <dhiraj@cal.interrasystems.com>
> <mailto:dhiraj@cal.interrasystems.com>, 'Bresticker, Shalom'
> <shalom.bresticker@intel.com> <mailto:shalom.bresticker@intel.com>
> Cc: "'Surya Pratik Saha'" <spsaha@cal.interrasystems.com>
> <mailto:spsaha@cal.interrasystems.com>, sv-bc@eda.org
> <mailto:sv-bc@eda.org>
> Date: Wednesday, August 04, 2010 6:08:25 PM
>>
>> I also think 2’b11 is correct. My reasoning is as follows.
>> (page numbers quoted below
>>
>> based on 1800-2009 LRM)
>>
>>
>>
>> 1) An unsized literal should at least contain 32 bits (page
>> 37 of LRM)
>>
>> 2) All bits of the unsized value shall be set to the value
>> of the specified bit. (page 37 of LRM)
>>
>>
>>
>> So in this example, the actual is at least 32bits wide with value
>> of “1111…..111”, while the
>>
>> formal is 2-bits wide.
>>
>>
>>
>> In my opinion, a warning would be nice, but I am not sure if LRM
>> requires this because of
>>
>> the unsized nature of the constant.
>>
>>
>>
>> Thanks
>>
>>
>>
>> Logie
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *From:* owner-sv-bc@eda.org <mailto:owner-sv-bc@eda.org>
>> [mailto:owner-sv-bc@eda.org] *On Behalf Of *Dhiraj Kumar Prasad
>> *Sent:* Wednesday, August 04, 2010 5:05 AM
>> *To:* Bresticker, Shalom
>> *Cc:* Surya Pratik Saha; sv-bc@eda.org <mailto:sv-bc@eda.org>
>> *Subject:* Re: [sv-bc] unsized number literals
>>
>>
>>
>> Hello Shalom,
>>
>> Questa 6.6b display 2'b11.
>>
>> -dhiRAj
>>
>> Bresticker, Shalom wrote:
>>
>> The conclusion of that thread seemed to be that 2'b11 would be
>> the correct answer here.
>>
>>
>>
>> Shalom
>>
>>
>>
>> *From:* Surya Pratik Saha [mailto:spsaha@cal.interrasystems.com]
>> *Sent:* Wednesday, August 04, 2010 2:53 PM
>> *To:* Dhiraj Kumar Prasad
>> *Cc:* Bresticker, Shalom; sv-bc@eda.org <mailto:sv-bc@eda.org>
>> *Subject:* Re: [sv-bc] unsized number literals
>>
>>
>>
>> Hi Dhiraj,
>> I don't agree, I did not get anything explicit in LRM supporting
>> your answer. We have already discussed about that in past. See
>> the mail thread with subject "Query about '1" around early July
>> 2008 time frame.
>>
>>
>> Regards
>> Surya
>>
>>
>>
>> -------- Original Message --------
>> Subject: Re:[sv-bc] unsized number literals
>> From: Dhiraj Kumar Prasad <dhiraj@cal.interrasystems.com>
>> <mailto:dhiraj@cal.interrasystems.com>
>> To: Bresticker, Shalom <shalom.bresticker@intel.com>
>> <mailto:shalom.bresticker@intel.com>
>> Cc: "sv-bc@eda.org" <mailto:sv-bc@eda.org> <sv-bc@eda.org>
>> <mailto:sv-bc@eda.org>, Dhiraj Kumar Prasad
>> <dhiraj@cal.interrasystems.com>
>> <mailto:dhiraj@cal.interrasystems.com>
>> Date: Wednesday, August 04, 2010 5:09:57 PM
>>
>>
>> Hello Shalom,
>>
>> The correct behavior should be 2'b11 . Even I have tested the
>> three simulator and all are giving 2'b11 as output
>> with One of them is showing warning as port size differ in port
>> connection.
>>
>> -dhiRAj
>>
>>
>>
>> Bresticker, Shalom wrote:
>>
>> Consider the following code:
>>
>>
>>
>> module top;
>>
>> bot bot('1);
>>
>> endmodule
>>
>>
>>
>>
>>
>> module bot(input [1:0] i);
>>
>> initial #10 $displayb(i);
>>
>> endmodule
>>
>>
>>
>> We have a port connection of '1 to a 2-bit port.
>>
>>
>>
>> I would expect '1 to expand to 2'b11 without a problem.
>>
>>
>>
>> In fact, the three simulators I tested showed different behaviors.
>>
>>
>>
>> One did in fact show that i was assigned 2'b11 without any problem.
>>
>>
>>
>> One simulator also assigned 2'b11 to i, but also issued a
>> port-size mismatch warning.
>>
>>
>>
>> One simulator also issued such a warning and assigned 2'bz1 to i.
>>
>>
>>
>> What is the correct behavior?
>>
>>
>>
>> Thanks,
>>
>> Shalom
>>
>>
>>
>>
>>
>> Shalom Bresticker
>>
>> Intel LAD DA, Jerusalem, Israel
>>
>> +972 2 589 6582 (office)
>>
>> +972 54 721 1033 (cell)
>>
>> http://www.linkedin.com/in/shalombresticker
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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*
>> <http://www.mailscanner.info/>, and is
>> believed to be clean.
>>
>>
>>
>> --
>> This message has been scanned for viruses and
>> dangerous content by *MailScanner*
>> <http://www.mailscanner.info/>, and is
>> believed to be clean.
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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*
>> <http://www.mailscanner.info/>, and is
>> believed to be clean.
>>
>
>
> --
> 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 Wed Aug 4 22:04:54 2010

This archive was generated by hypermail 2.1.8 : Wed Aug 04 2010 - 22:07:40 PDT