VHDL array initialization

Quote:

> I tried the same structure with arrays of integers and experienced the same

> problem. I actually have a

program generate the ASCII package definition from

> arrays A, B, C, and D whose sizes vary from 1x1 to whatever, not always square.

> Your suggestion above worked but I don't see why my method doesn't work

> for arrays of integers or some other scalar. I prefer to not use the

> named association notation since it complicates my authoring code.

> Why won't the positional notation work with 1xn or nx1 arrays of scalars?

When you have (x,y,z) in the appropriate context, it can be interpreted only as a 3

elements array. (x,y) as a 2 elmts array. But (x) is just a value between

parenthesis, just like (((((x))))), the same by the way, and if you think of it,

you may want that 'feature'.

In positionnal notation, the language does not 'count' the number of parenthesis to

determine the dimension of the object. It counts how many comma-separated-values are

nested. No comma, no new dimension.

So you *have* to use a syntax for your aggregate that exhibits the appropriate

dimension. If there is only one element, the named notation is the best choice.

(1 => value) or (others => value)

A {*filter*} workaround:

(value, others=> anything) -- assuming the constraint has only one bucket,

-- others refers to nothing but forces the analysis to guess the dimension.

so you can also write:

(value1, value2, value3, others => anything) assuming there are only 3 buckets.

and you get some symmetry between single and multiple element arrays. But we are

speaking style, here.

--

USA http://www.*-*-*.com/ ~rouillard EU http://www.*-*-*.com/ ~rouillar

---------------------- Va savoir, Charles --------------------------

Ne reponds pas au fou selon |Reponds au fou selon sa demence

sa demence, que tu ne l'egales| de peur qu'il ne soit sage

toi aussi [Prov 26:4] | a ses yeux [Prov 26:5]

--------------------------------------------------------------------