[sv-bc] Question about array query functions $size, etc.


Subject: [sv-bc] Question about array query functions $size, etc.
From: Paul Graham (pgraham@cadence.com)
Date: Thu Nov 20 2003 - 13:39:26 PST


I have a question about the dimension numbering used for
array querying functions. The LRM gives an example:

    // Dimension numbers
    // 3 4 1 2
    reg [3:0][2:1] n [1:5][2:8];

This is fine for an array whose dimensions are all
written out in the variable declaration.

But what about an array which is composed of typedefs:

    typedef [3:0][2:1] reg t1;
    typedef t1 [1:5][2:8] t2;

    t2 n;

Does n now have two dimensions or four dimensions? I
would vote for four dimensions, since n is equivalent to
a four-dimensional array.

Also, does a predefined vector type count as an array
for the purposes of array numbering?

    integer n;

    ... if ($size(n, 1) == 32) ...

Paul



This archive was generated by hypermail 2b28 : Thu Nov 20 2003 - 13:41:27 PST