?? 1076_8.html
字號:
<p><li>All of the new transactions are marked.
<p><li>An old transaction is marked if the time at which it is projected to occur is less than the time at which the first new transaction is projected to occur minus the pulse rejection limit.
<p><li>For each remaining unmarked, old transaction, the old transaction is marked if it immediately precedes a marked transaction and its value component is the same as that of the marked transaction.
<p><li>The transaction that determines the current value of the driver is marked.
<p><li>All unmarked transactions (all of which are old transactions) are deleted from the projected output waveform.
</ol>
<p>For the purposes of marking transactions, any two successive null transactions in a projected output waveform are considered to have the same value component.
<p>The execution of a signal assignment statement whose target is of a composite type proceeds in a similar fashion, except that the evaluation of the waveform results in one sequence of transactions for each scalar subelement of the type of the target. Each such sequence consists of transactions whose value portions are determined by the values of the same scalar subelement of the value expressions in the waveform, and whose time portion is determined by the time expression corresponding to that value expression. Each such sequence is then used to update the projected output waveform of the driver of the matching subelement of the target. This applies both to a target that is the name of a signal of a composite type and to a target that is in the form of an aggregate.
<p>If a given procedure is declared by a declarative item that is not contained within a process statement, and if a signal assignment statement appears in that procedure, then the target of the assignment statement must be a formal parameter of the given procedure or of a parent of that procedure, or an aggregate of such formal parameters. Similarly, if a given procedure is declared by a declarative item that is not contained within a process statement, and if a signal is associated with an <b>inout</b> or <b>out</b> mode signal parameter in a subprogram call within that procedure, then the signal so associated must be a formal parameter of the given procedure or of a parent of that procedure.
<h4>NOTES</h4>
<p>1--These rules guarantee that the driver affected by a signal assignment statement is always statically determinable if the signal assignment appears within a given process (including the case in which it appears within a procedure that is declared within the given process). In this case, the affected driver is the one defined by the process; otherwise, the signal assignment must appear within a procedure, and the affected driver is the one passed to the procedure along with a signal parameter of that procedure.
<p>2--Overloading the operator "=" has no effect on the updating of a projected output waveform.
<p>3--Consider a signal assignment statement of the form
<pre> T <= <b>reject</b> t<sub>r</sub> <b>inertial</b> e<sub>1</sub> <b>after</b> t<sub>1</sub> { , e<i><sub>i</sub></i> <b>after</b> t<i><sub>i<./sub></i> } ;
</pre>
<p> The following relations hold:
<pre> 0 ns <= t<sub>r</sub> <= t<sub>1</sub>
</pre>
<p> and
<pre> 0 ns <= t<sub>i</sub> < t<i><sub>i</sub></i>+1
</pre>
<p>Note that, if t<sub>r</sub> = 0 ns, then the waveform editing is identical to that for transport-delayed assignment, and if t<sub>r</sub> = t<sub>1</sub>, the waveform is identical to that for the statement
<pre> T <= e<sub>1</sub> <b>after</b> t<sub>1</sub> { , e<i><sub>i</sub></i> <b>after</b> t<i><sub>i</sub></i> } ;
</pre>
<p>4--Consider the following signal assignment in some process:
<pre> S <= <b>reject</b> 15 ns <b>inertial</b> 12 <b>after</b> 20 ns, 18 <b>after</b> 41 ns;
</pre>
<p>where S is a signal of some integer type. Assume that at the time this signal assignment is executed, the driver of S in the process has the following contents (the first entry is the current driving value):<br><br>
<table border="1">
<tr><td align="center">1<td align="center">2<td align="center">2<td align="center">12<td align="center">5<td align="center">8</tr>
<tr><td align="center">NOW<td align="center">+3 ns<td align="center">+12 ns<td align="center">+13 ns<td align="center">+20 ns<td align="center">+42 ns</tr>
</table>
<p>
<p>(The times given are relative to the current time.) The updating of the projected output waveform proceeds as follows:
<p>a. The driver is truncated at 20 ns. The driver now contains the following pending transactions:<br><br>
<table border="1">
<tr><td align="center">1<td align="center">2<td align="center">2<td align="center">12</tr>
<tr><td align="center">NOW<td align="center">+3 ns<td align="center">+12 ns<td align="center">+13 ns</tr>
</table>
<p>
<p>b. The new waveforms are added to the driver. The driver now contains the following pending transactions:<br><br>
<table border="1">
<tr><td align="center">1<td align="center">2<td align="center">2<td align="center">12<td align="center">12<td align="center">18</tr>
<tr><td align="center">NOW<td align="center">+3 ns<td align="center">+12 ns<td align="center">+13 ns<td align="center">+20 ns<td align="center">+41 ns</tr>
</table>
<p>
<p>c. All new transactions are marked, as well as those old transactions that occur at less than the time of the first new waveform (20 ns) less the rejection limit (15 ns). The driver now contains the following pending transactions (marked transactions are emboldened):<br><br>
<table border="1">
<tr><td align="center">1<td align="center"><b>2</b><td align="center">2<td align="center">12<td align="center"><b>12</b><td align="center"><b>18</b></tr>
<tr><td align="center">NOW<td align="center"><b>+3 ns</b><td align="center">+12 ns<td align="center">+13 ns<td align="center"><b>+20 ns</b><td align="center"><b>+41 ns</b></tr>
</table>
<p>
<p>d. Each remaining unmarked transaction is marked if it immediately precedes a marked transaction and has the same value as the marked transaction. The driver now contains the following pending transactions:<br><br>
<table border="1">
<tr><td align="center">1<td align="center"><b>2</b><td align="center">2<td align="center"><b>12</b><td align="center"><b>12</b><td align="center"><b>18</b></tr>
<tr><td align="center">NOW<td align="center"><b>+3 ns</b><td align="center">+12 ns<td align="center"><b>+13 ns</b><td align="center"><b>+20 ns</b><td align="center"><b>+41 ns</b></tr>
</table>
<p>
<p>e. The transaction that determines the current value of the driver is marked, and all unmarked transactions are then deleted. The final driver contents are then as follows, after clearing the markings:<br><br>
<table border="1">
<tr><td align="center">1<td align="center">2<td align="center">12<td align="center">12<td align="center">18</tr>
<tr><td align="center">NOW<td align="center">+3 ns<td align="center">+13 ns<td align="center">+20 ns<td align="center">+41 ns</tr>
</table>
<p>
<p>5--No subtype check is performed on the value component of a new transaction when it is added to a driver. Instead, a subtype check that the value component of a transaction belongs to the subtype of the signal driven by the driver is made when the driver takes on that value. See <a href = "1076_12.HTM#12.6.1"> 12.6.1 </a> .
<h2><a name="8.5"> <a href = "1076_8.HTM#8.5"> 8.5 </a> Variable assignment statement</a></h2>
<p>A variable assignment statement replaces the current value of a variable with anew value specified by an expression. The named variable and the right-hand side expression must be of the same type.
<pre> variable_assignment_statement ::=
[ label : ] target := expression ;
</pre>
<p>If the target of the variable assignment statement is a name, then the name must denote a variable, and the base type of the expression on the right-hand side must be the same as the base type of the variable denoted by that name. This form of variable assignment assigns the right-hand side value to a single(scalar or composite) variable.
<p>If the target of the variable assignment statement is in the form of an aggregate, then the type of the aggregate must be determinable from the context, excluding the aggregate itself but including the fact that the type of the aggregate must be a composite type. The base type of the expression on the right-hand side must be the same as the base type of the aggregate. Furthermore, the expression in each element association of the aggregate must be a locally static name that denotes a variable. This form of variable assignment assigns each subelement or slice of the right-hand side value to the variable named as the corresponding subelement or slice of the aggregate.
<p>If the target of a variable assignment statement is in the form of an aggregate, and if the locally static name in an element association of that aggregate denotes a given variable or denotes another variable of which the given variable is a subelement or slice, then the element association is said to <i>identify</i> the given variable as a target of the assignment statement. It is an error if a given variable is identified as a target by more than one element association in such an aggregate.
<p>For the execution of a variable assignment whose target is a variable name, the variable name and the expression are first evaluated. A check is then made that the value of the expression belongs to the subtype of the variable, except in the case of a variable that is an array (in which case the assignment involves a subtype conversion). Finally, the value of the expression becomes the new value of the variable. A design is erroneous if it depends on the order of evaluation of the target and source expressions of an assignment statement.
<p>The execution of a variable assignment whose target is in the form of an aggregate proceeds in a similar fashion, except that each of the names in the aggregate is evaluated, and a subtype check is performed for each subelement or slice of the right-hand side value that corresponds to one of the names in the aggregate. The value of the subelement or slice of the right-hand side value then becomes the new value of the variable denoted by the corresponding name.
<p>An error occurs if the aforementioned subtype checks fail.
<p>The determination of the type of the target of a variable assignment statement may require determination of the type of the expression if the target is a name that can be interpreted as the name of a variable designated by the access value returned by a function call, and similarly, as an element or slice of such a variable.
<p>NOTE--If the right-hand side 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.
<h3><a name="8.5.1"> <a href = "1076_8.HTM#8.5.1"> 8.5.1 </a> Array variable assignments</a></h3>
<p>If the target of an assignment statement is a name denoting an array variable(including a slice), the value assigned to the target is implicitly converted to the subtype of the array variable; the result of this subtype conversion becomes the new value of the array variable.
<p>This means that the new value of each element of the array variable is specified by the matching element (see <a href = "1076_7.HTM#7.2.2"> 7.2.2 </a> ) in the corresponding array value obtained by evaluation of the expression. The subtype conversion checks that for each element of the array variable there is a matching element in the array value, and vice versa. An error occurs if this check fails.
<p>NOTE--The implicit subtype conversion described for assignment to an array variable is performed only for the value of the right-hand side expression as a whole; it is not performed for subelements or slices that are array values.
<h2><a name="8.6"> <a href = "1076_8.HTM#8.6"> 8.6 </a> Procedure call statement</a></h2>
<p>A procedure call invokes the execution of a procedure body.
<pre> procedure_call_statement ::= [ label : ] procedure_call ;
procedure_call ::= <i>procedure</i>_name [ ( actual_parameter_part ) ]
</pre>
<p>The procedure name specifies the procedure body to be invoked. The actual parameter part, if present, specifies the association of actual parameters with formal parameters of the procedure.
<p>For each formal parameter of a procedure, a procedure call must specify exactly one corresponding actual parameter. This actual parameter is specified either explicitly, by an association element (other than the actual <b>open</b>) in the association list or, in the absence of such an association element, by a default expression (see <a href = "1076_4.HTM#4.3.2"> 4.3.2 </a> ).
<p>Execution of a procedure call includes evaluation of the actual parameter expressions specified in the call and evaluation of the default expressions associated with formal parameters of the procedure that do not have actual parameters associated with them. In both cases, the resulting value must belong to the subtype of the associated formal parameter. (If the formal parameter is of an unconstrained array type, then the formal parameter takes on the subtype of the actual parameter.) The procedure body is executed using the actual parameter values and default expression values as the values of the corresponding formal parameters.
<h2><a name="8.7"> <a href = "1076_8.HTM#8.7"> 8.7 </a> If statement</a></h2>
<p>An if statement selects for execution one or none of the enclosed sequences of statements, depending on the value of one or more corresponding conditions.
<pre> if_statement ::=
[ <i>if</i>_label : ]
<b>if</b> condition <b>then</b>
sequence_of_statements
{ <b>elsif</b> condition <b>then</b>
sequence_of_statements }
[ <b>else</b>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -