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

Method writeInterface

src/DesignCompile/UhdmWriter.cpp:1576–1743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1574}
1575
1576void UhdmWriter::writeInterface(ModuleDefinition* mod, interface_inst* m,
1577 Serializer& s, ModPortMap& modPortMap,
1578 ModuleInstance* instance) {
1579 SignalBaseClassMap signalBaseMap;
1580 SignalMap portMap;
1581 SignalMap netMap;
1582
1583 m->VpiEndLabel(mod->getEndLabel());
1584
1585 // Let decls
1586 if (!mod->getLetStmts().empty()) {
1587 VectorOflet_decl* decls = s.MakeLet_declVec();
1588 m->Let_decls(decls);
1589 for (auto stmt : mod->getLetStmts()) {
1590 decls->push_back((let_decl*)stmt.second->Decl());
1591 }
1592 }
1593 // Gen stmts
1594 if (mod->getGenStmts()) {
1595 m->Gen_stmts(mod->getGenStmts());
1596 for (auto stmt : *mod->getGenStmts()) {
1597 stmt->VpiParent(m);
1598 }
1599 }
1600 if (!mod->getPropertyDecls().empty()) {
1601 VectorOfproperty_decl* decls = s.MakeProperty_declVec();
1602 m->Property_decls(decls);
1603 for (auto decl : mod->getPropertyDecls()) {
1604 decl->VpiParent(m);
1605 decls->push_back(decl);
1606 }
1607 }
1608 if (!mod->getSequenceDecls().empty()) {
1609 VectorOfsequence_decl* decls = s.MakeSequence_declVec();
1610 m->Sequence_decls(decls);
1611 for (auto decl : mod->getSequenceDecls()) {
1612 decl->VpiParent(m);
1613 decls->push_back(decl);
1614 }
1615 }
1616
1617 // Typepecs
1618 VectorOftypespec* typespecs = s.MakeTypespecVec();
1619 m->Typespecs(typespecs);
1620 writeDataTypes(mod->getDataTypeMap(), m, typespecs, s, true);
1621 writeImportedSymbols(mod, s, typespecs);
1622 // Ports
1623 std::vector<Signal*>& orig_ports = mod->getPorts();
1624 VectorOfport* dest_ports = s.MakePortVec();
1625 VectorOfnet* dest_nets = s.MakeNetVec();
1626 writePorts(orig_ports, m, dest_ports, dest_nets, s, modPortMap, signalBaseMap,
1627 portMap, instance);
1628 m->Ports(dest_ports);
1629 std::vector<Signal*> orig_nets = mod->getSignals();
1630 writeNets(mod, orig_nets, m, dest_nets, s, signalBaseMap, netMap, portMap,
1631 instance);
1632 m->Nets(dest_nets);
1633 // Modports

Callers

nothing calls this directly

Calls 15

DeclMethod · 0.80
getGenStmtsMethod · 0.80
populateCoreMembersMethod · 0.80
checkForLoopsMethod · 0.80
compileExpressionMethod · 0.80
ExprMethod · 0.80
getContAssignsMethod · 0.80
getAssertionsMethod · 0.80
getProcessesMethod · 0.80
getParametersMethod · 0.80
getParam_assignsMethod · 0.80
getTask_funcsMethod · 0.80

Tested by

no test coverage detected