Vic*_*sky 2 printing queue system-verilog uvm
对于使用`uvm_field_queue_int实用宏的UVM 对象,调用时 UVM 不会打印出整个队列my_object.print()
# -----------------------------------------
# Name Type Size Value
# -----------------------------------------
# my_object my_object - @443
# data_q da(integral) 16 -
# [0] integral 32 'h203f922b
# [1] integral 32 'he4b3cd56
# [2] integral 32 'hd7477801
# [3] integral 32 'h3a55c481
# [4] integral 32 'h2abf98c4
# ... ... ... ...
# [11] integral 32 'hac0d672b
# [12] integral 32 'h3ba2cb5d
# [13] integral 32 'hbe924197
# [14] integral 32 'h3cc6d490
# [15] integral 32 'h69ae79da
# -----------------------------------------
Run Code Online (Sandbox Code Playgroud)
让 UVM 打印整个队列的最佳方法是什么?
EDA Playground 上的示例代码:http : //www.edaplayground.com/x/rS
完全归功于此论坛帖子:http : //forums.accellera.org/topic/1002-uvm-print-with-array-objects/
UVMprint()接受一个uvm_printer参数。创建一个新uvm_table_printer对象( 的子对象uvm_printer),更改它的旋钮值,并将其传递给print()方法。
uvm_table_printer printer;
my_uvm_object m;
// ...
printer = new();
m = my_uvm_object::type_id::create("my_uvm_object");
printer.knobs.begin_elements = -1; // this indicates to print all
m.print(printer);
//Optionally you can specify numbers for begin/end
printer.knobs.begin_elements = 10; // prints the first 10; default: 5
printer.knobs.end_elements = 2; // also print the last 2; default: 5
m.print(printer);
Run Code Online (Sandbox Code Playgroud)
当您希望uvm_object通过覆盖该do_print()方法可以使特定可以扩展时,这很有用。
或者,如果更改是全局性的,则会在根目录下自动创建一个名为uvm_default_printer. 更改此打印机的旋钮值将使用默认值更改所有打印件的打印行为。
uvm_default_printer.knobs.begin_elements=-1; // this indicates to print all
m.print(); // will print all elements
//Optionally you can specify numbers for begin/end
uvm_default_printer.knobs.begin_elements = 2; // prints the first 2; default: 5
uvm_default_printer.knobs.end_elements = 3; // also print the last 3; default: 5
m.print(); // will print the first 2 and last 3 elements
Run Code Online (Sandbox Code Playgroud)
工作示例:http : //www.edaplayground.com/x/Ze