[sv-bc] Issues on anonymous program items

From: Surya Pratik Saha <spsaha_at_.....>
Date: Mon May 08 2006 - 06:30:14 PDT
Hi,
In section 16.5 of SV 1800 LRM, it is specified
"NOTE: Although identifiers declared inside an anonymous program cannot be referenced outside any program block,attempting to declare another identifier with the same name outside the anonymous program block will generate an error.This occurs because the identifier shares the same name space within the scope of the surrounding package or compila-tionunit."

Does it mean the items declared inside anonymous program can be accessible from another program only. If not, then what is the usage of those items?

Is the following case valid?

package p;
    program;
        task t1;
            int x;
        endtask
    endprogram
    program;
        task t2;
            int x;
            x = t1.x; // Is t1 accessible?
        endtask
    endprogram
endpackage
program pro;
    import p::*;
    task t3;
        int x;
        x = t1.x;// Is t1 accessible?
    endtask
endprogram

module top;
endmodule

-- 
Regards
Surya.
  Received on Mon May 8 06:30:29 2006

This archive was generated by hypermail 2.1.8 : Mon May 08 2006 - 06:31:16 PDT