In this example the entity name (\74ls163\), and one of the input ports
(\1n1\) are extended identifiers.
File Operations
One of the most welcome additions to VHDL93 is the ability to open
and close files. In VHDL87 files were declared in declarations and opened
implicitly by the elaboration process. VHDL93 adds the ability to specif-
ically open and close files. This allows one subprogram or entity to create
a file which another subprogram or entity can read. In VHDL87 the
modeler would declare a file type to define the type, and later a file decla-
ration that would ultimately open the file. This is shown here:
TYPE int_file IS FILE OF INTEGER; -- VHDL87
--
FILE infile: int_file IS IN “/doug/test/example3”;
-- VHDL87 declares
-- and opens file
In VHDL93 the file type declarations remain the same, but the modeler
has a couple of ways to actually open the file. Probably the most common
will be to call the explicit FILE_OPENprocedure as shown here:
PROCEDURE FILE_OPEN(FILE infile: int_file;
EXTERNAL_NAME : IN “/doug/test/example3”;
OPEN_KIND : IN READ_MODE);
This will open the file for reading. If the file cannot be opened for some
reason a runtime error will be generated. An alternate way to open the
file is to call a different version of the FILE_OPENprocedure as shown here:
PROCEDURE FILE_OPEN(FILE_STATUS: FILE_OPEN_STATUS;
FILE : int_file;
EXTERNAL_NAME : IN “/doug/test/example3”;
OPEN_KIND : IN READ_MODE);
This procedure returns an output parameter called FILE_STATUSthat
contains the status of the FILE_OPENprocedure call. A status value of
OPEN_OKmeans that the file is open and ready to be read. A value of
STATUS_ERRORmeans that the file object already has an external file
associated with it. A value of NAME_ERRORmeans that the external file does
not exist. A value of MODE_ERRORmeans that the external file cannot be
opened using the mode passed.
454 Appendix D: VHDL93 Updates