Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
System verilog 自定义报表服务器不工作_System Verilog_Uvm - Fatal编程技术网

System verilog 自定义报表服务器不工作

System verilog 自定义报表服务器不工作,system-verilog,uvm,System Verilog,Uvm,下面的代码不起作用 class my_report_server extends uvm_default_report_server; `uvm_object_utils(my_report_server) function new(string name="my_report_server"); super.new(); $display( "Constructing report serevr %0s",name); endfunct

下面的代码不起作用

class my_report_server extends uvm_default_report_server;
    `uvm_object_utils(my_report_server)

    function new(string name="my_report_server");
        super.new();
        $display( "Constructing report serevr %0s",name);
    endfunction : new

    virtual function string compose_message( uvm_severity severity,string    name,string id,string message,string filename,int line );

   //implemeted own code.

  endfunction 

endclass
在测试库的构建阶段

function void build_phase(uvm_phase phase)
    my_report_server srv_h = new();
    uvm_report_server::set_server(srv_h);
endfunction

我尝试了相同的代码,它从重写类打印消息。没有
uvm\u默认报告\u服务器
类。而不仅仅是
uvm\u报告服务器

以下是我的代码片段,它根据需要打印输出:

   // User report server
   class my_report_server extends uvm_report_server;
      `uvm_object_utils(my_report_server)

     function new(string name="my_report_server");
       super.new();
       $display( "Constructing report serevr %0s",name);
     endfunction : new

  // Return type is string    
   virtual function string compose_message( uvm_severity severity,string name,string id,string message,string filename,int line );

    // DEBUG MESSAGE
    $display("From Super: \n %0s",super.compose_message(severity,name,id,message,filename,line));

     //This display comes.
      $display("This is from extended class");
   endfunction 

   class test extends uvm_test;
     // ... Some stuff here...
     // Declare handle here.
     my_report_server srv_h;

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

   endclass
我想指出的一点是,您已经在build_阶段本身中声明了句柄。这可能会产生范围界定问题(尽管它可以与VCS配合使用)

另外,请注意,
compose_message
函数的返回类型是
string
。因此,必须有一些来自重写函数的输出。我添加了一条调试消息,用于打印默认格式的消息


有关uvm_report_server的更多信息,请访问课程参考链接。

您使用的是uvm1.2库吗?我正在归还一根绳子。它在操场上。UVM1.1d库。上提供了一个工作示例。对于UVM1.2,该功能为“编写报告”消息,可在上获得。