[sv-ec] ref arguments - dynamic arrays elements vs class members

From: Daniel Mlynek <daniel.mlynek_at_.....>
Date: Fri Jul 03 2009 - 06:56:38 PDT
LRM strictly defines behaviour for passing dynamic array elemtns to t/f by
reference : "Elements of dynamic arrays, queues, and associative arrays that
are passed by reference may get removed from the array or the array may get
resized before the called subroutine completes."
But LRM says nothing about class members passed to tf by reference (apart
from allowing to pass them by reference) while the situation is exactly the
same they also may get out of date:
 

class C;
    int a;
endclass
 
module top;
     C c;
    taskfoo(ref int i);
        //body
        #1;
    endtask
    initial begin
        c=new;
        foo(c.a);
        c=new; //c.a pass to foo above gets out of date

        foo(c.a);
    end
endmodule

 
IMHO description cited above should be supplemented with description of
behaviour for classes.
 
DANiel

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jul 3 06:57:40 2009

This archive was generated by hypermail 2.1.8 : Fri Jul 03 2009 - 06:58:32 PDT