Language Change Specification for Composites of Protected Types

LCS Number: LCS-2016-014
Version: 5
Date: 2-Feb-2017
Status:  
Author: Jim Lewis
Email: Main.JimLewis
Source Doc: Composites of Protected Types
History Doc: History
Summary: Allow Composites of Protected Types

Voting Results: Cast your votes here

Style Notes

Changes are shown in red font. Author comments are shown in green font and are not part of the LRM text.

Details of Language Change

4.2 Subprogram declarations

4.2.1 General

014.1: 4th paragraph on page 20
It is an error if the result subtype of a function denotes either a file type or , a protected type , or a composite containing either a file type or a protected type. Moreover, it is an error if the result subtype of a pure function denotes an access type or a subtype that has a subelement of an access type.

4.2.2.1 Formal Parameter lists

014.2: 3th paragraph on page 21, last sentence of paragraph
[Author comment: No changes here. I am assuming that an object that is an array of a file type also denotes a file. Otherwise, this needs to be expressed as shall be a name whose type is either a file type or an array of a file type.]

The actual designator associated with a formal of class file shall be a name denoting a file.

4.2.2.2 Formal Parameter lists

014.3: 4th paragraph on of section 4.2.2.2 page 21, last sentence of paragraph
For a subprogram having a parameter whose type is a protected type, the parameter is passed by reference. It is an error if the mode of the parameter is other than inout. If a subprogram has a parameter whose type or subelement type is a protected type, then the parameter shall be passed by reference and the mode shall be inout.

4.2.2.4 File parameters

014.4: 1st paragraph of section on page 23
For parameters of class file, references to the actual file are passed into the subprogram. No particular parameter-passing mechanism is defined by the language, but a reference to the formal parameter shall be equivalent to a reference to the actual parameter. It is an error if an association element associates an actual with a formal parameter of a file type or a composite containing a file type and that association element contains a conversion function or type conversion. It is also an error if a formal of a file type is associated with an actual that is not of a file type. It is also an error if a formal that is a composite containing a file type is associated with an actual that is not of a composite containing a file type.

5.1 General

014.5: paragraph 4 (counting bullet list as part of a paragraph) on page 35

[author comment: I could not find anything that indicated that a protected type has a value. Hence the following modification]

There are five classes of types. Scalar types are integer types, floating-point types, physical types, and types defined by an enumeration of their values; values of these types have no elements. Composite types are array and record types; values of these types consist of element values. Access types provide access to objects of a given type. File types provide access to objects that contain a sequence of values of a given type. Protected types provide atomic and exclusive access to variables accessible to multiple processes.

There are five classes of types. A scalar type contains a single value. Scalar types include integer types, floating-point types, physical types, and types defined by an enumeration of their values. A composite type is a collection of elements. Composite types include arrays and records. An access type provides access to objects of a given type. A file type provides access to objects that contain a sequence of values of a given type. A protected type provides atomic and exclusive access to a variable accessible to multiple processes.

Section 5.3 Record Types

Section 5.3.1 General (Record Types)

014.6A: first paragraph of 5.3.1. on page 44
Composite types are used to define collections of values. These include both arrays of values (collections of values of a homogeneous type) and records of values (collections of values of potentially heterogeneous types).

Composite types are collections of elements. These include both arrays (a collection whose elements have a homogeneous type) and records (a collection whose elements potentially have heterogeneous types).

