• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

SOC/IP验证工程师

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

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 method, except the output
// 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);

posted on 2022-09-12 15:34  SOC验证工程师  阅读(1213)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3