A package body defines the bodies
of subprograms and the values of deferred constants declared in the
interface to the package.
package body package_name is
subprogram bodies declarations
deferred constants declarations
end package body
The package body includes complete definitions of subprogram body
declarations as well as values of deferred constants declared in
corresponding package declarations. Other declarations (similar to
those of package declaration) are also allowed here, but are visible
only inside the package body.
The deferred constant, which has been declared in a package
declaration, may be used before its full declaration only in a
default expression for a local generic parameter, local port or
formal parameter of subprogram.
package AUXILIARY is
is array (INTEGER
range<>) of STD_LOGIC_VECTOR (0
is (SHIFT_LEFT, ADD);
(IN1 : MUX_input) return MUX_address;
package body AUXILIARY is
(IN1 : MUX_input) return MUX_address is
: Integer := 177;
end package body AUXILIARY;
First, the package is specified here and then the accompanying
package body. Note that both have the same name.
Declarations other than values of deferred constants and subprogram
bodies are not visible outside the package body and can be used only
locally, inside it.
Each package can have only one body.