How to change name of id in Verilog parsetree

From Verific Design Automation FAQ
Revision as of 12:29, 10 February 2017 by Hoa (Talk | contribs) (Created page with "'''Q:How do I change the name of an id (VeriIdDef) in Verilog parsetree?''' Name of identifier can be changed using following steps: 1. Get the scope where identifier is dec...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Q:How do I change the name of an id (VeriIdDef) in Verilog parsetree?

Name of identifier can be changed using following steps:

1. Get the scope where identifier is declared (say 'decl_scope')

2. Remove the identifier from its declaration scope:

       decl_scope->Undeclare(id);

3. Change the name of identifier:

       id->SetName("newname");

4. Declare the identifier in decl_scope:

       decl_scope->Declare(id);