Reputation: 81
According to SystemVerilog LRM 3.1a (p.38) it is possible to pass dynamic array as an argument to tasks of functions:
task foo( string arr[] );
Is it possible to assign a default value (zero-sized array) to this argument? Somewhat like we can do with other arguments:
task foo2(int i = -1, byte z = 0);
Upvotes: 4
Views: 3923
Reputation: 81
Finally found an answer. It is possible to do C-like array init at declaration time. Looks like:
task foo ( byte bar[] = '{} );
By the way, it seems there is no mentions about this possibility in LRM.
Upvotes: 4