Shalom Bresticker wrote: > A typedef that creates an unpacked array type is written like this: > > typedef logic foo_t [10:0]; > > This is not described explicitly in 6.18 on typedefs. It should be because it is not intuitive to everyone. > > If I write > > logic foo [10:0]; > > then I have 11 foo variables, foo[0] through foo[10], I don't see any LRM support for this reading. You've declared just one variable; it has an unpacked array type. > but if I write > > typedef logic foo_t [10:0]; > > I don't have 11 foo_t types, I only have one. So it works a little differently than variable declarations, and is therefore worth clarifying. I don't see the problem, but here's a suggestion: Currently section 7.4.2 begins by saying: > Unpacked arrays can be made of any data type, and can be used to group elements of the declared element > type into multidimensional data. Arrays shall be declared by specifying the element address range(s) after > the declared identifier. This could be reworded so it discusses the unpacked type as its own concept. Unpacked arrays can group elements of any data type. [note: "any"?] An identifier can be given an unpacked array type by specifying the element address range(s) for each dimension immediately after the identifier in its declaration. Then in the examples, add something like: typedef logic [3:0] for_t [0:9]; // forty bits in ten nibbles Section 6.18 can then just forward reference the above text, perhaps by adding the cross-reference "(see 7.4.2)" to the words "unpacked array type" at the top of page 88 (in 2008-draft 4). Greg Jaxon -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Feb 15 09:47:29 2008
This archive was generated by hypermail 2.1.8 : Fri Feb 15 2008 - 09:47:44 PST