Components from
Packages

-- Notes Page --


This slide shows an example of the component declaration residing inside a package declaration. The package must be included in the file containing the architecture. This is done with the use of the USE statement. The USE statement can be read as follows. Use ALL components contained in the package my_stuff where the package my_stuff is contained in the library work. If the only element required from this package was and_gate, then the USE statement could have been written:

USE Work.my_stuff.and_gate

Also shown on this slide is the use of positional association. Positional association is used in the PORT MAP statement shown resulting in signals S1, S2, and S3 being mapped to in1, in2, and out1, respectively. Association by name could also be used and the statement may have been:

PORT MAP (in1 => S1, out1 => S3, in2 => S2);

Note that when using association by name, the order of the signals in the PORT MAP is not important.