?? 1076_12.html
字號:
<h2><a name="12.3"> <a href = "1076_12.HTM#12.3"> 12.3 </a> Elaboration of a declarative part</a></h2>
<p>The elaboration of a declarative part consists of the elaboration of the declarative items, if any, in the order in which they are given in the declarative part. This rule holds for all declarative parts, with three exceptions:
<ol type="a">
<li>The entity declarative part of a design entity whose corresponding architecture is decorated with the 'FOREIGN attribute defined in package STANDARD (see <a href = "1076_5.HTM#5.1"> 5.1 </a> and <a href = "1076_14.HTM#14.2"> 14.2 </a> )<br>
<li>The architecture declarative part of a design entity whose architecture is decorated with the 'FOREIGN attribute defined in package STANDARD<br>
<li>A subprogram declarative part whose subprogram is decorated with the 'FOREIGN attribute defined in package STANDARD<br>
</ol>
<p>For these cases, the declarative items are not elaborated; instead, the design entity or subprogram is subject to implementation-dependent elaboration.
<p>In certain cases, the elaboration of a declarative item involves the evaluation of expressions that appear within the declarative item. The value of any object denoted by a primary in such an expression must be defined at the time the primary is read (see <a href = "1076_4.HTM#4.3.2"> 4.3.2 </a> ). In addition, if a primary in such an expression is a function call, then the value of any object denoted by or appearing as a part of an actual designator in the function call must be defined at the time the expression is evaluated.
<p>NOTE--It is a consequence of this rule that the name of a signal declared within a block cannot be referenced in expressions appearing in declarative items within that block, an inner block, or process statement; nor can it be passed as a parameter to a function called during the elaboration of the block. These restrictions exist because the value of a signal is not defined until after the design hierarchy is elaborated. However, a signal parameter name maybe used within expressions in declarative items within a subprogram declarative part, provided that the subprogram is only called after simulation begins,because the value of every signal will be defined by that time.
<h3><a name="12.3.1"> <a href = "1076_12.HTM#12.3.1"> 12.3.1 </a> Elaboration of a declaration</a></h3>
<p>Elaboration of a declaration has the effect of creating the declared item.
<p>For each declaration, the language rules (in particular scope and visibility rules) are such that it is either impossible or illegal to use a given item before the elaboration of its corresponding declaration. For example, it is not possible to use the name of a type for an object declaration before the corresponding type declaration is elaborated. Similarly, it is illegal to calla subprogram before its corresponding body is elaborated.
<h3><a name="12.3.1.1"> <a href = "1076_12.HTM#12.3.1.1"> 12.3.1.1 </a> Subprogram declarations and bodies</a></h3>
<p>Elaboration of a subprogram declaration involves the elaboration of the parameter interface list of the subprogram declaration; this in turn involves the elaboration of the subtype indication of each interface element to determine the subtype of each formal parameter of the subprogram.
<p>Elaboration of a subprogram body has no effect other than to establish that the body can, from then on, be used for the execution of calls of the subprogram.
<h3><a name="12.3.1.2"> <a href = "1076_12.HTM#12.3.1.2"> 12.3.1.2 </a> Type declarations</a></h3>
<p>Elaboration of a type declaration generally consists of the elaboration of the definition of the type and the creation of that type. For a constrained array type declaration, however, elaboration consists of the elaboration of the equivalent anonymous unconstrained array type followed by the elaboration of the named subtype of that unconstrained type.
<p>Elaboration of an enumeration type definition has no effect other than the creation of the corresponding type.
<p>Elaboration of an integer, floating point, or physical type definition consists of the elaboration of the corresponding range constraint. For a physical type definition, each unit declaration in the definition is also elaborated. Elaboration of a physical unit declaration has no effect other than to create the unit defined by the unit declaration.
<p>Elaboration of an unconstrained array type definition consists of the elaboration of the element subtype indication of the array type.
<p>Elaboration of a record type definition consists of the elaboration of the equivalent single element declarations in the given order. Elaboration of an element declaration consists of elaboration of the element subtype indication.
<p>Elaboration of an access type definition consists of the elaboration of the corresponding subtype indication.
<h3><a name="12.3.1.3"> <a href = "1076_12.HTM#12.3.1.3"> 12.3.1.3 </a> Subtype declarations</a></h3>
<p>Elaboration of a subtype declaration consists of the elaboration of the subtype indication. The elaboration of a subtype indication creates a subtype. If the subtype does not include a constraint, then the subtype is the same as that denoted by the type mark. The elaboration of a subtype indication that includes a constraint proceeds as follows:
<ol type="a">
<li>The constraint is first elaborated.<br>
<li>A check is then made that the constraint is compatible with the type or subtype denoted by the type mark (see <a href = "1076_3.HTM#3.1"> 3.1 </a> and <a href = "1076_3.HTM#3.2.1.1"> 3.2.1.1 </a> ).
</ol>
<p>Elaboration of a range constraint consists of the evaluation of the range. The evaluation of a range defines the bounds and direction of the range. Elaboration of an index constraint consists of the elaboration of each of the discrete ranges in the index constraint in some order that is not defined by the language.
<h3><a name="12.3.1.4"> <a href = "1076_12.HTM#12.3.1.4"> 12.3.1.4 </a> Object declarations</a></h3>
<p>Elaboration of an object declaration that declares an object other than a file object proceeds as follows:
<ol type="a">
<li>The subtype indication is first elaborated. This establishes the subtype of the object.<br>
<li>If the object declaration includes an explicit initialization expression,then the initial value of the object is obtained by evaluating the expression. It is an error if the value of the expression does not belong to the subtype of the object; if the object is an array object, then an implicit subtype conversion is first performed on the value unless the object is a constant whose subtype indication denotes an unconstrained array type. Otherwise, any implicit initial value for the object is determined.<br>
<li>The object is created.<br>
<li>Any initial value is assigned to the object.
</ol>
<p>The initialization of such an object (either the declared object or one of its subelements) involves a check that the initial value belongs to the subtype of the object. For an array object declared by an object declaration, an implicit subtype conversion is first applied as for an assignment statement, unless the object is a constant whose subtype is an unconstrained array type.
<p>The elaboration of a file object declaration consists of the elaboration of the subtype indication followed by the creation of the object. If the file object declaration contains file open information, then the implicit call to FILE_OPEN is then executed (see <a href = "1076_4.HTM#4.3.1.4"> 4.3.1.4 </a> ).
<p>NOTES
<p>1--These rules apply to all object declarations other than port and generic declarations, which are elaborated as outlined in <a href = "1076_12.HTM#12.2.1"> 12.2.1 </a> through <a href = "1076_12.HTM#12.2.4"> 12.2.4 </a> .
<p>2--The expression initializing a constant object need not be a static expression.
<h3><a name="12.3.1.5"> <a href = "1076_12.HTM#12.3.1.5"> 12.3.1.5 </a> Alias declarations</a></h3>
<p>Elaboration of an alias declaration consists of the elaboration of the subtype indication to establish the subtype associated with the alias, followed by the creation of the alias as an alternative name for the named entity. The creation of an alias for an array object involves a check that the subtype associated with the alias includes a matching element for each element of the named object. It is an error if this check fails.
<h3><a name="12.3.1.6"> <a href = "1076_12.HTM#12.3.1.6"> 12.3.1.6 </a> Attribute declarations</a></h3>
<p>Elaboration of an attribute declaration has no effect other than to create a template for defining attributes of items.
<h3><a name="12.3.1.7"> <a href = "1076_12.HTM#12.3.1.7"> 12.3.1.7 </a> Component declarations</a></h3>
<p>Elaboration of a component declaration has no effect other than to create a template for instantiating component instances.
<h3><a name="12.3.2"> <a href = "1076_12.HTM#12.3.2"> 12.3.2 </a> Elaboration of a specification</a></h3>
<p>Elaboration of a specification has the effect of associating additional information with a previously declared item.
<h3><a name="12.3.2.1"> <a href = "1076_12.HTM#12.3.2.1"> 12.3.2.1 </a> Attribute specifications</a></h3>
<p>Elaboration of an attribute specification proceeds as follows:
<ol type="a">
<li>The entity specification is elaborated in order to determine which items are affected by the attribute specification.<br>
<li>The expression is evaluated to determine the value of the attribute. It is an error if the value of the expression does not belong to the subtype of the attribute; if the attribute is of an array type, then an implicit subtype conversion is first performed on the value, unless the subtype indication of the attribute denotes an unconstrained array type.<br>
<li>A new instance of the designated attribute is created and associated with each of the affected items.<br>
<li>Each new attribute instance is assigned the value of the expression.
</ol>
<p>The assignment of a value to an instance of a given attribute involves a check that the value belongs to the subtype of the designated attribute. For an attribute of a constrained array type, an implicit subtype conversion is first applied as for an assignment statement. No such conversion is necessary for an attribute of an unconstrained array type; the constraints on the value determine the constraints on the attribute.
<p>NOTE--The expression in an attribute specification need not be a static expression.
<h3><a name="12.3.2.2"> <a href = "1076_12.HTM#12.3.2.2"> 12.3.2.2 </a> Configuration specifications</a></h3>
<p>Elaboration of a configuration specification proceeds as follows:
<ol type="a">
<li>The component specification is elaborated in order to determine which component instances are affected by the configuration specification.<br>
<li>The binding indication is elaborated to identify the design entity to which the affected component instances will be bound.<br>
<li>The binding information is associated with each affected component instance label for later use in instantiating those component instances.
</ol>
<p>As part of this elaboration process, a check is made that both the entity declaration and the corresponding architecture body implied by the binding indication exist within the specified library. It is an error if this check fails.
<h3><a name="12.3.2.3"> <a href = "1076_12.HTM#12.3.2.3"> 12.3.2.3 </a> Disconnection specifications</a></h3>
<p>Elaboration of a disconnection specification proceeds as follows:
<ol type="a">
<li>The guarded signal specification is elaborated in order to identify the signals affected by the disconnection specification.<br>
<li>The time expression is evaluated to determine the disconnection time for drivers of the affected signals.<br>
<li>The disconnection time is associated with each affected signal for later use in constructing disconnection statements in the equivalent processes for guarded assignments to the affected signals.
</ol>
<h2><a name="12.4"> <a href = "1076_12.HTM#12.4"> 12.4 </a> Elaboration of a statement part</a></h2>
<p>Concurrent statements appearing in the statement part of a block must be elaborated before execution begins. Elaboration of the statement part of a block consists of the elaboration of each concurrent statement in the order given. This rule holds for all block statement parts except for those blocks equivalent to a design entity whose corresponding architecture is decorated with the 'FOREIGN attribute defined in package STANDARD (see <a href = "1076_14.HTM#14.2"> 14.2 </a> ).
<p>For this case, the statements are not elaborated; instead, the design entity is subject to implementation-dependent elaboration.
<h3><a name="12.4.1"> <a href = "1076_12.HTM#12.4.1"> 12.4.1 </a> Block statements</a></h3>
<p>Elaboration of a block statement consists of the elaboration of the block header, if present, followed by the elaboration of the block declarative part, followed by the elaboration of the block statement part.
<p>Elaboration of a block statement may occur under the control of a configuration declaration. In particular, a block configuration, whether implicit or explicit, within a configuration declaration may supply a sequence of additional implicit configuration specifications to be applied during the elaboration of the corresponding block statement. If a block statement is being elaborated under the control of a configuration declaration, then the sequence of implicit configuration specifications supplied by the block configuration is elaborated as part of the block declarative part, following all other declarative items in that part.
<p>The sequence of implicit configuration specifications supplied by a block configuration, whether implicit or explicit, consists of each of the configuration specifications implied by component configurations (see <a href = "1076_1.HTM#1.3.2"> 1.3.2 </a> ) occurring immediately within the block configuration, in the order in which the component configurations themselves appear.
<h3><a name="12.4.2"> <a href = "1076_12.HTM#12.4.2"> 12.4.2 </a> Generate statements</a></h3>
<p>Elaboration of a generate statement consists of the replacement of the generate statement with zero or more copies of a block statement whose declarative part consists of the declarative items contained within the generate statement and whose statement part consists of the concurrent statements contained within the generate statement. These block statements are said to be <i>represented</i> by the generate statement. Each block statement is then elaborated.
<p>For a generate statement with a for generation scheme, elaboration consists of the elaboration of the discrete range, followed by the generation of one block statement for each value in the range. The block statements all have the following form:
<ol type="a">
<li>The label of the block statement is the same as the label of the generate statement.<br>
<li>The block declarative part has, as its first item, a single constant declaration that declares a constant with the same simple name as that of the applicable generate parameter; the value of the constant is the value of the generate parameter for the generation of this particular block statement. The type of this declaration is determined by the base type of the discrete range of the generate parameter. The remainder of the block declarative part consists of a copy of the declarative items contained within the generate statement.<br>
<li>The block statement part consists of a copy of the concurrent statements contained within the generate statement.<br>
</ol>
<p>For a generate statement with an if generation scheme, elaboration consists of the evaluation of the Boolean expression, followed by the generation of exactly one block statement if the expression evaluates to TRUE, and no block statement otherwise. If generated, the block statement has the following form:
<ul>
<p>-- The block label is the same as the label of the generate statement.
<p>-- The block declarative part consists of a copy of the declarative items contained within the generate statement.
<p>-- The block statement part consists of a copy of the concurrent statements contained within the generate statement.
</ul>
<p><i>Examples:</i>
<pre> -- The following generate statement:
LABL : <b>for</b> I <b>in</b> 1 <b>to</b> 2 <b>generate</b>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -