VHDL Issue Number: 1058 Classification: Terminology, Grammar, and Typographical Errors Language Version: VHDL-93 Summary: What use are LINKAGE ports? Related Issues: 0140 Relevant LRM Sections: 4.3.2, 4.3.1.2, 3.2.1.1, 1.1.1.2, 12.6.2 Key Words and Phrases: Linkage ports Current Status: Submitted?? Analyzed?? 1076-1993 Disposition: N/A Disposition Rationale: N/A Superseded By: N/A ----------------------- Date Submitted: 1989/06/21 Author of Submission: Ken Scott (edited by Daniel Barclay) Author's Affiliation: Vantage Analysis Systems, Inc. Author's Post Address: 42840 Christy St., Suite 201 Fremont, CA 94538 Author's Phone Number: (415) 659-0901 Author's Fax Number: Author's Net Address: N/A ----------------------- Date Analyzed: 1991/03/21 Author of Analysis: Alex Zamfirescu (edited by Daniel Barclay) Revision Number: $Revision: 1.8 $ Date Last Revised: $Date: 1995/05/15 21:26:37 $ Description of Problem ---------------------- Review this passage from Section 4.3.2 of the LRM: * LINKAGE. The value of the interface object may be read or updated, but only by appearing as an actual corresponding to an interface object of mode LINKAGE. No other reading or updating is permitted. What use are LINKAGE ports if you cannot explicitly read them or write them? Proposed Resolution ------------------- A note should be added to this section explaining the usefulness of LINKAGE ports. VASG-ISAC Analysis & Rationale ------------------------------ The semantic for linkage ports is defined by the LRM as follows: LRM 1.1.1.2 Ports: For a formal port of mode linkage, the associated actual may be a port of any mode. LRM 3.2.1.1 Index Constraints and Discrete Ranges: * For an interface object or member of an interface object whose mode is IN, INOUT or LINKAGE, if the actual part includes a conversion function or type conversion, then the result type of that function or type mark of the type conversion must be a constrained array subtype, and the index ranges are obtained from this constrained subtype, and the index ranges are obtained from this constrained subtype; otherwise, the index ranges are obtained from the object or value denoted by the actual designator(s). * For an interface object or a member of an interface object whose mode is OUT, BUFFER, INOUT, or LINKAGE, if the formal part includes a conversion function or a type conversion, then the parameter subtype of that function must be a constrained array subtype, and the index ranges are obtained from this constrained subtype; otherwise, the index ranges are obtained from the object denotes by the actual designators(s). For an interface object of mode INOUT or LINKAGE, the index ranges determined by the first rule must be identical to the index ranges determined by the second rule. LRM 4.3.1.2 Signal Declaration: A signal may have one or more SOURCES. For a signal of a scalar type, each source is either a driver (see 12.6.1) or an OUT, INOUT, BUFFER or LINKAGE port of a component instance or or a block statement with which the signal is associated. LRM 4.3.1.2 Signal Declaration: If a subelement or slice of a resolved signal of composite type is associated as an actual in a port map aspect (either in a component instantiation statement or in a binding indication), and if the corresponding formal is of mode OUT, INOUT, BUFFER, or LINKAGE, then every scalar subelement of that signal must be associated exactly once with such a formal in the same port map aspect, and the collection of the corresponding formal parts taken together constitute one source of the signal. LRM 4.3.2 Interface Declarations: It is an error if a default expression appears in an interface declaration and any of the folowing conditions hold: - The mode is LINKAGE. The value of an object is said to be READ when one of the following conditions is satisfied: - When the object is evaluated, and also (indirectly) when the object is associated with an interface object of the modes IN, INOUT, or LINKAGE. The value of an object is said to be UPDATED when one of the following conditions is satisfied: - When it is the target of an assignment, and also (indirectly) when the object is associated with an interface object of the modes OUT, BUFFER, INOUT, or LINKAGE. An interface object has one of the following modes: - LINKAGE. The value of the interface object may be read or updated, but only by appearing as an actual corresponding to an interface object of mode LINKAGE. No other reading or updating is permitted. LRM 4.3.2.2 Association Lists: The type of the actual (after applying the conversion function or type conversion, if present in the actual part) must be the same as the type of the corresponding formal, if the mode of the formal is IN, INOUT, or LINKAGE, and if the actual is not OPEN. Similarly, if the mode of the formal is OUT, INOUT, BUFFER, or LINKAGE, and if the actual is not OPEN, then the type of the formal (after applying the conversion function or type convesrion, if present in the formal part) must be the same as the corresponding actual. LRM 12.6.2 Propagation of Signal Values: No effective value is specified for OUT and LINKAGE ports, since these ports may not be read. There are also some clarifications in the APPENDIX B GLOSSARY: Mode. The direction of information flow through the port or parameter. Modes are in, out, inout, buffer, or linkage. ( 4.3.2) Update. An action on the value of a signal, variable, or file. The value of a signal is said to be updated when the signal appears as the target (or a component of the target) of a signal assignment statement, (indirectly( when it is associated with an interface object of mode OUT, BUFFER, INOUT, or LINKAGE, or when one of its subelements (individually or as part of a slice) is updated. The value of a signal is also said to be updated when it is subelement of slice of a resoled signal, and the resolved signal is updated. The value of a variable is said to be updated when the variable appears as the target (or a component of the target) of a variable assignment statement, (indirectly) when it is associated with an interface object of mode OUT or LINKAGE, or when on of its sublement (individual or part of a slice) is updated. The value of a file is said to be updated when a WRITE operation is performed on the file object. ( 4.3.2) First, the LRM semantic for linkage ports contains a contradiction. Let x be a port of mode linkage that is associated as an actual with another formal port y of mode linkage. This is permitted by LRM 1.1.1.2 (Ports): ... For a formal port of mode linkage, the associated actual may be a port of any mode. Then by LRM 4.3.2 (Interface Declarations): - The value of the interface object may be read or updated, but only by appearing as an actual corresponding to an interface object of mode LINKAGE. No other reading or updating is permitted. we can infer that port x may be read, which is in contradiction with LRM 12.6.2 (Propagation of Signal Values): No effective value is specified for out and linkage ports, since these ports may not be read. Second, the LRM semantic for linkage ports permits the description of hierarchical networks of ports of mode linkage. Only the top side of the network can be associated with a signal. The propagation through these networks apparently follows the rules of normal ports if there are no multiple sources (although there is no rule for the direction of propagation). With multiple sources the direction dilemma becomes more complicated, since in some branches only up propagation is possible, while in other values propagate down. The proposed resolution referring to the usefulness of LINKAGE ports is based mostly on the fact that the LRM has left open the updating semantic for linkage ports at the leaf level and some rules for the propagation. This lack of specification has been used by some vendors who have utilized linkage ports to add extra semantics to their VHDL tools. For example, MCC Switch Level cells use linkage ports. Another potential application is mixed-mode simulation. In conclusion, the LRM semantic for linkage ports is wrong and incomplete. There are two missing parts, (a) propagation semantic, and (b) leaf cell updating semantic with (a) required and (b) expected (not necessarily needed). VASG-ISAC Recommendation for IEEE Std 1076-1993 ----------------------------------------------- Do not add a note explaining the usefulness of LINKAGE ports. Instead, recommend caution when using linkage ports since if they might work on some implementation that implementation has made choices that prevent portability and are outside of the VHDL LRM. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- Here are some possibilities: 1. Discard LINKAGE ports. Use LINKAGE key-word with other semantic. 2. Do not discard LINKAGE ports. Instead, clarify the contradiction. Add semantic for propagation and leaf port update. Add standard interface with the analog ports. Use linkage leaf ports as fuzzifier/defuzzifier ports to the analog world.