[sv-bc] [Fwd: [sv-ec] Query regarding array querying system function]

From: Subhamoy Pal <subhamoy_at_.....>
Date: Sun Jul 30 2006 - 22:26:26 PDT
Hello all,

 So far I didn't get any reply for my following queries. Can anyone 
please take a look at the issues and gave me his/her important 
suggestion on these issues?

Regards,
Subhamoy

attached mail follows:


Hello,
I have a few queries regarding Array querying System Function $dimensions().

1>>
SV LRM 22.6 says,
"$diemsions shall return
   - the total number of dimensions in the array (packed and unpacked , 
static or dynamic )
   -1 for string datatype or anyother nonarray type that is equivalent 
to simple bit vector type .
   - 0 for any other type"

Now for the  following case,

module mod;
   string s1 = "ab";
   initial
      begin
         $display($dimensions(s1));  // output will be 1 according to 
LRM verses
      end
endmodule

It means s1 is a single dimension object. Though s1[0][0] is perfectly 
valid because s1[0] has the equivalent type of a byte and from that we 
can do another bitselect. So, it seems s1 is a two-dimensional packed 
array because we can use bitselect twice on the array. Hence the result 
of $dimensions() looks contradictory.

2>>

Second case is::==

module mod;
   integer i[3:0];
   initial
      begin
         $display($dimensions(i));  // output will be what?
      end
endmodule

If the previous case has output 1, then this output should be 1(since 
integer is not a packed array). On the contrary, vlog shows it is 2 
though the previous output it shows is 1.
My question is what should be the valid output?

-- Subhamoy
Received on Sun Jul 30 22:26:47 2006

This archive was generated by hypermail 2.1.8 : Sun Jul 30 2006 - 22:27:04 PDT