Packages provide an additional way to share different constructs. They have similar behavior to VHDL packages. Packages can contain functions, tasks, types, and enums. The syntax for a package is:
package package_name;
items
endpackage : package_name
The final package_name
is not required, but it
makes code easier to read. Packages are referenced in other modules by the import
command. Following is the syntax:
import package_name::item or *;
The import
command must include items from the
package to import or specify the whole package.