關閉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);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章