PackagesDeclaration
An example of a package declaration :
Note some items only require declaration while others need further detail provided in subsequent package body
- for type and subtype definitions, declaration is sufficient
- subprograms require declarations and descriptions
TYPE binary IS ( ON, OFF );
CONSTANT PI : REAL := 3.14;
CONSTANT My_ID : INTEGER;
PROCEDURE add_bits3(SIGNAL a, b, en : IN BIT;
SIGNAL temp_result, temp_carry : OUT BIT);
Notes:
This is an example of a package declaration. The package declaration lists the contents of the package. The declaration begins with the keyword PACKAGE and the name of the package followed by the keyword IS. VHDL declaration statements are then included, such as type declarations, constant declarations, and subprogram declarations. For many VHDL constructs, such as types, declarations are sufficient to fully define them. For a subprogram, however, the declaration only specifies the parameters required by the function or procedure; the operation of the subprogram appears later in the package body. The package declaration ends with END and the package name.