Re: [sv-bc] Is TIME integer or non_integer type?


Subject: Re: [sv-bc] Is TIME integer or non_integer type?
From: Rishiyur S. Nikhil (nikhil@bluespec.com)
Date: Wed Feb 11 2004 - 09:44:27 PST


Another issue is about 'time' and 'integral' (as opposed to 'integer'):

- In Syntax 2-1, the production for 'integral_number' does not include
   time literals, i.e., here the adjective 'integral' excludes time.

- Sec 3.3.1: 'time' is an 'integral type', i.e., here the adjective
   includes time.

- Sec 3.3.1: 'time is an integral type' and the list of integral types
   does not include the 'realtime' type, but:

   Sec 2.5: 'A time literal is interpreted as a realtime value'

- There are many places which allow 'integral' arguments, but I'm not
   sure the intention is to allow 'time' values there. E.g.,

     - Table 3-2 String operators: 'multiplier must be of integral type'

     - 3.7.2 putc(): 'replaces the ith characer in str with the given integral value'

     - Table 3-3 Enumeration element ranges:
        - 'Generates N named constants ... N must be an integral constant'
        - and two more such statements in the table

     - Sec 4.6.1 new[] (for dynamic arrays): 'size: the number of
       elements in the array. Must be a non-negative integral expression.'

     - etc.

Nikhil

David W. Smith wrote:

> Hi Shalom,
> Are int, longint, shortint, byte, and bit all the same type? The only difference is the size of the value. Time by the way is not
> "at least" 64 bits. It is exactly 64 bits. The only reason that integer is "at least" was due to backward compatibility and really
> it should be exactly 32 bits.
>
> Regards
> David
>
> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Shalom.Bresticker@motorola.com
> Sent: Wednesday, February 11, 2004 8:45 AM
> To: sv-bc@eda.org
> Subject: Re: [sv-bc] Is TIME integer or non_integer type?
>
> I would like to bring this up again.
>
> I started reading Section 3 yesterday and immediately noticed this
> blatant inconsistency. However, I remembered that someone had
> brought this up before.
>
> I would also like to point out that 'time' is much closer to being
> an integer type than it is to being a non-integer type.
>
> In fact, for most purposes 'time' and 'integer' are almost the same,
> except that 'time' has at least 64 bits and is unsigned, whereas
> 'integer' is at least 32 bits and signed. Other than that, each
> can be used where the other can as well.
>
> Shalom
>
>
> On Mon, 12 Jan 2004, Brad Pierce wrote:
>
>
>>This change would also impact simple_type. (See Syntax 3-6.)
>>
>>I think it would be counterproductive to modify the BNF for
>>this issue. If any change is needed it would be remove time
>>from Table 3-1.
>>
>>Note also that according to 1364 3.9, a time variable has
>>"at least" 64 bits, not necessarily exactly 64 bits.
>>
>>-- Brad
>>
>>-----Original Message-----
>>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of Brad
>>Pierce
>>Sent: Wednesday, December 17, 2003 6:49 PM
>>To: sv-bc@eda.org
>>Subject: RE: [sv-bc] Is TIME integer or non_integer type?
>>
>>
>>That BNF change would also entail adding 'time'
>>to data_type_common_item.
>>
>>-- Brad
>>
>>-----Original Message-----
>>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of Brad
>>Pierce
>>Sent: Wednesday, December 17, 2003 6:29 PM
>>To: sv-bc@eda.org
>>Subject: Re: [sv-bc] Is TIME integer or non_integer type?
>>
>>
>>I agree. It would make sense to move 'time' into
>>integer_type
>>
>>
>> integer_type ::=
>> integer_vector_type
>> | integer_atom_type
>> | 'time'
>>
>> non_integer_type ::=
>> 'shortreal'
>> | 'real'
>> | 'realtime'
>>
>>
>>-- Brad
>>
>>
>>-----Original Message-----
>>From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org]On Behalf Of Andy
>>Tsay
>>Sent: Wednesday, December 17, 2003 4:15 PM
>>To: sv-bc@eda.org
>>Subject: [sv-bc] Is TIME integer or non_integer type?
>>
>>
>>Hi,
>>
>>Type time is included in table 3-1 in SV 3.1a/draft2 LRM, so
>>it is one of the integer data types.
>>
>>The SV 3.1a/draft2 LRM, Section 3.2, also says
>> non_integer_type ::= time | shortreal | real | realtime
>>
>>So, the type time
>>a) is one of the integer data types, and
>>b) is one of the non_integer_type.
>>
>>I do not know how to explain this to my kids.
>>Can someone help on this?
>>
>>Thanks,
>>Andy
>>
>
>



This archive was generated by hypermail 2b28 : Wed Feb 11 2004 - 09:51:45 PST