Subject: [sv-cc] errata for open arrays: BNF & LRM
From: Andrzej Litwiniuk (Andrzej.Litwiniuk@synopsys.com)
Date: Wed Aug 20 2003 - 09:38:09 PDT
Hello all,
Enclosed are the proposed changes to BNF and LRM for open arrays.
(This is the second part of my proposal sv-cc/hm/1437.html sent again.)
Regards,
Andrzej
============== Changes in the BNF and LRM ===============
Some changes in BNF are required in order to allow open arrays with
sized and unsized dimensions.
BNF allows only for a single unsized dimension or any number of sized
dimensions, but not both sized and unsized mixed together.
I propose the following BNF changes in A.2.5 Declaration ranges:
1) Remove 'dpi_dimension'.
2) introduce a new nonterminal 'unsized_dimension'
2a) introduce a production:
unsized_dimension ::= '[' ']'
where '[' denotes [ in red, i.e. a terminal symbol
2b) in the production for 'packed_dimension' replace [] with unsized_dimension
for the sake of consistent naming
2c) add a footnote:
"unsized_dimension is permitted only in declarations
of import DPI functions, see dpi_function_proto."
3) introduce a new nonterminal 'sized_or_unsized_dimension'
3a) introduce productions:
sized_or_unsized_dimension ::= unpacked_dimension | unsized_dimension
4) Replace the productions for 'variable_dimension' with the following:
variable_dimension ::= { sized_or_unsized_dimension }
| associative_dimension
4a) add a footnote:
"More than one unsized dimension is permitted only in declarations
of import DPI functions, see dpi_function_proto."
Other changes in LRM.
In section 4.8 Arrays as arguments:
In the second paragraph, replace "and that all dimensions be of the same
size." with:
"and that all sized dimensions be of the same size. Note that unsized
dimension may occur in dynamic arrays and in formal arguments of import
DPI functions. If one of dimensions of a formal is unsized, then any size
of the corresponding dimension of an actual is accepted."
Add at the end of section:
"An import DPI function that accepts a one-dimensional array can be passed a
dynamic array of a compatible type and of any size if formal is unsized, and
of the same size if formal is sized."
Additionally, I suppose that section 26 would benefit from a terminology
change, if "open array" is replaced with "unsized array". Your sugestions
are welcome.
Regards,
Andrzej
This archive was generated by hypermail 2b28 : Wed Aug 20 2003 - 09:40:19 PDT