DUT 初始化后 UVM-RAL 登录文件
UVM-RAL logging into file after DUT initializaton
我想将所有 UVM RAL 寄存器及其字段记录到单独的文件中。用于快速调试。 RAL 是否支持任何最简单的方法。
谢谢
萨拉瓦南
一种方法是使用内置的 uvm sprint()
并将其所有输出定向到一个文件。
下面是一个关于如何做到这一点的例子,假设你的寄存器是在测试级别实现的:
class my_test extends uvm_test;
my_reg_block my_rm;
UVM_FILE my_file;
//...
function new(string name="", uvm_component parent=null);
my_file = $fopen("register_initial.txt", "w");
set_report_id_file("MY_REG", my_file);
set_report_id_action("MY_REG", UVM_LOW | UVM_DISPLAY);
endfunction
// create your register
function void print_register();
`uvm_info("MY_REG", $sformatf("%s", my_rm.sprint()), UVM_LOW)
endfunction
endclass
上面的 print_register()
函数会将 my_rm.sprint()
的输出写入文件 "register_initial.txt".
我想将所有 UVM RAL 寄存器及其字段记录到单独的文件中。用于快速调试。 RAL 是否支持任何最简单的方法。
谢谢 萨拉瓦南
一种方法是使用内置的 uvm sprint()
并将其所有输出定向到一个文件。
下面是一个关于如何做到这一点的例子,假设你的寄存器是在测试级别实现的:
class my_test extends uvm_test;
my_reg_block my_rm;
UVM_FILE my_file;
//...
function new(string name="", uvm_component parent=null);
my_file = $fopen("register_initial.txt", "w");
set_report_id_file("MY_REG", my_file);
set_report_id_action("MY_REG", UVM_LOW | UVM_DISPLAY);
endfunction
// create your register
function void print_register();
`uvm_info("MY_REG", $sformatf("%s", my_rm.sprint()), UVM_LOW)
endfunction
endclass
上面的 print_register()
函数会将 my_rm.sprint()
的输出写入文件 "register_initial.txt".