How do I override the UVM report summary in UVM1.2 (make a custom uvm_report_server?)

Hi Everyone,

I am trying to extend the uvm_default_report_server to add some more project specific information I want to capture at the end of the test and to add a nice large pass/fail banner.

I ran the example below and didn’t get any errors, but also didn’t get a new banner with “hello world” in it.

Can you see what I am doing wrong here?

I am using UVM1.2.

thanks,

Dan

`timescale 1ns/1ns

package my_pkg;
`include “uvm_macros.svh”
import uvm_pkg::*;

class my_report_server extends uvm_default_report_server;
function void summarize(UVM_FILE file = 0);
//super.summarize();
// q.push_back(“hello world”);
$display(“hello world”);
endfunction

function void report_header(UVM_FILE file = 0);
endfunction // report_header

function new();
super.new();
`uvm_info(get_type_name(),“new report server constructed”, UVM_LOW);
endfunction // new
endclass

class my_test extends uvm_test;
uvm_component_utils(my_test) uvm_new_func

function void build_phase(uvm_phase phase);
my_report_server my_report_server_h;
super.build();
my_report_server_h = new();
uvm_report_server::set_server(my_report_server_h);
endfunction

task run_phase(uvm_phase phase);
uvm_info(get_type_name(),"starting test", UVM_LOW); phase.raise_objection(this); #10ns; set_report_max_quit_count(6); uvm_info(get_type_name(),“Quit count set to five”, UVM_LOW);
for (int loop=0;loop<20;loop++) begin
`uvm_error(get_type_name(), $sformatf(“error %0d”, loop))
#10ns;
end
phase.drop_objection(this);

endtask // run_phase
endclass // my_test

endpackage // my_pkg

module tb_top();
`include “uvm_macros.svh”
import uvm_pkg::;
import my_pkg::
;

initial begin
run_test(“my_test”);
end
endmodule // tb_top

=====================================================

UVM_ERROR uvm_error_count_report.sv(45) @ 50: uvm_test_top [my_test] error 4
UVM_ERROR uvm_error_count_report.sv(45) @ 60: uvm_test_top [my_test] error 5
UVM_INFO /auto/edatools/cadence/incisiv_14.20.008//tools.lnx86/methodology/UVM/CDNS-1.2/sv//src/base/uvm_report_catcher.svh(705) @ 60: reporter [UVM/REPORT/CATCHER]
— UVM Report catcher Summary —

Number of demoted UVM_FATAL reports : 0
Number of demoted UVM_ERROR reports : 0
Number of demoted UVM_WARNING reports: 0
Number of caught UVM_FATAL reports : 0
Number of caught UVM_ERROR reports : 0
Number of caught UVM_WARNING reports : 0

UVM_INFO /auto/edatools/cadence/incisiv_14.20.008//tools.lnx86/methodology/UVM/CDNS-1.2/sv//src/base/uvm_report_server.svh(847) @ 60: reporter [UVM/REPORT/SERVER]
— UVM Report Summary —

Quit count reached!
Quit count : 6 of 6
** Report counts by severity
UVM_INFO : 6
UVM_WARNING : 0
UVM_ERROR : 6
UVM_FATAL : 0
** Report counts by id
[RNTST] 1
[UVM/RELNOTES] 1
[UVM/REPORT/CATCHER] 1
[my_test] 8
[uvm_default_report_server] 1

Check out my solution on how to customize the uvm_report_server. It works for both UVM 1.1d and UVM 1.2.

In reply to danielashercohen:

Hi,

actually (thanks to Axel Sherer) I have a solution to make the code originally posted work.
I should have overridden report_summarize, not summarize.

If you do that then you can add a few additional fields / values to the summary which is what I wanted to do.

Kushalmodi’s solution demonstrates how to do far more modification than that if you want to go further.

Dan

In reply to kaushalmodi:

Kushalmodi,

great piece of flexible code, but i found a slight compilation bug.

From line 169, the string variable is still an integer for uvm-1.2 as well as uvm-1.1d


`ifndef UVM_1p1d
      virtual function string compose_report_message (uvm_report_message report_message,
                                                      string report_object_name = "");
         uvm_severity l_severity;
         uvm_verbosity l_verbosity;
         uvm_report_message_element_container el_container;
         uvm_report_handler l_report_handler;
         string message  = "";
         string filename = "";
         string line     = "";
         string id       = "";
`else
         virtual function string compose_message
           ( uvm_severity severity,
             string name,
             string id,
             string message,
             string filename,
             int line );
            // Do nothing
            return "";
         endfunction // compose_message

Although this has been coded for VCS it is a good start for other custom report servers. Thank you!

In reply to Phill_Ferg:

Thanks for catching that, and sorry for that super-late reply. I’ve now fixed that in my repo.