1. 程式人生 > >report源碼分析——report_handle和report_server和report_catcher

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

throw 調用 message 針對 lba call file 源碼分析 function

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之間的調用:

      技術分享

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