0
votes

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)

1
You are meant to show what you have tried? otherwise you will likely get down/close votes.Morgan
Can you explain what the problem is with having a "." in the path name, other than it doesn;t look nice to you?dave_59
we would like to tap few signals of DUT for monitoring in DUT, for some special cases. So it is easy to engineer just go by a instantiation name.Narasimha

1 Answers

5
votes

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.