RE: $arandom/$rdist_ seeds

From: Floyd, Paul <Paul_Floyd@mentor.com>
Date: Wed May 23 2012 - 12:56:38 PDT

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
==============================================
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed May 23 12:57:14 2012

This archive was generated by hypermail 2.1.8 : Wed May 23 2012 - 12:57:15 PDT