In my code I have a function whose ports are defined like this:
function void func(bit a, ref uvm_reg regs[$], uvm_reg_map map=null);
When I try to compile with a call to the function that looks like this:
func(a, regs);
I get this error:
Error-[IRPC] Illegal ref port connection
{path to file}
$unit, "null"
Illegal connection to the ref port 'map' of function/task
'func',formal argument should
have same type as actual argument.
If I interpret this correctly, it seems to think that map is passed by reference, which is not my intention. If an argument to a function is declared as ref, does that cause every succeeding argument to be passed by reference? If so, what’s the best way for me to not have map get passed by reference, since I still want it to be an optional argument?
Thank you.