Poor performance using function call within a uvm_driver class

In reply to dave_59:

dave_59:

mem_backdoor_acc(addr,data) is a function call, it changes the memory context by direct access, thus it should be really fast since it doesn’t need any cycle for processing.

here is a simplified version of mem_backdoor_acc()


function mem_backdoor_acc(integer addr, bit [31:0] data) 

   test_top.dut.ddr.mem[row,bank] = data;

endfunction

The processing speed is still slow after marking out all the context inside the mem_backdoor_acc function, so I re-written the access method by macro to solve it.


`define mem_backdoor_acc(integer addr, bit [31:0] data) \
   test_top.dut.ddr.mem[row,bank] = data; \
end