0

Is it possible to have two flops/any other instances have the same name in the netlist?

Considering that there is no hierarchy, say I have a design of 10M instances and there exists an flop called foo, is it possible that another flop have same name 'foo'?

Hemant Bhargava
  • 3,251
  • 4
  • 24
  • 45
  • Is this a hypothetical confusion, or an attempt to understand something specific which you observe or want to achieve? As it stands, we can only guess at what you are asking. – Sean Houlihane Feb 27 '19 at 09:29
  • @SeanHoulihane, I thought it is an straight forward question that whether can we have two identifiers of same name in netlist or not, by any chance? – Hemant Bhargava Feb 27 '19 at 09:54
  • 4
    I repeat, is this a thought experiment, or a reaction to the real world. If you share your context, we can maybe see a misunderstanding. Remember, we know nothing about your experience or background. Everyone at the moment is thinking 'why does he ask this question, everyone can guess the the answer is no' – Sean Houlihane Feb 27 '19 at 11:21

3 Answers3

3

No. Within a single scope, you cannot re-use the same identifier for another purpose,

dave_59
  • 39,096
  • 3
  • 24
  • 63
1

As Dave says, no. But if you had 10M instances, you wouldn't have coded that manually, your logic synthesiser would have. And it won't output an illegal netlist.

Matthew Taylor
  • 13,365
  • 3
  • 17
  • 44
1

The only way your question makes sense is to consider one large verilog file - obviously, here there can't be more than one reg/logic with the name foo. This is fundamental to the verilog scoping rules.

If there is any iteration or local scope of any form in your design, the elaboration process will construct a form of heirarchy to handle this iteration. If you flatten the resulting netlist (by default or design), then each element will either gain an abstract unique identifier (n1, n2, n3...), or be pre/post fixed with some heirarchical information (gen_1_foo, gen_2_foo...).

After the netlist generation, it may be non-trivial to relate a specific flop to it's syntactic source in the verilog - but you brought this on yourself by the lack of heirarchy and structure in the design.

Sean Houlihane
  • 1,698
  • 16
  • 22