$monitor etc.
Writes out a line of text whenever one or more of a specified list of nets or
registers changes value. Used in test fixtures to monitor simulated behaviour.
Syntax
$monitor(Argument,...);
$fmonitor(Mcd, Argument,...);
$monitoron; {turns monitor flag on}
$monitoroff; {turns monitor flag off}
Mcd = Expression {Integer value}
Rules
The syntax of the arguments to these system tasks and the text they write is
exactly the same as for the equivalent $display tasks.
Only one $monitor process, and any number of $fmonitor processes can be
running simultaneously.
A second or subsequent call to $monitor cancels any existing $monitor
process, and replaces it with a new $monitor process.
$monitoroff disables monitoring, $monitoron re-enables monitoring.
$monitoron produces a display immediately, based on the current $monitor
process, and whether or not a value change has taken place.
There is no $fmonitor equivalent to $monitoron and $monitoroff
The system functions $time, $stime and $realtime do not trigger a line of
display from $monitor etc. or $fmonitor etc.
Tips
Use $monitor in test fixtures for obtaining simulation results from any
compliant Verilog simulator. Tasks used to create graphical displays of
waveforms are usually simulator dependent.
Example
initial
$monitor("%t : a = %b, f = %b", $realtime, a, f);
See Also
$display, $strobe, $fopen

