the "%s:%0d: Randomization passed " ends that string and then you have a %s"" following? Notice the second %s is not pink.
If you wanted double-quotes around the %s then you need to escape them, which I'm not sure if it works when you are already making the `define multi-line with escaped line ends. I'm sort of surprised you didn't get a warning or error when compiling with that display line.
if i use r as like shown `"r`" . what it represents, and the result of this looks big.
`define SV_RAND_CHECK(r) \
do begin \
if ((r)) begin \
$display("%s:%0d: Randomization passed "%h"", \
`__FILE__, `__LINE__, `"r`"); \
end \
end while (0)
What do you want to have printed? Do you want the result returned from the call to p.randomize()? This is what you had asked for in the OP. ("but it is supposed to display a true value.") But your last post seems like you want the string representation of what was called. This seems more reasonable; then you want:
Code:
`define SV_RAND_CHECK(r) \
begin \
if ((r)) begin \
$display("%s:%0d: Randomization passed "%s"", \
`__FILE__, `__LINE__, `"r`"); \
end \
end