014.6B: last paragraph of 5.3.1. on page 44
[author comment: Arrays of only pt and only ft are a good first step. We may eventually want to allow mixed types in composites. However, this is a complex issue since pt and ft do not allow assignments. And files require a "file" class designator on subprogram parameters - hence, being more general will have a significant impact on the LRM. At the least, I think it should be a separate LCS and for me it is a some day maybe after I have finished other LCS'. This complexity may be able to be mitigated once we have defined interfaces/bundles]

An object of a composite type represents a collection of objects, one for each element of the composite object. It is an error if a composite type contains elements of file types or protected types. Thus an object of a composite type ultimately represents a collection of objects of scalar or, access, file, or protected types, one for each noncomposite subelement of the composite object.

If an object of a composite type contains a protected type, it shall only contain protected types or composites whose subelements are protected types. For an object of such a composite, each noncomposite subelement is an independent protected type. Thus one process may access a method of one noncomposite subelement of the object while another process my simultaneously access a method of a different noncomposite subelement.

If an object of a composite type contains a file type, it shall only contain file types or composites consisting of file types. For an object of such a composite, each noncomposite is an independent file type.

Section 5.4 Access types

Section 5.4.1 General (Access types)

014.7: 3rd paragraph (BNF = 1 paragraph) on page 53 - see LCS_2014_014a - arrays of pt, ft and access types
For each access type, there is a literal null that has a null access value designating no object at all. The null value of an access type is the default initial value of the type. Other values of an access type are obtained by evaluation of a special operation of the type, called an allocator. Each such access value designates an object of the subtype defined by the subtype indication of the access type definition. This subtype is called the designated subtype and the base type of this subtype is called the designated type. The designated type shall not be a file type or , a protected type , or a composite containing either a file type or a protected type.

014.8: last paragraph/note on page 53
[author comment: Now in LRM text above]

NOTE 3-If the designated type is a composite type, it cannot have a subelement of a file type or a protected type (see 5.3.1).

Section 5.4.2 Incomplete type declarations (Access types)

014.9: 1st paragraph on page 53
[Author comment: if left as it is, this needs to be modified to also exclude composites of ft and pt. Instead re-writing to remove the repeated text from the previous section]

The designated type of an access type can be of any type except a file type or a protected type (see 5.4.1). In particular, the The type of an element of the designated type of an access type can be another access type or even the same access type. This permits mutually dependent and recursive access types. Declarations of such types require a prior incomplete type declaration for one or more types.

Section 5.5 File types

Section 5.5.1 General (File types)

014.10: 3rd paragraph (BNF = 1 paragraph) on page 55
The type mark in a file type definition defines the subtype of the values contained in the file. The type mark may denote either a fully constrained, a partially constrained, or an unconstrained subtype. The base type of this subtype shall not be a file type, an access type, a protected type, or a formal generic type. If the base type is a composite type, it shall not contain a subelement of an access type , protected type, or file type. If the base type is an array type, it shall be a one-dimensional array type whose element subtype is fully constrained. If the base type is a record type, it shall be fully constrained.

014.11: Last paragraph/note on page 55
NOTE-If the base type of the subtype denoted by the type mark is a composite type, it cannot have a subelement of a file type or a protected type (see 5.3.1).

Comments

Section 5.6 Protected types

5.6.2 Protected type declarations

014.12: Conditional Edit if LCS_2016_04 is rejected: 4th paragraph (BNF = 1 paragraph) on page 58
Each subprogram specified within a given protected type declaration defines an abstract operation, called a method, that operates atomically and exclusively on a single object of the protected type. In addition to the object of the protected type operated on by the subprogram, parameters may be explicitly specified in the formal parameter list of the subprogram declaration of the subprogram. Such formal parameters shall not be of an access type or a file type; moreover, they shall not have a subelement that is of an access type or a file type. Additionally, in the case of a function subprogram, the return type of the function shall not be of an access type; moreover, it shall not have a subelement that is of an access type.

014.13: Note 1 on bottom of page 58
NOTE 1-Composite formal parameters of methods and composite return types of function methods cannot have subelements of file types (see 5.3.1).

014.14: Note 2 on bottom of page 58
NOTE 2 NOTE 1 -AThe parameter type of a method or the return type of a function method may be a formal generic type or have a subelement of a formal generic type. However, for an instance of the enclosing declaration that defines the formal generic type, a check is required that the actual generic type is neither an access type nor contains a subelement of an access type. conforms to the rules of this section. Depending on the implementation, this check may be done during analysis of the instantiation, or it may be deferred until the design hierarchy is elaborated.

Section 6.3 Subtype declarations

014.15: Last 2 paragraphs of section 6.3 on page 66 - no changes.

[Author comment: The text starting with "Furthermore" is troubling. Fortunately, Tristan provided an example:
subtype line60Type is line(1 to 60) ;
Fortunately this only applies to the designated type of an access type and does not apply to array types of ft or pt. Hence, no changes to the text.]

A subtype indication denoting an access type, a file type, or a protected type shall not contain a resolution function. Furthermore, the only allowable constraint on a subtype indication denoting an access type is an array constraint (and then only if the designated type is an array type) or a record constraint (and then only if the designated type is a record type).

A subtype indication denoting a subtype of a file type, a protected type, or a formal generic incomplete type of an uninstantiated package or subprogram declaration shall not contain a constraint.

Section 6.4.2.2 Constant declarations

014.16: First paragraph on page 68

It is an error if a constant declaration declares a constant that is of a file type, an access type, a protected type, or a composite type that has a subelement that is of an access type. a file type, an access type, or a protected type.

014.7: Note 1, Second paragraph on page 68

NOTE 1-The subelements of a composite declared constant are not declared constants. Moreover, such subelements cannot be of file types or protected types (see 5.3.1).

Section 6.4.2.3 Signal declarations

014.18: Last paragraph on page 68

It is an error if a signal declaration declares a signal that is of a file type, an access type, a protected type, or a composite type having a subelement that is of a file type, an access type , or a protected type. It is also an error if a guarded signal of a scalar type is neither a resolved signal nor a subelement of a resolved signal.

014.19: Note 4, Second paragraph on page 69, section 6.4.2.3

NOTE 4-The subelements of a composite, declared signal are not declared signals. Moreover, such subelements cannot be of file types or protected types (see 5.3.1).

Section 6.4.2.4 Variable declarations

014.20: 2nd paragraph (BNF = 1 paragraph) on page 70

A variable declaration that includes the reserved word shared is a shared variable declaration. A shared variable declaration declares a shared variable. Shared variables are a subclass of the variable class of objects. The base type of the subtype indication of a shared variable declaration shall be a protected type or a composite containing a protected type. Variables declared immediately within entity declarations, architecture bodies, blocks, and generate statements shall be shared variables. Variables declared immediately within subprograms and processes shall not be shared variables. Variables declared immediately within a package shall be not be shared variables if the package is declared within a subprogram, process, or protected type body; otherwise, the variables shall be shared variables. Variables declared immediately within a protected type body shall not be shared variables. Variables that appear in protected type bodies, other than within subprograms, represent shared data.

014.21: 3rd paragraph (BNF = 1 paragraph) on page 70

If a given variable declaration appears (directly or indirectly) within a protected type body, then the base type denoted by the subtype indication of the variable declaration shall not be the protected type or a composite containing the protected type defined by the protected type body.

014.22: 4rd paragraph (BNF = 1 paragraph) on page 70

If the variable declaration includes the assignment symbol followed by an expression, the expression specifies an initial value for the declared variable; the type of the expression shall be that of the variable. Such an expression is said to be an initial value expression. A variable declaration, whether it is a shared variable declaration or not, whose subtype indication denotes a protected type or a composite containing a protected type shall not have an initial value expression (moreover, it shall not include the immediately preceding assignment symbol).

014.23: Note 5 on page 71

NOTE 5-Variables that are not shared variables may have a subtype indication denoting a protected type or a composite containing a protected type.

014.24: Note 6 on page 71

NOTE 6-A variable, other than a shared variable, may be of a formal generic type. Depending on the implementation, a default initial value may be determined during analysis of an instance of the enclosing declaration that defines the formal generic type, or determination may be deferred until the design hierarchy is elaborated. A shared variable cannot be of a formal generic type, since an actual generic type shall not be a protected type or a composite containing a protected type.

6.4.2.5 File declarations

014.25: 3rd paragraph (BNF = 1 paragraph) on page 72

The subtype indication of a file declaration shall define a file subtype or a composite containing a file subtype. If the subtype indication is a composite containing a file subtype, then the file declaration shall not have the file open information.

014.26: last paragraph before examples on page 72

If a formal subprogram parameter is of the class file, it shall be associated with an actual that is a file object has a file type or a composite containing a file type.

014.27: Note 2 of section 6.4.2.5 on page 73

NOTE 2-A file cannot be of a formal generic type, since an actual generic type shall not be a file type or a composite containing a file type.

6.5.2 Interface object declarations

014.28: 1st paragraph on page 74

For an interface constant declaration (other than a formal parameter of the predefined = or /= operator for an access type) or an interface signal declaration, the subtype indication shall define a subtype that is neither a file type, an access type, nor a protected type. Moreover, the subtype indication shall not denote a composite type with a subelement that is of an access type. a file type, an access type, or a protected type.

014.29: 2nd paragraph on page 74

For an interface file declaration, it is an error if the subtype indication does not denote a subtype of a file type or a composite containing a file type.

014.30: 4th paragraph on page 74

If an interface declaration contains a ?:=? symbol followed by an expression, the expression is said to be the default expression of the interface object. The type of a default expression shall be that of the corresponding interface object. It is an error if a default expression appears in an interface declaration and any of the following conditions hold:
- The mode is linkage.
- The interface object is a formal signal parameter.
- The interface object is a formal variable parameter of mode other than in.
- The subtype indication of the interface declaration denotes a protected type or a composite of a protected type.

014.31: Note 1 of 6.5.2 on page 75

NOTE 1-A subprogram parameter that is of a file type or a composite containing a file type shall be declared as a file parameter.

014.32: Note 6 of 6.5.2 on page 75

[Author Comment: main text now contains this.]

NOTE 6-If the subtype indication of an interface constant declaration or an interface signal declaration denotes a composite type, the type cannot have a subelement of a file type or a protected type (see 5.3.1).

014.33: Note 7 of 6.5.2 on page 75

[Author Comment: This LCS must change this from NOTE 7 to NOTE 6, however this note is both meaningless and inappropriate]

NOTE 7-Although ports of mode out have identical semantics to ports of mode buffer, there is an important design documentation distinction between them. It is intended that a port of mode out should be read only for passive activities, that is, for functionality used for verification purposes within monitors or property or assertion checkers. If the value of an output port is read to implement the algorithmic behavior of a description, then the port should be of mode buffer. Due to the potential complexity of monitors and checkers, it is not feasible to express these usage restrictions as semantic rules within the language without compromising the ability to write complex monitors and checkers.

014.34: Note 8 of 6.5.2 on page 75

NOTE 8 NOTE 6 -A port of mode in may be updated by a force assignment, a release assignment, or a call to vhpi_put_value. A formal parameter of mode in shall not be updated by a call to vhpi_put_value (see 22.5.1).

6.7 Attribute declarations

014.35: 5th paragraph (BNF = 1 paragraph) on page 92

It is an error if the type mark denotes an access type, a file type, a protected type, or a composite type with a subelement that is of an access type. a file type, an access type, or a protected type. The denoted type or subtype need not be constrained.

014.36: Note 4 of 6.7 on page 92

NOTE 4-If the type mark denotes a composite type, the type cannot have a subelement of a file type or a protected type (see 5.3.1).

8.3 Selected names

014.37: page 109 2nd to last paragraph

An expanded name denotes a named entity declared immediately within an elaborated protected type if the prefix denotes an object of the protected type and the suffix is a simple name of a method whose declaration appears immediately within the protected type declaration. If the object is a composite, the prefix shall denote a noncomposite subelement.

9.1 General (expressions)

014.38: 2nd paragraph from bottom on page 117

[Author Note: ok since an array of PT of FT cannot be a primary]

014.39: table at top of page 121 box 1

Any type, other than a file type or, a protected type,or a composite type that contains a file type or a protected type.

014.40: table at top of page 121 box 2

Any type, other than a file type or, a protected type, or a composite type that contains a file type or a protected type.

014.41: first paragraph after table on page 121

The equality and inequality operators (= and /=) are defined for all types other than file types and, protected types ,and composite types that contain a file type or a protected type.

10.6.1 Simple signal assignments

10.6.1.1 General

014.42: Notes p 151, Middle of Page

[Author Note: From Section 6.4.2.3 Last paragraph on page 68, signals cannot be a PT, FT or AT or a composite of a PT, FT or AT. The notes are out of date, so might as well delete them]

NOTE 1-For a signal assignment whose target is a name, no subelement of the target can be of a protected type (see 5.3.1).

NOTE 2-For a signal assignment whose target is in the form of an aggregate, no element of the target can be of a protected type, nor can any subelement of any element of the target be of a protected type (see 5.3.1).

NOTE 3NOTE 1-If a right-hand side value expression is either a numeric literal or an attribute that yields a result of type universal_integer or universal_real, then an implicit type conversion is performed.

10.6.2 Simple variable assignments

10.6.2.1 General

014.43: 2nd paragraph of section on page 160
If the target of the variable assignment statement is a name, then the name shall denote a variable, and the base type of the expression on the right-hand side shall be the same as the base type of the variable denoted by that name. It is an error if the type of the target is a protected type or a composite of a protected type. This form of variable assignment assigns the right-hand side value to a single (scalar or composite) variable.

014.44: Note 2 of 10.6.2.1 on page 161
NOTE 2-For a variable assignment whose target is a name, no subelement of the target can be of a protected type (see 5.3.1).

014.45: Note 3 of 10.6.2.1 on page 161
NOTE 3-For a variable assignment whose target is in the form of an aggregate, no element of the target can be of a protected type, nor can any subelement of any element of the target be of a protected type (see 5.3.1).



Comments

Topic revision: r43 - 2017-07-16 - 20:53:40 - JimLewis
 
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback