systemverilog参数传递值如何工作?
how does systemverilog argument passing value work?
现分析UVM代码如下,学习
// UVM run_phase()
task run_phase(uvm_phase phase);
forever begin
// send the item to the DUT
send_to_dut(req);
end
endtask : run_phase
task send_to_dut(uart_frame frame);
endtask : send_to_dut
但我很困惑 send_to_dut(req)
的 req 参数如何传递给 send_to_dut(uart_frame frame)
的 uart_frame frame
?很混乱。
req --> uart_frame frame
之所以有效,是因为本例中的 value 是 class handle。句柄是对 class 对象的引用。因此,您正在按值传递引用。有关详细信息,请参阅 this link
现分析UVM代码如下,学习
// UVM run_phase()
task run_phase(uvm_phase phase);
forever begin
// send the item to the DUT
send_to_dut(req);
end
endtask : run_phase
task send_to_dut(uart_frame frame);
endtask : send_to_dut
但我很困惑 send_to_dut(req)
的 req 参数如何传递给 send_to_dut(uart_frame frame)
的 uart_frame frame
?很混乱。
req --> uart_frame frame
之所以有效,是因为本例中的 value 是 class handle。句柄是对 class 对象的引用。因此,您正在按值传递引用。有关详细信息,请参阅 this link