How to identify packages being imported into a module
From Verific Design Automation FAQ
Revision as of 15:47, 11 May 2017 by Hoa (Talk | contribs) (Created page with "'''Q: How do I identify packages being imported into a module?''' Code example: MapIter mi ; VeriModule *mod ; FOREACH_VERILOG_MODULE(mi, mod) { if (!mod || !mod->...")
Q: How do I identify packages being imported into a module?
Code example:
MapIter mi ; VeriModule *mod ; FOREACH_VERILOG_MODULE(mi, mod) { if (!mod || !mod->IsRootModule()) continue ; Array *mod_items = mod->GetModuleItems() ; unsigned i ; VeriModuleItem *item ; FOREACH_ARRAY_ITEM(mod_items, i, item) { if (!item || !item->IsImportDecl()) continue ; // Here item is an import declaration // item->GetPrettyPrintedString() will give you the string representation // item->Linefile() will return the linefile of the import declaration // Please check VeriImportDecl class in VeriModuleItem.h file for more details } }