如何转储UVM TB类图?

时间:2016-09-29 23:46:55

标签: system-verilog uvm

是否可以转储UVM(或SV)TB类/对象层次结构图?

它可以帮助您轻松浏览代码并查看TB。

提前致谢:)

3 个答案:

答案 0 :(得分:1)

我不确定是否可以动态地将其转储到波形中(这可能需要模拟器支持)。但是,如果您只想打印您创建的整个UVM验证环境,请在uvm_top.print_topology()处致电end_of_elaboration_phase

class your_test extends uvm_test;
  //...
  virtual function void end_of_elaboration_phase(uvm_phase phase);
    uvm_top.print_topology();
  endfunction
endclass

答案 1 :(得分:1)

答案 2 :(得分:1)

如果您要打印整个拓扑,请在基础测试中创建一个uvm_table_printer,然后在end_of_elaboration_phase中使用它以表格格式打印您的类层次

class my_test extends uvm_test

uvm_table_printer m_printer;
// .... All other class variables

virtual function void build_phase(uvm_phase phase);
  super.build_phase(phase);
  m_printer = new();
  // Rest of your build phase
endfunction

virtual function void end_of_elaboration_phase(uvm_phase phase);
   `uvm_info(get_full_name(), "Printing test topology", UVM_NONE)
    uvm_top.print_topology(m_printer);
endfunction

endclass;

这将以可读的表格格式打印您的整个类heirarchy。请注意,它不打印端口之间的连接,但