VHDL Programming

(C. Jardin) #1
The keyword POSTPONEDis specified before the PROCESSkeyword to
specify a postponed process.

Pure and Impure Functions


Functions in VHDL87 were very restrictively defined. The input mode of
all input arguments were constant, and only input arguments were
allowed. The function could have no side effects such as modifying a value
outside the function. The only information returned from the function was
through the return value. In VHDL93 this type of function is known as a
pure function. VHDL93 also contains impure functionswhich can mod-
ify data outside their own scope. These functions must be explicitly
declared as being impure as shown here:

FILE bit_file : TEXT OPEN READ_OPEN IS “ram_data”;

IMPURE FUNCTION get_val RETURN BIT IS
VARIABLE myline : LINE;
VARIABLE result : BIT;
BEGIN
READLINE( bit_file, myline );
READ ( myline, result );
RETURN result;
END get_val;

This function is used to read a set of bits from a file. Function get_val
is declared impure so that it has access to data outside the function. The file
bit_fileis opened externally to function get_valbut since the function
is impure, access to file bit_fileis possible.
Functions in VHDL87 do not have access to data outside of the function
so this function would not work. In VHDL87 the file would have to be
declared within the function declaration section, and implicitly opened and
closed from within the function. In VHDL93 the file can be opened external
to the function and an impure functioncan access the file.

Pulse Reject


In VHDL87 there were two types of delay categories, inertial and
transport.Chapter 2,“Behavioral Modeling,”talks about the differences
between them. The VHDL87 inertial delay will reject pulses smaller than

460 Appendix D: VHDL93 Updates

Free download pdf