Subject: Re: [sv-bc] replication in array literal
From: Paul Graham (pgraham@cadence.com)
Date: Tue Jan 06 2004 - 12:30:03 PST
Dav,
> This is a limitation the way it is currently written. The braces must
> match the array layout.
Thanks for confirming my interpretation.
> Your final example would have to be
>
> bit x [3:0] = { 3:a, 2:b, default:y };
>
> since you cannot mix positional values with a default label.
What is this 3:a syntax? Well, I know what it is, but I don't see a
reference to it in the secion on array literals (7.13). That section only
mentions type:value and default:value, not expression:value.
BTW, what's the interpretation of something like this:
parameter p = 1, q = 2;
struct {
int p, q;
} x[2] = { p:1, q:2 };
The concat is not an array with two integer elements, but an array of
structs. The problem is that before the concat is resolved, the text "p:1"
can be interpreted as either element 1 (==p) of an array having value 1, or
member p of a struct having the value 1. If you ask me, this is looking a
lot like one of the darker corners of vhdl.
Paul
This archive was generated by hypermail 2b28 : Tue Jan 06 2004 - 12:30:51 PST