Subprogram declaration
subprogram_declaration
subprogram_specification ;
Parent
- entity_declarative_part
- architecture_declarative_part
- package
- package_body
- block_declarative_part
- function_declarative_part
- procedure_declarative_part
- process_declarative_part
Further definitions
subprogram_specification
procedure designator [ ( formal_parameter_list ) ]
[ pure | impure ] function designator [ ( formal_parameter_list ) ]
return type_mark
Comment
A pure function always returns the same value when called different times with the same actual parameters. Impure functions can return different values when called several times with the same actual parameters. This is the case when for example a impure function reads in a text file, which content changes during simulation.
Examples
Simple declaration of the procedure thank_you without transfer values
PROCEDURE thank_you ;
Declaration of the procedure test with the transfer value A .
PROCEDURE test( A : Bit ) ;
Declaration of the function convert with the transfer value B and the result type fuzzy_bit .
FUNCTION convert( B : Bit ) RETURN fuzzy_bit ;
Declaration of the procedure regist with the signals D , CK and Q being transferred.
PROCEDURE regist( SIGNAL D : IN Bit; SIGNAL CK : IN Bit; SIGNAL Q : OUT Bit ) ;
Declaration of the procedure p with the variable COL and the constant C being transferred.
PROCEDURE p( VARIABLE COL : INOUT color; CONSTANT C : IN choice ) ;