verilog - Is there a function equivalent for $sformat? -


i'm writing systemverilog code , notice $sformat system task, not function. there function equivalent $sformat?

i'd following inside function:

assert(my_dto_h.a == 10) else begin   `ovm_error("component", $sformat("my_dto_h.a should 10, not %0d", my_dto_h.a)) end 

unfortunately, i'm getting the following run-time error questasim 10.2:

** error: (vsim-pli-3029) component.sv(105): expected system function, not system task '$sformat'.

yes, $sformatf

from lrm:

the system function $sformatf behaves $sformat except string result passed function result value $sformatf, not placed in first argument $sformat. $sformatf can used string value valid.

variable_format_string_output_function ::=    $sformatf ( format_string [ , list_of_arguments ] ) 

example:

string s; s = $sformatf("value = %0d", value); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -