Wednesday, April 18, 2018

Common Code for UVM TB (Plug and Play)

   bit ignore_uvm_error;
   uvm_report_server svr;
   final begin
      svr = uvm_report_server::get_server();
      if(svr.get_severity_count (UVM_FATAL) >0)begin
        $display("                    ***************                        ");
        $display("        ---------------            TEST-CASE FAILED                                     --------------");
        $display("                    ***************                        ");
      end else if((svr.get_severity_count(UVM_ERROR) > 0 ) && (!ignore_uvm_error))begin
        $display("                    ***************                        ");
        $display("        ---------------            TEST-CASE FAILED                                     --------------");
        $display("                    ***************                        ");
      end else begin
      //if((svr.get_severity_count (UVM_FATAL) +svr.get_severity_count(UVM_ERROR) == 0 )) begin
        $display("                    ***************                        ");
        $display("        ---------------            TEST-CASE PASSED                                     --------------");
        $display("                    ***************                        ");
      end
   end
   `ifdef WAVE_DUMP_EN
      initial begin
        static string dump_name = "wave_dump";
        if (!$value$plusargs("DUMP_NAME=%s", dump_name) ) begin
           dump_name = "wave_dump";
        end
        //$recordfile("wave_dump.trn");
        $recordfile(dump_name);
        $recordvars(tb_top);
      end
   `endif

   `ifdef USE_CUSTOM_REPORT_SRVR
     custom_report_server report_server;
     initial begin
       #0ns report_server = new();
     end
   `endif

   initial begin
     run_test();
   end
   initial begin
     set_global_timeout(`TEST_TIMEOUT);
   end
 endmodule

No comments:

Post a Comment

Ethernet and more

Ethernet is a protocol under IEEE 802.33 standard User Datagram Protocol (UDP) UDP is a connectionless transport protocol. I...