Technical data
ModelSim EE/PLUS Reference Manual The TextIO Package -
425
9 -
The TextIO Package
Chapter contents
Using the TextIO package . . . . . . . . . . . . . . . . 425
Syntax for file declaration . . . . . . . . . . . . . . . 426
Using STD_INPUT and STD_OUTPUT within ModelSim . . . . . . 427
TextIO implementation issues . . . . . . . . . . . . . . . 427
Writing strings and aggregates . . . . . . . . . . . . . . 427
Reading and writing hexadecimal numbers . . . . . . . . . . 428
Dangling pointers . . . . . . . . . . . . . . . . . 428
The ENDLINE function . . . . . . . . . . . . . . . 428
The ENDFILE function. . . . . . . . . . . . . . . . 429
Using alternative input/output files . . . . . . . . . . . . . 429
Providing stimulus . . . . . . . . . . . . . . . . . 429
This chapter covers the use of the TextIO package with Model
Sim
. The TextIO
package is defined within the
VHDL Language Reference Manuals, IEEE Std
1076-1987
and
IEEE Std 1076-1993
; it allows human-readable text input from a
declared source within a VHDL file during simulation.
Using the TextIO package
To access the routines in TextIO, include the following statement in your VHDL
source code:
USE std.textio.all;
A simple example using the package TextIO is:
USE std.textio.all;
ENTITY simple_textio IS
END;
ARCHITECTURE simple_behavior OF simple_textio IS
BEGIN
PROCESS
VARIABLE i: INTEGER:= 42;
VARIABLE LLL: LINE;
BEGIN
WRITE (LLL, i);
WRITELINE (OUTPUT, LLL);
WAIT;
END PROCESS;
END simple_behavior;