[sv-bc] Resolving cross module reference

From: Surya Pratik Saha <spsaha_at_.....>
Date: Mon Jan 07 2008 - 04:29:41 PST
Hi,
Please consider the following testcase.

module tb;
top top ();
endmodule

module top;
child c1 ();
target2 foo ();
endmodule

module child;
xmr x ();
target1 foo ();
endmodule

module target1;
endmodule

module target2;
parameter p = 2;
endmodule

module xmr;
initial $display ("I am %m foo.p is %d", foo.p);
endmodule

We consulted the relevant portion of the LRM (1364-2005 LRM, section 
12.6) which says that the algorithm for such upward hierarchical 
reference should be

A name of this form shall be resolved as follows:
a) Look in the current module for a module instance named 
module_instance_name. If found, this name reference shall be treated as 
a downward reference, and the item name shall be resolved in  the 
corresponding module.
b) Look in the parent module for a module instance named 
module_instance_name. If found, the item name shall be resolved from 
that instance, which is the sibling of the module containing the reference.
c) Repeat step (b), going up the hierarchy.

Please let us know what is expected of this case.

Different simulators behave differently.

-- 
Regards
Surya




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jan 7 04:31:34 2008

This archive was generated by hypermail 2.1.8 : Mon Jan 07 2008 - 04:32:11 PST