RE: [sv-bc] Queries Related to string data type

From: Rich, Dave <Dave_Rich_at_.....>
Date: Thu May 31 2007 - 10:28:00 PDT
My interpretation is that 

if( !array.exists( t ) )

should have been an error if t was not a string type.

Dave


> -----Original Message-----
> From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org]
On
> Behalf Of Sandeep Dasgupta
> Sent: Thursday, May 31, 2007 6:08 AM
> To: sv-bc@server.eda-stds.org; sv-ac@server.eda-stds.org; sv-
> ec@server.eda-stds.org
> Cc: Sandeep Dasgupta
> Subject: [sv-bc] Queries Related to string data type
> 
> 
> 
> Hi,
> 
> I have the following three queries for your kind consideration,
> 
> 1.Consider the test case,
> *typedef enum
> {
>   RED ,
>   GREEN ,
>   YELLOW ,
> 
> } color;
> 
> module top;
>     **color** t;
>     typedef bit [3:0] array1;
>     typedef array1 array2[string];
>     array2 array;
>     initial
>     if( !array.exists( t ) )
>     begin
>     end
> endmodule*
> 
> Now as per IEEE Std 1800-2005, section 5.10.3,
> "The syntax for the exists() method is as follows:
>                         function int exists( input index );
>     where index is an index of the appropriate type for the array in
> question."
> But in the above test case we have used an enum as the argument of
> associative array method 'exists', inspite of the fact that the index
> type of the associative array is a string.So as per LRM it seems to be
a
> negative test case.
> But most of the simulator tools  let the test case pass.
> So please suggest what would be the ideal behaviour.
> 
> 
> 2.Consider the case,
>     *module top;
>         string s1;
>         initial
>         begin
>             s1 = 1;
>         end
>    endmodule
> *
> Now as per IEEE Std 1800-2005, section 4.7,
> "Integral types can be assigned to a string variable, but require a
cast."
> 
> But as we can see the above case violates the LRM,  though it is
passed
> by some simulators.
> So please suggest what would be the ideal behaviour.
> *
> *Thanks and Regards,*
> 
> *Sandeep Dasgupta.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, 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 Thu May 31 10:28:24 2007

This archive was generated by hypermail 2.1.8 : Thu May 31 2007 - 10:28:37 PDT