[sv-bc] Task function identifier searching rule

From: Surya Pratik Saha <spsaha_at_.....>
Date: Fri Jan 09 2009 - 05:04:03 PST
Hi,
As per the SV 2009 draft LRM, task/function identifier has to be searched in the complete local scope first and then will go to the scope lexically above. With that algorithm, the example shown in "26.3 Referencing data in packages" is contradictory.

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

f() on line 2 binds to top.f and not to p::f since the import is after the function call reference.


If we go by the rule, function 'f' has to be searched in the complete scope of 'b', and there the import statement is found. So why it will be bound to 'top.f' is not clear to me. I did not see LRM mentioned that import statement should be considered after completing the searching of scope lexically above. Am I missing anything?
-- 
Regards
Surya

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

This archive was generated by hypermail 2.1.8 : Fri Jan 09 2009 - 05:05:34 PST