Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
VAMS-LRM-2-3-1.pdf
Скачиваний:
43
Добавлен:
05.06.2015
Размер:
3.73 Mб
Скачать

Accellera

 

Version 2.3.1, June 1, 2009

VERILOG-AMS

Table 9-23—Types for file descriptors

Argument

Description

"r" or "rb"

open for reading

"w" or "wb"

truncate to zero length or create for writing

"a" or "ab"

append; open for writing at end of file, or create for writing

"r+", "r+b", or "rb+"

open for update (reading and writing)

"w+", "w+b", or "wb+"

truncate or create for update

"a+", "a+b", or "ab+"

append; open or create for update at end-of-file

If a file cannot be opened (either the file does not exist and the type specified is "r", "rb", "r+", "r+b", or "rb+", or the permissions do not allow the file to be opened at that path), a zero is returned for the mcd or fd. Applications can call $ferror to determine the cause of the most recent error (see 9.5.7).

The "b" in the above types exists to distinguish binary files from text files. Many systems (such as Unix) make no distinction between binary and text files, and on these systems the "b" is ignored. However, some systems (such as machines running Windows NT) perform data mappings on certain binary values written to and read from files that are opened for text access.

The $fclose system task closes the file specified by fd or closes the file(s) specified by the multichannel descriptor mcd. No further output to or input from any file descriptor(s) closed by $fclose is allowed. The $fopen function shall reuse channels that have been closed.

NOTE—The number of simultaneous input and output channels that can be open at any one time is dependent on the operating system. Some operating systems do not support opening files for update.

9.5.1.1 opening and closing files during multiple analyses

Verilog AMS HDL supports multiple analyses during the same simulation process (see Clause 8).

If a file is opened in a write mode in the first analysis and reopened in that write mode in following analysis, then content written from the following analyses shall be appended to the content written during the previous analyses.

9.5.1.2 Sharing of file descriptors between the analog and digital contexts

The file I/O system functions and tasks in both the analog and digital contexts can use file descriptors opened in either context, if the file descriptors are opened for writing or appending.

9.5.2 File output system tasks

The syntax for $fdisplay, $fwrite, $fmonitor, $fstrobe and $fdebug system tasks is shown in Syntax 9-3.

file_open_function ::=

file_output_task_name ( fd [, list_of_arguments] ) ; file_output_task_name ::=

$fdisplay | $fwrite | $fstrobe | $fmonitor | $fdebug

Copyright © 2009 Accellera Organization, Inc.

204

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]