Package Query:: If Package P1 is imported in Package P2, and P2 is imported in module, can we access elements of package P1?

In reply to hvgbl:

You will need to export p1::* inside package p2. As per LRM:

By default, declarations imported into a package are not visible by way of subsequent imports of that package. Package export declarations allow a package to specify that imported declarations are to be made visible in subsequent imports.

So in your code, try:


package p2;
  int a = 33; // IF i redeclare int A,  then i can use in below module
  import p1::*;
  export p1::*;
 
  task f1;
    $display("B::%0d",b); 
    $display("D::%0d",d); 
  endtask 
  int c = 150; 
endpackage

HTH
Srini
www.verifworks.com