System verilog 如何在uvm中打印覆盖率报告?

System verilog 如何在uvm中打印覆盖率报告?,system-verilog,uvm,test-coverage,System Verilog,Uvm,Test Coverage,我第一次尝试功能覆盖,所以我创建了一个mem_cov.sv文件,在其中我创建了一个覆盖类,从uvm_subscriber类扩展它,并实现了write函数来采样覆盖。我试图在报告阶段打印它,但它没有被打印出来,我不确定我是否缺少打印它的内容 This is the link of the code https://www.edaplayground.com/x/3R8m 提供代码示例,这是我从uvm_subscriber类扩展而来的coverage类 class mem_c

我第一次尝试功能覆盖,所以我创建了一个mem_cov.sv文件,在其中我创建了一个覆盖类,从uvm_subscriber类扩展它,并实现了write函数来采样覆盖。我试图在报告阶段打印它,但它没有被打印出来,我不确定我是否缺少打印它的内容

 This is the link of the code
 https://www.edaplayground.com/x/3R8m
提供代码示例,这是我从uvm_subscriber类扩展而来的coverage类

         class mem_cov extends uvm_subscriber#(mem_seq_item);
        `uvm_component_utils(mem_cov)

         real cov;
         mem_seq_item tx; 
         covergroup cg;
         READ_EN:coverpoint tx.rd_en {bins bin_0_1[] ={0,1};}
         endgroup
         extern function new(string name="mem_cov",uvm_component parent);
         extern function void write( mem_seq_item t);
         extern function void extract_phase(uvm_phase phase);
         extern function void report_phase(uvm_phase phase);   
         endclass

         function mem_cov::new(string name,uvm_component parent);
         super.new(name,parent);
         cg=new();
         endfunction


         function void mem_cov::write(mem_seq_item t);
         tx=t;
         cg.sample();
         endfunction

         function void mem_cov::extract_phase(uvm_phase phase);    
         cov=cg.get_coverage();
         endfunction

         function void mem_cov::report_phase(uvm_phase phase);
         `uvm_info(get_full_name(),$sformatf("Coverage is 
         %d",cov),UVM_HIGH);
         endfunction
在我的env类中,我已将监视器分析端口连接到订阅服务器的分析导出端口,以下是来自env类的代码片段:

         function void build_phase(uvm_phase phase);
         super.build_phase(phase);
         mem_cv=  mem_cov::type_id::create("mem_cv",this);
         endfunction : build_phase


         function void connect_phase(uvm_phase phase);
       mem_agnt.monitor.item_collected_port.connect(mem_cv.analysis_export);
          endfunction : connect_phase

你的问题与保险范围无关。这与冗长有关。您正在用详细的
UVM\u HIGH
打印您的报道。模拟的详细度设置为
UVM_MEDIUM
(我认为这是默认设置)。所以,你的信息不会被打印出来。如果将详细度降低到
UVM_MEDIUM
,则会打印:

function void mem_cov::report_phase(uvm_phase phase);
    `uvm_info(get_full_name(),$sformatf("Coverage is %d",cov),UVM_MEDIUM)
endfunction
邮件的详细级别是为了打印邮件而必须设置详细级别的级别。因此,只有在详细程度为
UVM_HIGH
或更高时,才会打印级别为
UVM_HIGH
的消息。换句话说,如果希望打印消息,请将详细程度设置为较低级别



顺便说一句:宏后面不需要分号。

请在问题中发布您的ode示例。不提供链接。当然,我在这里添加了代码片段,谢谢。