Contents Up << >>

Component instantiation statements

In a purely structural view, a design would contain only component instantiation statements. They are the main constructs for specifying structure. The section on object declarations describes how a component could be declared. The declaration simply defines the part. The instantiation is the use of an actual instance of a part in the design. The syntax of the instantiation statement is: The instantiation must have a label so that it can be matched with a specification statement. The instantiation-unit specifies the unit that is being instantiated. We describe the first alternative for the instantiation-unit, which gives the name of a component to be instantiated. The other two alternatives (entity and configuration) are described at the end of this section. The generic and port maps associate local signals with the formal port signals of the component being instantiated. The association is made with an association list the same way as was done for the procedure call statement.

With this definition, we now have defined all five of the necessary parts to define and instantiate a component. Before using a component, its interface is defined through the use of the component declaration. The instantiation statement specifies where to use the component and how to map declared signals to the formal signals of the defined interface in the component declaration. In order to model the component, the component specification statement specifies what entity and architecture should be used to model the operation of the component. The specification also specifies how to map the signals in the interface described by the component declaration to the signals in the entity interface. Finally, the entity and architecture actually describe how the component operates.

The following is a complete design file that uses component instantiations to build an adder.

The purpose of the entity/architecture/component model is to provide separate specifications of the three different concepts. However, this mechanism is often cumbersome in the general case. There are two short-cuts that allow writing simpler designs for common cases of use.

The first short-cut is called a default binding. In common cases you do not need to provide a component specification statement (see the section on component declarations), and a default one will be assumed by the compiler. The default binding can be used when the name of component is the same as the name of the entity, and the name of the ports in the component declaration are the same as the names in the entity. Thus the default binding assumes that the entity with the same name of the component is the one used to implement it, and it maps ports of the component to ports of the same name in the entity.

The second short-cut is called direct instantiation. Using direct instantiation you do not need to specify a component or a component specification. Direct instantiation is an instantiation statement which directly specifies the entity or configuration to use for the instance. This corresponds to the second and third alternatives for the instantiation-unit. The previous example can be re-written using direct instantiation as follows: