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

Method writeElabGenScope

src/DesignCompile/UhdmWriter.cpp:2252–2438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2250}
2251
2252bool UhdmWriter::writeElabGenScope(Serializer& s, ModuleInstance* instance,
2253 gen_scope* m, ExprBuilder& exprBuilder) {
2254 FileSystem* const fileSystem = FileSystem::getInstance();
2255 Netlist* netlist = instance->getNetlist();
2256 ModuleDefinition* mod =
2257 valuedcomponenti_cast<ModuleDefinition*>(instance->getDefinition());
2258 if (mod) {
2259 // Let decls
2260 if (!mod->getLetStmts().empty()) {
2261 VectorOflet_decl* decls = s.MakeLet_declVec();
2262 m->Let_decls(decls);
2263 for (auto stmt : mod->getLetStmts()) {
2264 decls->push_back((let_decl*)stmt.second->Decl());
2265 }
2266 }
2267 if (!mod->getPropertyDecls().empty()) {
2268 VectorOfproperty_decl* decls = s.MakeProperty_declVec();
2269 m->Property_decls(decls);
2270 for (auto decl : mod->getPropertyDecls()) {
2271 decl->VpiParent(m);
2272 decls->push_back(decl);
2273 }
2274 }
2275 if (!mod->getSequenceDecls().empty()) {
2276 VectorOfsequence_decl* decls = s.MakeSequence_declVec();
2277 m->Sequence_decls(decls);
2278 for (auto decl : mod->getSequenceDecls()) {
2279 decl->VpiParent(m);
2280 decls->push_back(decl);
2281 }
2282 }
2283 // Typepecs
2284 VectorOftypespec* typespecs = s.MakeTypespecVec();
2285 m->Typespecs(typespecs);
2286 writeDataTypes(mod->getDataTypeMap(), m, typespecs, s, true);
2287 writeImportedSymbols(mod, s, typespecs);
2288 // System elab tasks
2289 m->Elab_tasks((std::vector<UHDM::tf_call*>*)&mod->getElabSysCalls());
2290 if (m->Elab_tasks()) {
2291 for (auto et : *m->Elab_tasks()) {
2292 et->VpiParent(m);
2293 }
2294 }
2295 // Assertions
2296 if (mod->getAssertions()) {
2297 m->Assertions(mod->getAssertions());
2298 for (auto ps : *m->Assertions()) {
2299 ps->VpiParent(m);
2300 }
2301 }
2302 }
2303 if (netlist) {
2304 m->Nets(netlist->nets());
2305 if (netlist->nets()) {
2306 for (auto obj : *netlist->nets()) {
2307 obj->VpiParent(m);
2308 }
2309 }

Callers

nothing calls this directly

Calls 15

writeElabParametersFunction · 0.85
DeclMethod · 0.80
getAssertionsMethod · 0.80
netsMethod · 0.80
cont_assignsMethod · 0.80
process_stmtsMethod · 0.80
gen_scopesMethod · 0.80
uhdmValueMethod · 0.80
toPathMethod · 0.80
variablesMethod · 0.80
array_varsMethod · 0.80
named_eventsMethod · 0.80

Tested by

no test coverage detected