?? 1076_1.html
字號:
<pre> entity_statement_part ::=
{ entity_statement }
entity_statement ::=
concurrent_assertion_statement
| <i>passive</i>_concurrent_procedure_call
| <i>passive</i>_process_statement
</pre>
<p>Only concurrent assertion statements, concurrent procedure call statements, or process statements may appear in the entity statement part. All such statements must be passive (see <a href = "1076_9.HTM#9.2"> 9.2 </a> ). Such statements may be used to monitor the operating conditions or characteristics of a design entity.
<pre>--An entity declaration with statements:
<b>entity</b> Latch <b>is</b>
<b></b> <b> port (Din: in Word;
</b>Dout: <b>out</b> Word;
Load: <b>in</b> Bit;
Clk: <b>in</b> Bit );
<b>constant</b> Setup: Time := 12 ns;
<b>constant</b> PulseWidth: Time := 50 ns;
<b>use</b> Work.TimingMonitors.<b>all</b>;
<b>begin</b>
<b>assert</b> Clk='1' <b>or</b> Clk'Delayed'Stable (PulseWidth);
CheckTiming (Setup, Din, Load, Clk);
<b>end</b> ;
</pre>
<p>NOTE--The entity statement part of a design entity whose corresponding architecture is decorated with the 'FOREIGN attribute is subject to special elaboration rules. See <a href = "1076_12.HTM#12.4"> 12.4 </a> .
<h2><a name="1.2"> <a href = "1076_1.HTM#1.2"> 1.2 </a> Architecture bodies</a></h2>
<p>An architecture body defines the body of a design entity. It specifies the relationships between the inputs and outputs of a design entity and may be expressed in terms of structure, dataflow, or behavior. Such specifications may be partial or complete.
<pre> architecture_body ::=
<b>architecture</b> identifier <b>of</b> <i>entity</i>_name <b>is</b>
architecture_declarative_part
<b>begin</b>
architecture_statement_part
<b>end</b> [ <b>architecture</b> ] [ <i>architecture</i>_simple_name ] ;
</pre>
<p>The identifier defines the simple name of the architecture body; this simple name distinguishes architecture bodies associated with the same entity declaration.
<p>The entity name identifies the name of the entity declaration that defines the interface of this design entity. For a given design entity, both the entity declaration and the associated architecture body must reside in the same library.
<p>If a simple name appears at the end of an architecture body, it must repeat the identifier of the architecture body.
<p>More than one architecture body may exist corresponding to a given entity declaration. Each declares a different body with the same interface; thus,each together with the entity declaration represents a different design entity with the same interface.
<p>NOTE--Two architecture bodies that are associated with different entity declarations may have the same simple name, even if both architecture bodies(and the corresponding entity declarations) reside in the same library.
<h3><a name="1.2.1"> <a href = "1076_1.HTM#1.2.1"> 1.2.1 </a> Architecture declarative part</a></h3>
<p>The architecture declarative part contains declarations of items that are available for use within the block defined by the design entity.
<pre> architecture_declarative_part ::=
{ block_declarative_item }
block_declarative_item ::=
subprogram_declaration
| subprogram_body
| type_declaration
| subtype_declaration
| constant_declaration
| signal_declaration
| <i>shared</i>_variable_declaration
| file_declaration
| alias_declaration
| component_declaration
| attribute_declaration
| attribute_specification
| configuration_specification
| disconnection_specification
| use_clause
| group_template_declaration
| group_declaration
</pre>
<p>The various kinds of declaration are described in Section 4, and the various kinds of specification are described in Section 5. The use clause, which makes externally defined names visible within the block, is described in Section 10.
<p>NOTE--The declarative part of an architecture decorated with the 'FOREIGN attribute is subject to special elaboration rules. See <a href = "1076_12.HTM#12.3"> 12.3 </a> .
<h3><a name="1.2.2"> <a href = "1076_1.HTM#1.2.2"> 1.2.2 </a> Architecture statement part</a></h3>
<p>The architecture statement part contains statements that describe the internal organization and/or operation of the block defined by the design entity.
<pre> architecture_statement_part ::=
{ concurrent_statement }
</pre>
<p>All of the statements in the architecture statement part are concurrent statements,which execute asynchronously with respect to one another. The various kinds of concurrent statements are described in Section 9.
<p><i>Examples:</i>
<pre>--A body of entity Full_Adder:
<b>architecture</b> DataFlow <b>of</b> Full_Adder <b>is</b>
<b>signal</b> A,B: Bit;
<b>begin</b>
A <= X <b>xor</b> Y;
B <= A <b>and</b> Cin;
Sum <= A <b>xor</b> Cin;
Cout <= B <b>or</b> (X <b>and</b> Y);
<b>end architecture</b> DataFlow ;
--A body of entity TestBench:
<b> library</b> Test;
<b>use</b> Test.Components.<b>all</b>;
<b>architecture</b> Structure <b>of</b> TestBench <b>is</b>
<b>component</b> Full_Adder
<b>port</b> (X, Y, Cin: Bit; Cout, Sum: <b>out</b> Bit);
<b>end</b> <b>component</b>;
<b>signal</b> A,B,C,D,E,F,G: Bit;
<b>signal</b> OK: Boolean;
<b>begin</b>
UUT: Full_Adder <b>port</b> <b>map</b> (A,B,C,D,E);
Generator: AdderTest <b>port</b> <b>map</b> (A,B,C,F,G);
Comparator: AdderCheck <b>port</b> <b>map</b> (D,E,F,G,OK);
<b>end</b> Structure;
--A body of entity AndGate:
<b>architecture</b> Behavior <b>of</b> AndGate <b>is</b>
<b>begin</b>
<b>process</b> (Inputs)
<b>variable</b> Temp: Bit;
<b>begin</b>
Temp := '1';
<b>for</b> i <b>in</b> Inputs'Range <b>loop</b>
<b>if</b> Inputs(i) = '0' <b>then</b>
Temp := '0';
<b>exit</b>;
<b>end</b> <b>if</b>;
<b>end</b> <b>loop</b>;
Result <= Temp <b>after</b> 10 ns;
<b>end</b> <b>process</b>;
<b>end</b> Behavior;
</pre>
<p>NOTE--The statement part of an architecture decorated with the 'FOREIGN attribute is subject to special elaboration rules. See <a href = "1076_12.HTM#12.4"> 12.4 </a> .
<h2><a name="1.3"> <a href = "1076_1.HTM#1.3"> 1.3 </a> Configuration declarations</a></h2>
<p>The binding of component instances to design entities is performed by configuration specifications (see <a href = "1076_5.HTM#5.2"> 5.2 </a> ); such specifications appear in the declarative part of the block in which the corresponding component instances are created. In certain cases, however, it may be appropriate to leave unspecified the binding of component instances in a given block and to defer such specification until later. A configuration declaration provides the mechanism for specifying such deferred bindings.
<pre> configuration_declaration ::=
<b> configuration</b> identifier <b>of</b> <i>entity</i>_name <b>is</b>
configuration_declarative_part
block_configuration
<b>end</b> [ <b>configuration</b> ] [ <i>configuration</i>_simple_name ] ;
configuration_declarative_part ::=
{ configuration_declarative_item }
configuration_declarative_item ::=
use_clause
| attribute_specification
| group_declaration
</pre>
<p>The entity name identifies the name of the entity declaration that defines the design entity at the apex of the design hierarchy. For a configuration of a given design entity, both the configuration declaration and the corresponding entity declaration must reside in the same library.
<p>If a simple name appears at the end of a configuration declaration, it must repeat the identifier of the configuration declaration.
<p>
<h4>NOTES</h4>
<p>1--A configuration declaration achieves its effect entirely through elaboration (see Section 12). There are no behavioral semantics associated with a configuration declaration.
<p>2--A given configuration may be used in the definition of another, more complex configuration.
<p><i>Examples:</i>
<pre>--An architecture of a microprocessor:
<b>architecture</b> Structure_View <b>of</b> Processor <b>is</b>
<b> component</b> ALU <b>port</b> ( ··· ); <b>end</b> <b>component</b>;
<b>component</b> MUX <b>port</b> ( ··· ); <b>end</b> <b>component</b>;
<b>component</b> Latch <b>port</b> ( ··· ); <b>end</b> <b>component</b>;
<b>begin</b>
A1: ALU <b>port</b> <b>map</b> ( ··· ) ;
M1: MUX <b>port</b> <b>map</b> ( ··· ) ;
M2: MUX <b>port</b> <b>map</b> ( ··· ) ;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -