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

Method addDesignElement

src/SourceCompile/SV3_1aTreeShapeHelper.cpp:149–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void SV3_1aTreeShapeHelper::addDesignElement(antlr4::ParserRuleContext* ctx,
150 std::string_view name,
151 DesignElement::ElemType elemtype,
152 VObjectType objtype) {
153 auto [fileId, line, column, endLine, endColumn] = getFileLine(ctx, nullptr);
154 const std::string design_element =
155 StrCat(m_pf->getLibrary()->getName(), "@", name);
156 DesignElement* elem = new DesignElement(
157 registerSymbol(name), fileId, elemtype, generateDesignElemId(), line,
158 column, endLine, endColumn, InvalidNodeId);
159 elem->m_context = ctx;
160 elem->m_timeInfo =
161 m_pf->getCompilationUnit()->getTimeInfo(m_pf->getFileId(line), line);
162 elem->m_defaultNetType =
163 m_pf->getCompilationUnit()->getDefaultNetType(fileId, line);
164 m_fileContent->addDesignElement(design_element, elem);
165 m_currentElement = m_fileContent->getDesignElements().back();
166}
167
168std::tuple<PathId, uint32_t, uint16_t, uint32_t, uint16_t>
169SV3_1aTreeShapeHelper::getFileLine(antlr4::ParserRuleContext* ctx,

Callers 1

Calls 6

StrCatFunction · 0.85
getDefaultNetTypeMethod · 0.80
getNameMethod · 0.45
getLibraryMethod · 0.45
getCompilationUnitMethod · 0.45
getFileIdMethod · 0.45

Tested by

no test coverage detected