4

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); 

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

The 3.1a LRM is really old and out of date. Take a look at the latest which is publicly available. stackoverflow.com/questions/16399064/…
Out of date compared to the SystemVerilog implementations that are out there? My impressions is that the LRM leads the implementations by a long ways and using an older LRM might actually represent what your tools are doing more accurately.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.