Modules with " 1", " 2", ..., suffix in their names
- 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.