uvm設計分析——report


uvm_report實現中的類圖,如下:

      

  1)uvm_component均從uvm_report_object extend而來,其中定義了report_warning,error,info,fatal等方法接口;

  2)uvm_report_message和uvm_report_handle,是一個中介者的角色,實現調用接口和實現的分離;將report信息,

    打包成一個message的對象;並處理各種severity的override;

  3)uvm_report_server,實現該message具體的uvm_action;

  4)uvm_report_catcher,作為訪問者,在tb top對某個id,serverity,verbosity的message進行處理,catch或throw;

 

uvm_report_object中實現了report的調用接口,以及report_handle的變量;

      

    report_object和report_handle是綁定的關系,兩者是互相composite的,object_report提供給用戶的有兩

類function:

    1)info,warning等調用function,其中verbosity在report_object中是被固定住的。

        error----uvm_low;

        fatal-----uvm_none;

           info、warning----uvm_medium;

      report是否被調用,還是要根據handle中的max_verbosity信息來確認的;

    2)對handle中變量的配置;每個report_object中的handle中的信息是不同的,所以區分調用report的component是

      很有必要的,

        所以sequence,默認使用m-sequencer來調用;

        port_base使用port_component來調用;

        其他默認使用uvm_root來調用;

其他的三個function:

    1)report_header,調用uvm_root的function,打印copyright信息;(uvm-root new的時候調用)

    2)report_summary,調用report_server的function,打印統計信息;

    3)die,當UVM_COUNT計數到一定值時,調用finish;

 

uvm_report_object:最終將report打包為message的格式,並將對象傳遞給handle;

handle拿到report對象,根據自己內部的override信息,將相應的信息,更新到message中;(就是severity的override信息)

handle中最重要的兩個function:

    1)initial,在new的時候,調用,初始化severity對應的默認action,設置默認輸出file為0,STDOUT;

      初始化max_verbosity_level為UVM_MEDIUM;

      

    2)process_report_message,將message override處理后,交給server來處理;

幾個重要的變量,數組或哈希:

    1)verbosity類;id_verbosities,severity_id_verbosities;

    2)actions類,id_actions,severity_actions,severity_id_actions;

    3)override類,sev_id_override,sev_overrid;

    4)file類;

 

report_server是一個virtual class,並且定義了pure function,默認使用的都是default_server,並且是singleton實例;

default_report_server,對信息執行相應的action,只有一個最重要的function:

    process_report_message:

      1)首選拿到目前的callback pool,uvm_report_cb中變量;uvm_report_catcher的對象;

      2)對於uvm_action為uvm_log或uvm_display的message,調用compose_message,打包格式;

      3)同一調用execute_report_message 的function;

          1)自加id和severity個數;

          2)uvm_display的message,調用$display function;

          3)uvm_log的message,調用fdisplay函數,需要除去STDOUT;

          4)uvm_count的message,自加quit_counter;

          5)uvm-exit的message,調用die function;

          6)uvm-stop的message,直接調用$stop;(該action,用的比較少)

三個主要的counter和一個變量:

      1)m_quit_counter;

      2)m_severity_counter;

      3)m_id_counter;

      4)m_max_quit_count;

 

還有一個general的function,report_summarize,打印各個counter的值;先調用catcher的summary;

 

以上的class中,在實現時,都是沒有使用field_automation的,都是自己實現do_copy,do_print函數;

 

uvm_report_catcher,實現report的callback機制,uvm_pool被定義為uvm_report_cb,uvm_callback被extend為uvm_report_catcher;

核心處理函數,procee_report_catcher,提供接口catch() function來供用戶extend,

        返回action_e類型enum------caught,throw,unknow_action;

        在返回值為throw的情況下,report會繼續被server處理;

             caught的情況下,report不會繼續被server處理;

catcher提供了足夠的函數來進行message的刪選;

      1)get_client,拿到調用的report_object;

      2)get_severity,拿到message的severity;

      3)get_verbosity,拿到message verbosity信息;

      4)get_id,拿到message id值;

      5)get_action,拿到message對應的action;

      6)get_filename,get_line,拿到對應的文件以及行號;

 

      相應的函數來進行message屬性的修改;

      1)set_client,調用的report_object;

      2)set_severity,message的severity;

      3)set_verbosity,message verbosity信息;

      4)set_id,message id值;

      5)set_action,message對應的action;

在catcher的過程中,統計caught和throw的fatal,error,warning的個數,供summary調用;

 

相關的macros:

1)分別定義uvm_file和uvm_line是否打印;REPORT_DISBALE_FILE、LINE;

2)`uvm_info、warning、error、fatal;

3)`uvm_info_context、warning、error、fatal,指定了object,不使用當前的object進行調用;

4)`uvm_message_begin,end,不建議直接使用,severity,verbosity需要自己設置;

5)`uvm_message_context_begin,end,同上,區別只是顯示調用object的enable_report函數,

6)`uvm_info_begin,end,warning_begin,end,error_begin,end,fatal_begin,end,只是不需要指明severity;

7)指明obejct的info_context_begin等macros;

 

相應的使用;

1)在vcs或者ius的命令行加+UVM_VERBOSITY=***,通過uvm_root,遞歸的設置所有comp的verbosity,

      

2)在相應的comp內部直接調用相應的設置verbosity或者其他屬性的函數;

      

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM