Re: [sv-bc] Task function identifier searching rule

From: Surya Pratik Saha <spsaha_at_.....>
Date: Fri Jan 09 2009 - 20:15:34 PST
Hi Steven,
I did not see anything in the LRM as you have commented. So if I write 
the example in a little bit different way by putting the import before 
initial block:

package p;
function int f();
return 1;
endfunction
endpackage
module top;
int x;
if (1) begin : b
import p::*; // line 3
initial x = f(); // line 2
end
function int f();
return 1;
endfunction
endmodule

Then as per your comment, still top.f will be selected not p::f. I don't 
think it is correct. The particular simulator also selects p::f in this 
case. Also I think by "It doesn't look for imports" you want to mean 
wildcard import only, not explicit import.

Hi Brad,
my proposal is to change the text below the example in the LRM as:
"f() on line 2 binds to p::f and not to top.f though the import is after 
the function call reference."

Regards
Surya



-------- Original Message  --------
Subject: Re:[sv-bc] Task function identifier searching rule
From: Steven Sharp <sharp@cadence.com>
To: sv-bc@eda.org, spsaha@cal.interrasystems.com
Date: Saturday, January 10, 2009 1:14:51 AM
> Surya,
>
> The hierarchical search for f does not "find the import".  It doesn't
> look for imports.  It only looks for the name f.  If the name f was
> imported already by a non-hierarchical reference, then the search will
> find it.  In this case, there was no reference that required p::f to be
> imported.
>
> All the responses so far have agreed that the example is correct.  No
> change is needed.
>
> Steven Sharp
> sharp@cadence.com
>
>
>
>
>   




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Jan 9 20:16:51 2009

This archive was generated by hypermail 2.1.8 : Fri Jan 09 2009 - 20:18:25 PST