Monday, December 26, 2016

What is the difference between new[] and new() in system verilog?

new[] :-
 It is a data structure.It is used to allocate and initialize array elements.
 It must have only one argument which defines the array element number.
 example : bit [7:0] xyz [];
                  xyz=new[10];
new() :-
 It is used to allocate and initialize object.It can have zero or more arguments depending on requirement.
 example : transaction tx;
                  tx = new(); or tx = new(burst_type,burst_size);

No comments:

Post a Comment