📄 1076_5.html
字号:
<html>
<head>
<title>VHDL LRM-Introduction</title>
</head>
<body>
<h1><a name="5">Section 5</a></h1>
<a href="../../HTML/HOMEPG.HTM"><img src="HP.GIF" border=0></a>
<a href="1076_TOC.HTM"><img src="TOP.GIF" BORDER=0></a>
<a href="1076_4.HTM"><img src="LEFT.GIF" BORDER=0></a>
<a href="1076_6.HTM"><img src="RIGHT.GIF" BORDER=0></a>
<HR>
<h1>Specifications</h1>
<p>This section describes <i>specifications</i>, which may be used to associate additional information with a VHDL description. A specification associates additional information with a named entity that has been previously declared. There are three kinds of specifications: attribute specifications,configuration specifications, and disconnection specifications.
<p>A specification always relates to named entities that already exist; thus a given specification must either follow or (in certain cases) be contained within the declaration of the entity to which it relates. Furthermore, a specification must always appear either immediately within the same declarative part as that in which the declaration of the named entity appears, or (in the case of specifications that relate to design units or the interface objects of design units, subprograms, or block statements) immediately within the declarative part associated with the declaration of the design unit, subprogram body, or block statement.
<h2><a name="5.1"> <a href = "1076_5.HTM#5.1"> 5.1 </a> Attribute specification</a></h2>
<p>An attribute specification associates a user-defined attribute with one or more named entities and defines the value of that attribute for those entities. The attribute specification is said to <i>decorate</i> the named entity.
<pre> attribute_specification ::=
<b>attribute </b>attribute_designator <b>of</b> entity_specification <b>is </b>expression ;
entity_specification ::=
entity_name_list : entity_class
entity_class ::=
<b>entity</b> | <b>architecture</b> | <b>configuration</b>
| <b>procedure</b> | <b>function</b> | <b>package</b>
| <b>type</b> | <b>subtype</b> | <b>constant</b>
| <b>signal</b> | <b>variable</b> | <b>component</b>
| <b>label</b> | <b>literal</b> | <b>units</b>
| <b>group</b> | <b>file</b>
entity_name_list ::=
entity_designator { , entity_designator }
| <b>others</b>
| <b>all</b>
entity_designator ::= entity_tag [ signature ]
entity_tag ::= simple_name | character_literal | operator_symbol
</pre>
<p>The attribute designator must denote an attribute. The entity name list identifies those named entities, both implicitly and explicitly defined, that inherit the attribute, as described below:
<ul>
<p>-- If a list of entity designators is supplied, then the attribute specification applies to the named entities denoted by those designators. It is an error if the class of those names is not the same as that denoted by the entity class.
<p>-- If the reserved word <b>others</b> is supplied, then the attribute specification applies to named entities of the specified class that are declared in the immediately enclosing declarative part, provided that each such entity is not explicitly named in the entity name list of a previous attribute specification for the given attribute.
<p>-- If the reserved word <b>all</b> is supplied, then the attribute specification applies to all named entities of the specified class that are declared in the immediately enclosing declarative part.
</ul>
<p>An attribute specification with the entity name list <b>others</b> or<b> all</b> for a given entity class that appears in a declarative part must be the last such specification for the given attribute for the given entity class in that declarative part. No named entity in the specified entity class may be declared in a given declarative part following such an attribute specification.
<p>If a name in an entity name list denotes a subprogram or package, it denotes the subprogram declaration or package declaration. Subprogram and package bodies cannot be attributed.
<p>An entity designator that denotes an alias of an object is required to denote the entire object, not a member or subelement (or slice thereof).
<p>The entity tag of an entity designator containing a signature must denote the name of one or more subprograms or enumeration literals. In this case, the signature must match (see <a href = "1076_2.HTM#2.3.2"> 2.3.2 </a> ) the parameter and result type profile of exactly one subprogram or enumeration literal in the current declarative part; the enclosing attribute specification then decorates that subprogram or enumeration literal.
<p>The expression specifies the value of this attribute for each of the named entities inheriting the attribute as a result of this attribute specification. The type of the expression in the attribute specification must be the same as(or implicitly convertible to) the type mark in the corresponding attribute declaration. If the entity name list denotes an entity interface, architecture body, or configuration declaration, then the expression is required to be locally static (see <a href = "1076_7.HTM#7.4"> 7.4 </a> ).
<p>An attribute specification for an attribute of a design unit (i.e., an entity interface, an architecture, a configuration, or a package) must appear immediately within the declarative part of that design unit. Similarly, an attribute specification for an attribute of an interface object of a design unit, subprogram, or block statement must appear immediately within the declarative part of that design unit, subprogram, or block statement. An attribute specification for an attribute of a procedure, a function, a type, a subtype, an object (i.e., a constant, a file, a signal, or a variable), a component, literal, unit name, group, or a labeled entity must appear within the declarative part in which that procedure, function, type, subtype, object,component, literal, unit name, group, or label, respectively, is explicitly or implicitly declared.
<p>For a given named entity, the value of a user-defined attribute of that entity is the value specified in an attribute specification for that attribute of that entity.
<p>It is an error if a given attribute is associated more than once with a given named entity. Similarly, it is an error if two different attributes with the same simple name (whether predefined or user-defined) are both associated with a given named entity.
<p>An entity designator that is a character literal is used to associate an attribute with one or more character literals. An entity designator that is an operator symbol is used to associate an attribute with one or more overloaded operators.
<p>The decoration of a named entity that can be overloaded attributes all named entities matching the specification already declared in the current declarative part.
<p>If an attribute specification appears, it must follow the declaration of the named entity with which the attribute is associated, and it must precede all references to that attribute of that named entity. Attribute specifications are allowed for all user-defined attributes, but are not allowed for predefined attributes.
<p>An attribute specification may reference a named entity by using an alias for that entity in the entity name list, but such a reference counts as the single attribute specification that is allowed for a given attribute and therefore prohibits a subsequent specification that uses the declared name of the entity (or any other alias) as the entity designator.
<p>An attribute specification whose entity designator contains no signature and identifies an overloaded subprogram has the effect of associating that attribute with each of the designated overloaded subprograms declared within that declarative part.
<p><i>Examples:</i>
<pre> <b>attribute </b>PIN_NO <b>of</b> CIN: <b>signal</b> <b>is</b> 10;
<b>attribute </b>PIN_NO <b>of</b> COUT: <b>signal</b> <b>is </b>5;
<b>attribute </b>LOCATION <b>of</b> ADDER1: <b>label</b> <b>is </b>(10,15);
<b>attribute </b>LOCATION <b>of others</b>: <b>label</b> <b>is </b>(25,77);
<b>attribute </b>CAPACITANCE <b>of</b> <b>all</b>: <b>signal</b> <b>is </b>15 pF;
<b>attribute</b> IMPLEMENTATION <b>of</b> G1: <b>group</b> <b>is</b> "74LS152";
<b>attribute</b> RISING_DELAY <b>of</b> C2Q: <b>group</b> <b>is</b> 7.2 ns;
</pre>
<p>
<h4>NOTES</h4>
<p>1--User-defined attributes represent local information only and cannot be used to pass information from one description to another. For instance, assume some signal X in an architecture body has some attribute A. Further, assume that X is associated with some local port L of component C. C in turn is associated with some design entity E(B), and L is associated with E's formal port P. Neither L nor P has attributes with the simple name A, unless such attributes are supplied via other attribute specifications; in this latter case, the values of P'A and X'A are not related in any way.
<p>2--The local ports and generics of a component declaration cannot be attributed, since component declarations lack a declarative part.
<p>3--If an attribute specification applies to an overloadable named entity, then declarations of additional named entities with the same simple name are allowed to occur in the current declarative part unless the aforementioned attribute specification has as its entity name list either of the reserved words <b>others</b> or <b>all</b>.
<p>4--Attribute specifications supplying either of the reserved words <b>others</b> or <b>all</b> never apply to the interface objects of design units, block statements, or subprograms.
<p>5--An attribute specification supplying either of the reserved words <b>others</b> or <b>all</b> may apply to none of the named entities in the current declarative part, in the event that none of the named entities in the current declarative part meet all of the requirements of the attribute specification.
<h2><a name="5.2"> <a href = "1076_5.HTM#5.2"> 5.2 </a> Configuration specification</a></h2>
<p>A configuration specification associates binding information with component labels representing instances of a given component declaration.
<pre> configuration_specification ::=
<b>for</b> component_specification binding_indication ;
component_specification ::=
instantiation_list : <i>component</i>_name
instantiation_list ::=
<i>instantiation</i>_label { , <i>instantiation</i>_label }
| <b>others</b>
| <b>all</b>
</pre>
<p>The instantiation list identifies those component instances with which binding information is to be associated, as defined below:
<ul>
<p>-- If a list of instantiation labels is supplied, then the configuration specification applies to the corresponding component instances. Such labels must be (implicitly) declared within the immediately enclosing declarative part. It is an error if these component instances are not instances of the component declaration named in the component specification. It is also an error if any of the labels denote a component instantiation statement whose corresponding instantiated unit does not name a component.
<p>-- If the reserved word <b>others</b> is supplied, then the configuration specification applies to instances of the specified component declaration whose labels are (implicitly) declared in the immediately enclosing declarative part,provided that each such component instance is not explicitly named in the instantiation list of a previous configuration specification. This rule applies only to those component instantiation statements whose corresponding instantiated units name components.
<p>-- If the reserved word <b>all</b> is supplied, then the configuration specification applies to all instances of the specified component declaration whose labels are (implicitly) declared in the immediately enclosing declarative part. This rule applies only to those component instantiation statements whose corresponding instantiated units name components.
</ul>
<p>A configuration specification with the instantiation list <b>others</b> or <b>all</b> for a given component name that appears in a declarative part must be the last such specification for the given component name in that declarative part.
<p>The elaboration of a configuration specification results in the association of binding information with the labels identified by the instantiation list. A label that has binding information associated with it is said to be <i>bound</i>. It is an error if the elaboration of a configuration specification results in the association of binding information with a component label that is already bound.
<p>NOTE--A configuration specification supplying either of the reserved words<b> others</b> or <b>all</b> may apply to none of the component instances in the current declarative part. This is the case when none of the component instances in the current declarative part meet all of the requirements of the given configuration specification.
<h3><a name="5.2.1"> <a href = "1076_5.HTM#5.2.1"> 5.2.1 </a> Binding indication</a></h3>
<p>A binding indication associates instances of a component declaration with a particular design entity. It may also associate actuals with formals declared in the entity interface.
<pre> binding_indication ::=
[ <b>use</b> entity_aspect ]
[ generic_map_aspect ]
[ port_map_aspect ]
</pre>
<p>The entity aspect of a binding indication, if present, identifies the design entity with which the instances of a component are associated. If present, the generic map aspect of a binding indication identifies the expressions to be associated with formal generics in the design entity interface. Similarly, the port map aspect of a binding indication identifies the signals or values to be associated with formal ports in the design entity interface.
<p>When a binding indication is used in a configuration specification, it is an error if the entity aspect is absent.
<p>A binding indication appearing in a component configuration need not have an entity aspect under the following condition: The block corresponding to the block configuration in which the given component configuration appears is required to have one or more configuration specifications that together configure all component instances denoted in the given component configuration. Under this circumstance, these binding indications are the <i>primary binding indications</i>. It is an error if a binding indication appearing in a component configuration does not have an entity aspect and there are no primary binding indications. It is also an error if, under these circumstances, the binding indication has neither a generic map aspect nor a port map aspect. This form of binding indication is the <i>incremental binding indication</i>, and it is used to <i>rebind</i> <i>incrementally </i>the ports and generics of the denoted instance(s) under the following conditions:
<ul>
<p>-- For each formal generic appearing in the generic map aspect of the incremental binding indication and denoting a formal generic that is unassociated or associated with <b>open</b> in any of the primary binding indications, the given formal generic is bound to the actual with which it is associated in the generic map aspect of the incremental binding indication.
<p>-- For each formal generic appearing in the generic map aspect of the incremental binding indication and denoting a formal generic that is associated with an actual other than <b>open</b> in one of the primary binding indications, the given formal generic is <i>rebound</i> to the actual with which it is associated in the generic map aspect of the incremental binding indication. That is, the association given in the primary binding indication has no effect for the given instance.
<p>-- For each formal port appearing in the port map aspect of the incremental binding indication and denoting a formal port that is unassociated or associated with <b>open</b> in any of the primary binding indications, the given formal port is bound to the actual with which it is associated in the port map aspect of the incremental binding indication.
<p>-- It is an error if a formal port appears in the port map aspect of the incremental binding indication and it is a formal port that is associated with an actual other than <b>open</b> in one of the primary binding indications.
</ul>
<p>If the generic map aspect or port map aspect of a binding indication is not present, then the default rules as described in <a href = "1076_5.HTM#5.2.2"> 5.2.2 </a> apply.
<p><i>Examples:</i>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -