MCPcopy Create free account
hub / github.com/chipsalliance/Surelog / writeElabInterface

Method writeElabInterface

src/DesignCompile/UhdmWriter.cpp:4096–4283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4094}
4095
4096bool UhdmWriter::writeElabInterface(Serializer& s, ModuleInstance* instance,
4097 interface_inst* m,
4098 ExprBuilder& exprBuilder) {
4099 Netlist* netlist = instance->getNetlist();
4100 DesignComponent* mod = instance->getDefinition();
4101 if (mod) {
4102 // Let decls
4103 if (!mod->getLetStmts().empty()) {
4104 VectorOflet_decl* decls = s.MakeLet_declVec();
4105 m->Let_decls(decls);
4106 for (auto stmt : mod->getLetStmts()) {
4107 decls->push_back((let_decl*)stmt.second->Decl());
4108 }
4109 }
4110 if (!mod->getPropertyDecls().empty()) {
4111 VectorOfproperty_decl* decls = s.MakeProperty_declVec();
4112 m->Property_decls(decls);
4113 for (auto decl : mod->getPropertyDecls()) {
4114 decl->VpiParent(m);
4115 decls->push_back(decl);
4116 }
4117 }
4118 // Typepecs
4119 VectorOftypespec* typespecs = s.MakeTypespecVec();
4120 m->Typespecs(typespecs);
4121 writeDataTypes(mod->getDataTypeMap(), m, typespecs, s, false);
4122 writeImportedSymbols(mod, s, typespecs);
4123 // System elab tasks
4124 m->Elab_tasks((std::vector<UHDM::tf_call*>*)&mod->getElabSysCalls());
4125 if (m->Elab_tasks()) {
4126 for (auto et : *m->Elab_tasks()) {
4127 et->VpiParent(m);
4128 }
4129 }
4130 // Assertions
4131 if (mod->getAssertions()) {
4132 m->Assertions(mod->getAssertions());
4133 for (auto ps : *m->Assertions()) {
4134 ps->VpiParent(m);
4135 }
4136 }
4137 }
4138
4139 writeElabParameters(s, instance, m, exprBuilder);
4140 if (netlist) {
4141 m->Ports(netlist->ports());
4142 if (netlist->ports()) {
4143 for (auto obj : *netlist->ports()) {
4144 obj->VpiParent(m);
4145 }
4146 }
4147 m->Nets(netlist->nets());
4148 if (netlist->nets()) {
4149 for (auto obj : *netlist->nets()) {
4150 obj->VpiParent(m);
4151 }
4152 }
4153 m->Gen_scope_arrays(netlist->gen_scopes());

Callers

nothing calls this directly

Calls 15

writeElabParametersFunction · 0.85
DeclMethod · 0.80
getAssertionsMethod · 0.80
portsMethod · 0.80
netsMethod · 0.80
gen_scopesMethod · 0.80
variablesMethod · 0.80
array_varsMethod · 0.80
named_eventsMethod · 0.80
array_netsMethod · 0.80
cont_assignsMethod · 0.80
process_stmtsMethod · 0.80

Tested by

no test coverage detected