![]() |
![]() |
The purpose of a component instantiation statement is to define a design hierarchy or build a netlist in VHDL by doing the following.
The syntax follows.
instance_name : component_name port map (
[ port_name => ] expression
{, [ port_name => ] expression } );
You can map ports to signals by named or positional notation. You can include both named and positional connections in the port map, but you must put all positional connections before any named connections.
Note: For named association, the component port names must exactly match the declared component's port names. For positional association, the actual port expressions must be in the same order as the declared component's port order.
The example below shows a component declaration (a 2-input NAND gate) followed by three equivalent component instantiation statements.
component ND2
port(A, B: in BIT; C: out BIT);
end component;
. . .
signal X, Y, Z: BIT;
. . .
U1: ND2 port map(X, Y, Z); -- positional
U2: ND2 port map(A => X, C => Z, B => Y);-- named
U3: ND2 port map(X, Y, C => Z); -- mixed
The following example shows the component instantiation statement defining a simple netlist. The three instances, U1, U2, and U3, are instantiations of the 2-input NAND gate component declared in the example of component declaration and instantiations. The resulting circuit design is shown in the figure following the example.
signal TEMP_1, TEMP2: BIT;
. . .
U1: ND2 port map(A, B, TEMP_1);
U2: ND2 port map(C, D, TEMP_2);
U3: ND2 port map(TEMP_1, TEMP_2, Z);