Mantis item #1395 (unsized, packed dimensions) now has a proposal. A. The proposal reflects 3 tentative design choices: 1. Stick with the existing restriction on unsized, packed dimensions, which appears only in LRM 26.4.6.1. The restriction is that an unsized packed dimension in an open array formal must be the sole packed dimension. bit [] b_array []; // legal bit [] c_array [] [5]; // legal bit [] [3:0] d_array []; // illegal 2. Reword 26.4.6.1 to make it clear that the requirement for a sole packed dimension in an open array only applies when we have an unsized, packed dimension, not when we have no unsized packed dimension but do have one or more unsized, unpacked dimensions. bit [3:0][7:0] myArr [] // now it's clear that this is legal. Rationale: if the packed part is sized and we want a varying number of those items (i.e., we have an unsized, unpacked dimension), there is no reason to forbid multiple packed dimensions -- we are going to linearize and normalize them anyway and pass them in canonical representation form. 3. Always normalize the packed dimension(s) of an open array, whether the formal packed dimension is unsized or not. (Recall that query functions only recognize a single packed dimension, designated dimension 0). // Example 1 bit [] myArr [3]; // SV FORMAL bit [4:1] a[3]; // SV ACTUAL:open array handle access returns normalized range [3:0] // Example 2 bit [] myArr [3]; // SV FORMAL bit [3:0][7:0] a[3]; // SV ACTUAL:open array handle access returns normalized range [31:0] Rationale: If we only normalize multiple packed dimensions, the query functions (11.2) sometimes return a normalized range for the packed dimension and sometimes do not. One bad side-effect is that the LRM must constantly mention exceptions. However, if we always normalize open array packed dimensions, the following generalizations are true and easy to understand: . The query functions always return an open array packed dimension in normalized form. . Open array unpacked dimensions are always the SV original ones. . Open array packed dimensions are always normalized versions of the originals. B. Misc. Changes -- sec. 11.5 The existing 11.5 had some text that might be prone to misinterpretation, followed by a long list of routines and a pithy, two-sentence paragraph, which said exactly what the functions do. The pithy statements were integrated with the main body of text and the admonition that users ensure correct canonical format size was broadened, since the canonical form arguments could be received from SystemVerilog as params, as well as be allocated locally in C.Received on Mon Apr 3 14:38:53 2006
This archive was generated by hypermail 2.1.8 : Mon Apr 03 2006 - 14:38:57 PDT