Hi Paul, Shalom,
yes, that was silly of me, not sure what I was thinking. Of course I can have
-ve numbers as it is just an expression of a unary operator followed by a number.
So the change then is just the definition of analog_random_seed to include the sign
analog_random seed ::=
integer_variable_identifier
| reg_variable_identifier
| time_variable_identifier
| integer_parameter_identifier
| [ sign ] decimal_number
Same sort of change for seed in the rdist functions. Also the description of
the data for table model references decimal_number directly so it should also
be updated.
If you like, I will add a Mantis item for this.
Regards
Dave
On 05/23/2012 02:56 PM, Floyd, Paul wrote:
> Hi
>
> Generally, there's no such thing as a negative number (from a language parsing perspective). There are only unsigned numbers and unary operators. The unary minus and the unsigned number are two tokens. SV has added the notion of signed and unsigned numbers. I can't remember offhand which is the default. It does seem strange having both an unsigned_number and a decimal_number that doesn't seem to have a sign.
>
> Regards
> Paul
>
> ________________________________________
> From: Dave Miller [David.L.Miller@freescale.com]
> Sent: 23 May 2012 21:46
> To: Floyd, Paul
> Cc: verilog-ams@eda-stds.org
> Subject: Re: $arandom/$rdist_ seeds
>
> Hi Paul, well yes it should allow them.
> But the issue is a lot deeper than that.
>
> In LRM 2.2 we had the definition:
> decimal_number ::=
> [ sign ] unsigned_num
>
> But in 2.3 we changed that to:
> decimal_number ::=
> unsigned_number
> | [ size ] decimal_base unsigned_number
> | [ size ] decimal_base x_digit { _ }
> | [ size ] decimal_base z_digit { _ }
>
> It looks like we inherited it blindly from digital.
>
> If I look at Digital 1364 1995 it is defined as
> decimal_number ::=
> [ sign ] unsigned_number
> | [ size ] decimal_base unsigned_number
>
> But 1364-2001 (and hence SV 1800)
> decimal_number ::=
> unsigned_number
> | [ size ] decimal_base unsigned_number
> | [ size ] decimal_base x_digit { _ }
> | [ size ] decimal_base z_digit { _ }
>
> So is this a bug in digital? In 1800-2009, If I look at the rule for primary
> (one of the basic building blocks for an expression) it uses primary_literal,
> which uses number, which uses decimal_number. But that doesn't allow signed
> values? So we can't have -ve numbers anymore?
>
> Dave
>
> On 05/23/2012 12:11 PM, Paul Floyd wrote:
>> Hi
>>
>> The seeds for these system functions can be "decimal_number". The EBNF for that is
>>
>> decimal_number ::=
>> unsigned_number
>> | [ size ] decimal_base unsigned_number
>> | [ size ] decimal_base x_digit { _ }
>> | [ size ] decimal_base z_digit { _ }
>>
>> I can't see how negative numbers are allowed. Shouldn't that possibility be
>>
>> "[sign]decimal_number"?
>>
>> Regards
>> Paul
>
> --
> ==============================================
> -- David Miller
> -- Design Technology (Austin)
> -- Freescale Semiconductor
> -- Ph : 512 996-7377 Fax: x7755
> ==============================================
>
>
-- ============================================== -- David Miller -- Design Technology (Austin) -- Freescale Semiconductor -- Ph : 512 996-7377 Fax: x7755 ============================================== -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Wed May 23 13:33:27 2012
This archive was generated by hypermail 2.1.8 : Wed May 23 2012 - 13:33:31 PDT