The monitor statements

The monitor statement can be used to cause a write statement to be executed following every "go" statement. It is assumed that the output caused by a monitor statement will be formatted by a post processing program of the user's choice. The monitor statement is executable, so monitoring can be turned on or off at various points in the simulation. An example of a monitor statement is given below.

monitor 0,xyz,outputa

Windows Format:

monitor @FileName,xyz,outputa

Or:

monitor |DLLName,xyz,outputa

In the second format, the first character is the vertical mark, the shift of the back-slash.

When monitoring is active, all monitor statements for a particular file number will be gathered into a single "write" statement that is executed after each go statement. The file to which monitoring is directed will contain one line of output per go statement, regardless of how many monitor statements have been used to specify the variables or nets to be monitored. Furthermore, every time a monitor statement is executed, a list of variable names is written to the specified file. This list of names identifies all variables that are currently being monitored on the file, and the order in which their values appear. The variable names have two leading characters prepended to specify the format of the monitored value. The first character is an x or a blank to specify whether the monitored value is printed with or without a name respectively. The second character is a d or a blank to specify whether the value is printed in decimal or hexadecimal respectively. The name will be followed by a comma which will in turn be followed by an integer that specifies the width of the variable being monitored. This number may vary for signals, it will be 32 for all variables defined in the driver description. A comma separates the following variable name from the width of the previous variable. These lines allow a post processing program to determine the names of the variables or nets being monitored, their formats, and their positions in the output. The lines containing variable names will begin with the characters "T," (the capital letter T followed by a comma) to distinguish them from lines containing data. Similarly, the lines containing data will begin with the characters "D,", the capital letter D followed by a comma. Any messages that are written to a monitor file will begin with an asterisk ("*") to distinguish them from data lines.

The monitord statement can be used to cause a "writed" statement to be executed after every go instead of a "write" statement. Similarly, the monitorx and monitorxd statements can be used to cause writex and writexd statements to be executed. Only one line of output will be produced per go statement per file, regardless of whether mixed types of monitor statements have been used to initiate output. Execution of monitord, monitorx, and monitorxd statements also causes the line containing the variable names to be output.

The demonitor statement can be used to turn off the monitoring of a variable or a net. The following statement causes monitoring to be turned off for the net outputb, and the variable xyz.

demonitor xyz,outputb

The demonitor statement will cause lists of variable names to be written to any affected file, making the new monitoring status available to a post-processing program.

If a monitor monitorx, monitord, or monitorxd statement is executed for a variable or net that is already being monitored, the variable or net is automatically demonitored before the monitor statement is executed. A variable or net can be monitored to at most one file at a time.