In reply to dave_59:
In reply to verif_learner:
There are many more restrictions when using pass by reference direction. The formal and actual argument types must match exactly. A fixed sized array is not the same type as a dynamic array. Another restriction your tool did not catch is you can only use pass by reference with functions/tasks that have an automatic lifetime. See this link.
Also, you are declaring your function without an explicit return type. The Verilog implicit default is 1-bit return value. Use ‘function void’
ok. So, what is the option available if I want to pass an array as an argument to a function if I do not know the size of the array. I assume this is a very common issue in verification.
For example, if I am passing a array that contains packet data to the function, most likely I will not know the size of the packet at all.