其他分享
首页 > 其他分享> > 关闭axi vip的system configuration打印信息

关闭axi vip的system configuration打印信息

作者:互联网

class sys_cfg_catcher extends uvm_report_catcher;

   function new(string name="sys_cfg_catcher");
      super.new();
   endfunction

   function pattern_match(string str1, str2);
      int l1, l2;
      l1 = str1.len();
      l2 = str2.len();
      pattern_match = 0;
      if(l2 > l1) begin
         return 0;
      end
      for(int i = 0; i < l1-l2+1;i++) begin
         if(str1.substr(i, i+l2-1) == str2) begin
            return 1;
         end
      end
   endfunction

   virtual function action_e catch();
      string str;
      string scope;
      int    match;

      scope = "*a resource with meta characters in the field name has been created*"; ///< reference string for regular expression > 
      str = get_message();
      match = uvm_is_match(scope, str);

      if(match) begin
         set_verbosity(UVM_NONE); ///< Do not display the message if caught > 
         return CAUGHT;
      end

      if(get_severity()==UVM_INFO) begin
         if((pattern_match(get_message(), "System Configuration")))begin
            set_verbosity(UVM_DEBUG);
            return CAUGHT;
         end
      end

      return THROW;
   endfunction
endclass

在 env或者base test的build_phase中,按照如下设置即可

   sys_cfg_catcher catcher = new();
   /** * Add uvm_report_cb callback */
   uvm_report_cb::add(null, catcher);

 

标签:begin,catcher,end,打印信息,system,return,axi,match,string
来源: https://blog.csdn.net/zhajio/article/details/101197141