next up previous contents
Next: Array subranges Up: Vectors and vector operators Previous: Coercion of array variables   Contents


Generic arrays and vector coercion

Note that it is possible to declare an array of signals by individually declaring the elements of the array. This allows elements of an array to have different types, as in the earlier example:

        state[0] : {ready, willing};
        state[1] : {ready, willing, able};
        state[2] : {ready, willing, able, exhausted};
However, the lack of an ``array'' declaration means that there is no defined order for building a vector from these elements. Thus, the expression state cannot be coerced to a vector. To allow this, we can use a generic array declaration, as follows:
        state : array 0..2;
This does not declare any signals, but it does determine how state should be converted to a vector.



2002-10-28