WRITE Command
Reports selected signal values to a file during simulation.
| Command | WRITE |
|---|---|
| Abbreviation | WR |
| Category | Output & Monitoring |
Function
The WRITE command is used to report selected signal values in a tabular format during simulation. Output is directed to a file.
Usage
The WRITE command is described in Simulation Output.
The WRITE command can be restricted to a specified interval of tests, for patterns, or time, for waveforms, with the PRANGE keyword option:
WRITE PRANGE=<prange spec>
Specifying The File Name For The WRITE File
By default, the extension of the file created by the WRITE command is wrt, and its name is the default name specified by the DEFINE FILE command. The FILE keyword can be used to explicitly specify this file's name:
WRITE FILE=<file name>
where <file name> is the name of the file to be written to.
Specifying Signals and Format
The LIST keyword is used to select signals and format the output: The command form for this selection is:
WRITE LIST=<signals and format>
where <signals and format> has the form of a <signals> specification, possibly augmented with formatting options. These options are:
- Inserting one or more blank vertical columns between signals. This is accomplished by entering an asterisk (*) for each blank column.
- Forcing a new row in the table. This is accomplished by entering a pound sign (#) at the desired point.
Commas or whitespace are optional before or after * or #.
For example:
WRITE LIST=u,v,*w**x#y
will cause the simulation output to consist of the value of signal u, followed by the value of v, followed by a blank column, followed by the value of w, followed by two blank columns, followed by the value of x. The value of signal y will be output at the first position of the next line.
The second form of the LIST keyword:
WRITE LIST:
specifies that the values of all signals be reported in "dump" format; groups of five values ordered alphabetically, according to the symbol section of the listing file.
The WRITE command's LIST keyword is "sticky"; any signal specified will continue to be reported until explicitly removed. Removing signals from the list is accomplished with the NO prefix. For example:
NO WRITE LIST=a,b
removes signals a and b from the list of reported signals. The format options "*" and "#" are not specified with the NO prefix. The command:
NO WRITE LIST:
removes all signals, thereby terminating WRITE output.
Suppressing Signal Strength
By default, a 15-character set is used to represent combined level and strength information. Optionally, output can be restricted to a 4-character set representing levels; 0, 1, X, and Z (although Z represents the combination of unknown level at floating strength). The VALUES keyword option is used to select value representation. The command:
WRITE VALUES=LEVELS
selects the 4-character representation, while the command:
WRITE VALUES=STRENGTHS
restores the 15-character default representation.
Requesting Output At Stable Points
The default WRITE operation is to output the requested simulation values each time the circuit becomes stable. The PSTEP (PS) keyword option can be used to control frequency of this output, or inhibit it. The command:
WRITE PSTEP=<integer>
changes this interval. For example:
WRITE PSTEP=5
specifies that output occur every fifth stable point.
Output based on attaining a stable state can be disabled with the NO command prefix:
NO WRITE PSTEP:
Requesting Time-Periodic Output
Output can be requested at specified time intervals using the TSTEP keyword. The command:
WRITE TSTEP=<integer>
will cause an output to occur every <integer> simulation time-units. If the time-step specification is preceded by a plus ("+") sign, output will continue regardless of circuit stability. For example:
WRITE TSTEP=+100
produces output every 100 time-units, even when the circuit state is stable.
The NO prefix can be used to disable time-periodic output:
NO WRITE TSTEP:
The BEGIN keyword option may be used to skew (offset) the first TSTEP output. This command has the form:
WRITE BEGIN=<integer>
where <integer> specifies the time offset to the first output.
To remove the offset, specify a value of 0:
WRITE BEGIN=0
Requesting Output Based On Activity
The CHANGE keyword option specifies that output be triggered by activity at monitored signals. The command form is:
WRITE CHANGE=<signals>
where <signals> is a subset of the signals currently being monitored with the WRITE command (other signals are ignored). This command specifies that output should occur whenever any of the specified signals changes state.
The command:
WRITE CHANGE:
will trigger write output when any of the monitored signals changes state.
Subsequently, the command:
NO WRITE CHANGE=<signals>
would inhibit the specified signals in <signals> from functioning as triggers, while:
NO WRITE CHANGE:
would disable all activity-based output.
Header And Tabular Format Control
SIMIC, by default, limits each output line to 80 columns. The EXPAND keyword option can be used to modify output line width. The command form:
WRITE EXPAND:
expands output line width to 132 columns, while the command form:
WRITE EXPAND=INFINITE
allows arbitrary output line width.
The HEADER keyword option controls whether the simulation header, consisting of the simulation options and signal names, be output prior to the tabular simulation values. By default, the header is enabled. The command:
NO WRITE HEADER:
disables the header output, and the command:
WRITE HEADER:
enables it.
When waveform stimuli are used, the test number field of the simulation output can be optionally suppressed with the TNUM keyword option. By default, this field is present in every record. The command:
NO WRITE TNUM:
suppresses the test field. Each output line will contain the time, followed by a colon, followed by the requested signal values.
The test field can be restored with the command:
WRITE TNUM: