| 3945 | } |
| 3946 | |
| 3947 | bool UhdmWriter::writeElabModule(Serializer& s, ModuleInstance* instance, |
| 3948 | module_inst* m, ExprBuilder& exprBuilder) { |
| 3949 | Netlist* netlist = instance->getNetlist(); |
| 3950 | if (netlist == nullptr) return true; |
| 3951 | m->Ports(netlist->ports()); |
| 3952 | DesignComponent* mod = instance->getDefinition(); |
| 3953 | if (mod) { |
| 3954 | // Let decls |
| 3955 | if (!mod->getLetStmts().empty()) { |
| 3956 | VectorOflet_decl* decls = s.MakeLet_declVec(); |
| 3957 | m->Let_decls(decls); |
| 3958 | for (auto stmt : mod->getLetStmts()) { |
| 3959 | decls->push_back((let_decl*)stmt.second->Decl()); |
| 3960 | } |
| 3961 | } |
| 3962 | if (!mod->getPropertyDecls().empty()) { |
| 3963 | VectorOfproperty_decl* decls = s.MakeProperty_declVec(); |
| 3964 | m->Property_decls(decls); |
| 3965 | for (auto decl : mod->getPropertyDecls()) { |
| 3966 | decl->VpiParent(m); |
| 3967 | decls->push_back(decl); |
| 3968 | } |
| 3969 | } |
| 3970 | // Typepecs |
| 3971 | VectorOftypespec* typespecs = s.MakeTypespecVec(); |
| 3972 | m->Typespecs(typespecs); |
| 3973 | writeDataTypes(mod->getDataTypeMap(), m, typespecs, s, false); |
| 3974 | writeImportedSymbols(mod, s, typespecs); |
| 3975 | // System elab tasks |
| 3976 | m->Elab_tasks((std::vector<UHDM::tf_call*>*)&mod->getElabSysCalls()); |
| 3977 | if (m->Elab_tasks()) { |
| 3978 | for (auto et : *m->Elab_tasks()) { |
| 3979 | et->VpiParent(m); |
| 3980 | } |
| 3981 | } |
| 3982 | // Assertions |
| 3983 | if (mod->getAssertions()) { |
| 3984 | m->Assertions(mod->getAssertions()); |
| 3985 | for (auto ps : *m->Assertions()) { |
| 3986 | ps->VpiParent(m); |
| 3987 | } |
| 3988 | } |
| 3989 | } |
| 3990 | |
| 3991 | writeElabParameters(s, instance, m, exprBuilder); |
| 3992 | if (netlist) { |
| 3993 | if (netlist->ports()) { |
| 3994 | for (auto obj : *netlist->ports()) { |
| 3995 | obj->VpiParent(m); |
| 3996 | } |
| 3997 | } |
| 3998 | m->Nets(netlist->nets()); |
| 3999 | if (netlist->nets()) { |
| 4000 | for (auto obj : *netlist->nets()) { |
| 4001 | obj->VpiParent(m); |
| 4002 | } |
| 4003 | } |
| 4004 | m->Gen_scope_arrays(netlist->gen_scopes()); |
nothing calls this directly
no test coverage detected