Re: [sv-bc] Fwd: RE: Slice with unpacked arrays


Subject: Re: [sv-bc] Fwd: RE: Slice with unpacked arrays
From: Dave Rich (David.Rich@synopsys.com)
Date: Tue Feb 04 2003 - 01:40:57 PST


So here is my understanding of the issues from todays CC and a set of proposals.
Please respond to this via with positive or negative feedback so I can refine my proposal into something that we can vote on quickly.

 Basically, the issues are not really with slices, but in the definition of literals. Although we did not discuss it, these issues are there for structure literals too.

First, SystemVerilog allows the use of literals in non-initial assignment statements. Since Verilog already had a syntacticly similar concat operation, it allows similar replication operation in literals. These facts are presented in the 3.0 LRM and further clarified by SV-BC7b.

Second, the spec creates confusion in these places:

a. The term "literal" typically means a constant, and "array literal" usually implies its use as an initializer only. Note that C does not use the term "literal", and instead just uses the term "initializer"

b. The examples show only constants in literals.

c. The BNF makes no distinction between literals and concatenation. The LRM provides a casting operation when the context is ambiguous, but does not define what is or is not ambiguous.

And Third, once all the confusion with the second issue gets cleared up, it will be trivial to define the slice of an unpacked array in terms of the syntactic sugar that represents the individual elements of the array.

So here are my proposals:

Take existing Verilog concatenations and call them "packed concatenations". Recall that a packed concatenation is a just list of "packable" elements.

Rename Array literals to "unpacked concatenations". An unpacked concatenation is a list of elements that match the type, size and shape of an existing unpacked type. An unpacked concatenation may be used wherever an expression of that matching unpacked type is legal (meaning for copy or compare)

SystemVerilog determines if a concatenation is packed or unpacked by looking at the LHS type of an assignment statement. Concatenations not on the RHS of an assignment are assumed to be packed, unless cast to unpacked with "type'{...}".

Unpacked concatenations are not legal on the LHS of an assignment statement. (Making them legal would introduce ambiguities, plus casting on the LHS is not legal)

Dave

--
Dave Rich
Principal Engineer, CAE, VTG
Tel:  650-584-4026
Cell: 510-589-2625
DaveR@Synopsys.com



This archive was generated by hypermail 2b28 : Tue Feb 04 2003 - 01:41:38 PST