UVM中国field_automation机制中print和sprint的区别
用法的区别
`uvm_info("apb_trans", this.sprint(), UVM_LOW)
this.print
// Function: print
//
// The print method deep-prints this object's properties in a format and
// manner governed by the given printer argument; if the printer argument
// is not provided, the global <uvm_default_printer> is used. See
// <uvm_printer> for more information on printer output formatting. See also
// <uvm_line_printer>, <uvm_tree_printer>, and <uvm_table_printer> for details
// on the pre-defined printer "policies," or formatters, provided by the UVM.
//
// The print method is not virtual and must not be overloaded. To include
// custom information in the print and sprint operations, derived classes
// must override the <do_print> method and use the provided printer policy
// class to format the output.
extern function void print (uvm_printer printer=null);
// Function: sprint
//
// The sprint method works just like the
// is returned in a string rather than displayed.
sprint方法和print方法类似,除了输出返回在一个字符串中,而不是显示。
//
// The sprint method is not virtual and must not be overloaded. To include
// additional fields in the print and sprint operation, derived classes
// must override the <do_print> method and use the provided printer policy
// class to format the output. The printer policy will manage all string
// concatenations and provide the string to sprint to return to the caller.
extern function string sprint (uvm_printer printer=null);
浙公网安备 33010602011771号