$strobe:
When all the events at that moment have been processed, a line of formatted text is printed at the end of the time step,
Grammar
$strobe (Argument,...);
$fstrobe (MCD, Argument,...);
MCD = Expression {integer value}
Rules
? The syntax of the variables for these system tasks and the text they write are almost the same as the $display task
? When all activities are completed when $strobe is called, $strobe Print the text, which includes all blocking and non-blocking assignments
Tips
When writing simulation results, try to use $strobe less with $display or $write This ensures that the wire mesh and registers are written stable
The value
Example
Initial
Begin
A = 0;
$display (a); //Displays 0
$strobe (a); //Displays 1 ...
A = 1; // ... Because this statement
End
$monitor
Writes a line of text when one or more of the specified network or register lists change values. This command is used to monitor the simulation behavior in a test device.
Grammar
$monitor (Argument,...);
$fmonitor (MCD, Argument,...);
$monitoron; {Turn on monitoring flag}
$monitoroff; {Turn off monitoring flag}
MCD = Expression {integer value}
Rules
? These system task variables have the same syntax as the text they write and are almost the same as the $display task.
? There is only one $monitor process, but you can run any number of $fmonitor processes at the same time.
? A second or another call to $monitor cancels any existing $monitor process and replaces it with a new $monitor process.
? $monitoroff disable monitoring, $monitoron re-enable monitoring. Based on the current $monitor process, $monitoron immediately generates a monitoring display, regardless of whether the value has changed.
? No $fmonitor equals $monitoron and $monitoroff.
? At the system function, the $stime and $realtime do not trigger the display from $monitor, etc., or $fmonitor.
$display and $write
Write formatted text to either the standard output or the emulator's log or a file
Grammar
$display (Argument,...);
$fdisplay (MCD, Argument,...);
$write (Argument,...);
$fwrite (MCD, Argument,...);
MCD = Expression {integer value}
Rules
? The only difference between $display and $write is that $display writes a newline character at the end of the text and $write does not write.
? The variable can be either a string or an expression or a blank [two adjacent commas]
? The written string may contain the format specifier, except that each string must be followed by enough expressions to provide a value (%m) for all the format expressions of the string.
? The string can contain the following escape characters
\ nthe line break
\ t tab
\ "Double quotation marks
\ \ counter Slash
\NNN the ASCII value of the octal character
The unknown and high resistance are written as follows. Note the octal and hexadecimal digits represent either 3-bit or 4-bit. For decimal
The number of unknowns and high resistances is expressed in a number.
. A lowercase x or z indicates that all bits represented by this number are unknown.
. An uppercase X or z indicates that the number represents some bit, not all bits, unknown
? If a variable list contains two contiguous commas, a space is written here.
Format specifier
? The following format specifier is allowed for the string
%b%b Binary
%o%o Octal
$d $D Decimal
%h%h Hex
%e%e%f%f%g%g Real
%c%c Character
%s%s string
%v%v binary and strength
%t%t Time
%m%m Hierarchy Instance
? %v printing strength is as follows, power supply-Su, strong-St, pull-Pu, large-La, weak-We, medium-Me, small-Sm, high-hi
%V also prints values H and L (these are x when printed with%b)
? The minimum area width value is followed by the% character (for example,%10d), and in the case of decimal digits, the preceding petty space is replaced, but the 0 in front of the other cardinality is printed. The minimum area width is 0 to indicate that the area is large enough to display the value.
? The descriptions of real numbers (%e%f and%g) are fully compatible with the format of the C programming language, for example%10.3g indicates that the smallest area width is 10 and 3 digits after the decimal point.
? Expressions written without format specifiers are written in decimal format, but some additional tasks have different default formats, such as:
$displayb, $fwriteo and $displayh write numeric expressions into binary octal and hexadecimal values, respectively, without formatting instructions.
Example
$display ("Illegal opcode%h in%m at%t",
Opcode, $realtime);
$writeh ("Register Values (hex):",
REG1,, REG2,, Reg3,, REG4, "\ n");
$strobe $monitor$display