User guide

24-9
SystemVerilog Testbench Constructs
end
The $monitor system task display the following:
r1 = x at 0
r1 = 10 at 10
r1 = 16 at 20
r1 = 8 at 30
r1 = 2 at 40
atoreal()
Returns a real number that is the decimal value of a string.
module m;
real r1;
string string1 = "1235/x0090";
initial
begin
r1 = string1.atoreal;
$display("r1 = 0%f",r1);
end
endmodule
The $display system task displays:
r1 = 1235.000000
itoa()
Stores the ASCII decimal representation of an integer in a string.
reg [63:0] r1 = 456;
string string1;
initial
begin
string1.itoa(123);