Some body suggest me how to get the instantiation name without "." like "genblk1.name" if i use generate for loop for creating more module instantiations.
I want instantiation names like addr_1,addr_2 (addr my module name)
Some body suggest me how to get the instantiation name without "." like "genblk1.name" if i use generate for loop for creating more module instantiations.
I want instantiation names like addr_1,addr_2 (addr my module name)
You'll always get a "." when you instantiate modules inside generate blocks. This is because every generate block creates a new level of hierarchy. The first string is the name of the generate block, while the second is the name of the instance. The only thing you can do is control the name of the generate block:
module some_module;
endmodule // some_module
module top;
parameter a = 1;
if (a) begin : if_gen_block
some_module inst();
end
genvar i;
for (i = 0; i < 5; i++) begin : loop_gen_block
some_module inst();
end
endmodule // top
The if generate block will create "if_gen_block.inst", whereas the for gen block will create 'loop_gen_block[0].inst', 'loop_gen_block[1].inst', etc. This behavior is specified in the SystemVerilog LRM.
If you declare an object inside a generate block, ordinarily the name of that object is hierarchical, i.e., loop_gen_block[0].object, it may or may not need to be escaped, i.e., \loop_gen_block[0]
If you don't name the gen block, the compiler will. Might be genblock0, might be genblock[0]. Note that the index is only meaningful within generate; it's not an array.
For a generate loop, objects declared inside the loop must be referenced hierarchically to disambiguate them.
For an if generate, in Vivado at least, you can specify -noname_unnamed_generate to xelab, and if there's no ambiguity, an object declared in the block can be referenced without the added hierarchical level, which can be very useful.
Just my experience; don't flame me if I got something wrong.