|
In VHDL, you can use a Component Instantiation Statement to create an instance of a Quartus® II logic function. The Component Instantiation Statement also connects logic function ports to signals or interface ports of the associated entity/architecture pair. The ports of logic functions are defined with Component Declarations elsewhere in the file or in referenced packages.
|
In the following example, a Component Instantiation Statement is used to create an instance of a DFF primitive and a TRI primitive.
LIBRARY ieee; USE ieee.std_logic_1164.ALL; LIBRARY altera; USE altera.maxplus2.ALL; ENTITY compinst IS PORT ( data, clock, clearn, presetn : IN STD_LOGIC; q_out : OUT STD_LOGIC; a, b : IN STD_LOGIC; t_out : OUT STD_LOGIC ); END compinst; ARCHITECTURE a OF compinst IS BEGIN dff1 : DFF PORT MAP (d =>data, q => q_out, clk => clock, clrn => clearn, prn => presetn); tri1 : TRI PORT MAP (a, b, t_out); END a;
In this example, the library altera is declared as the resource library. The Use Clause specifies
the maxplus2
package contained in the altera library.
A single instance of the DFF primitive is created with a Component Instantiation Statement. The
values described in the Port Map Clause for each instance are mapped to the corresponding
ports in the Component Declaration for the DFF primitive in the maxplus2
package. The ports of the dff1
primitive instance are connected by name, that is, ports are mapped directly
to signals regardless of the order in which they are listed. The d
port of the dff
primitive is mapped to data
,
q
to q_out
, clk
to clock
, clrn
to clearn
, and prn
to presetn
.
A Component Instantiation Statement is also used to create a single instance of the TRI primitive. The ports in the tri1
primitive instance are associated by position: the first port (in
) in the TRI primitive is mapped to a
, the second port (oe
) to b
, and the third port (out
) to t_out
.
|
For more information, see "Section 9.6: Component Instantiation Statement" in the IEEE Std 1076-1993 IEEE Standard VHDL Language Reference Manual.
- PLDWorld - |
|
Created by chm2web html help conversion utility. |