Difference between revisions of "Modules with " 1", " 2", ..., suffix in their names"

From Verific Design Automation FAQ
Jump to: navigation, search
(Created page with "**** Under construction **** Static elaboration process adds the "_<number>" to the module name when: 1) Module contains hierarchical identifier(s), and 2) Hierarchical ident...")
 
Line 7: Line 7:
 
An example :
 
An example :
  
module test ;
+
  module test ;
parameter p = 12 ;
+
    parameter p = 12 ;
mod I() ;
+
    mod I() ;
xx I2() ;
+
    xx I2() ;
endmodule
+
  endmodule
  
module xx ;
+
  module xx ;
test1 test() ;
+
    test1 test() ;
endmodule
+
  endmodule
  
module test1 ;
+
  module test1 ;
parameter p = 2 ;
+
    parameter p = 2 ;
mod I3() ;
+
    mod I3() ;
endmodule
+
  endmodule
  
module mod ;
+
  module mod ;
initial $display(test.p) ; // This is hierarchical identifier
+
    initial $display(test.p) ; // This is hierarchical identifier
endmodule
+
  endmodule
  
 
Here the hierarchy is:
 
Here the hierarchy is:

Revision as of 13:53, 27 September 2022

        • Under construction ****

Static elaboration process adds the "_<number>" to the module name when: 1) Module contains hierarchical identifier(s), and 2) Hierarchical identifier(s) in that module point(s) to different objects depending on the hierarchical position of that module instance.

An example :

 module test ;
   parameter p = 12 ;
   mod I() ;
   xx I2() ;
 endmodule
 module xx ;
   test1 test() ;
 endmodule
 module test1 ;
   parameter p = 2 ;
   mod I3() ;
 endmodule
 module mod ;
   initial $display(test.p) ; // This is hierarchical identifier
 endmodule

Here the hierarchy is:

test

  |
  |    |
  mod test1
       |
       mod

So here module 'mod' is instantiated twice in the hierarchy. Now if you look at the hierarchical identifier 'test.p' inside module 'mod', it is referring to parameter 'p' inside top level module 'test' for the instance I of module mod, but hierarchical identifier is referring parameter 'p' inside module 'test1' for the instance 'I3' of module mod (Here first element of hierarchical name 'test.p' is instance name not module 'test').

So you can see that one hierarchical name can refer to different objects in the hierarchy. In this situation static elaboration creates 2 different copies of module 'mod' and their names are differentiated by adding "_<number>". Hierarchical identifier in these two modules are resolved with proper identifiers.