report源码分析——report_handle和report_server和report_catcher

report_handle主要实现对message的action,severity,file的设置,然后将message传递给server:

主要的function有两个:initial和process_report_message:

      

      

uvm_report_server是一个virtual class,其中定义了很多virtual function的原型,比较重要的是两个static function:

set_server和get_server:top cs上的server类型为default类型,实现了很多function的extend

      

      

uvm_default_report_server,是针对server类的具体实现:

其中最重要的三个function:process_report_message,compose_message(处理DISPLAY,LOG),

      execute_report_message(处理COUNT,EXIT,STOP):

process_report_message,主要调用uvm_report_catcher对message进行预处理,然后根据action分别调用compose_message

      和execute_report_message

       

compose_report_message,是一个virtual function,可以进行extend来自定义自己的message输出格式:

         

execute_report_message,根据action来进行具体的操作:

        

report_summary的具体实现:

      

uvm_report_catcher是一个uvm_callback的扩展类:通过uvm_register_cb(uvm_report_object,uvm_report_catcher)来注册:

uvm_report_catcher的扩展类必须实现catch function,返回CAUGHT(message不会在有后续处理),THROW(message继续处理),

      catcher function可以改变severity,id,action,verbosity等信息,还有很多function来得到具体的message,来处理。

一个典型应用:

      

      

拿到message属性的方法:

      

set属性的方法:

      

与server function之间的调用:

      

原文地址:https://www.cnblogs.com/-9-8/p/7511902.html