zoukankan      html  css  js  c++  java
  • 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或者其他属性的函数;

          

  • 相关阅读:
    执行脚本,且以脚本名保存log
    循环读取寄存器(QSFP-DD)并且分别保存log
    shell脚本添加脚本执行时间和当前运行次数current running time
    软件后门种植
    IPC$管道的利用与远程控制
    古典密码-维吉尼亚密码实验
    古典密码之乘法密码
    古典密码之凯撒密码
    密码破解工具Brutus
    ASPack壳脱壳实验
  • 原文地址:https://www.cnblogs.com/-9-8/p/7700685.html
Copyright © 2011-2022 走看看