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

Method bindDataTypes_

src/DesignCompile/TestbenchElaboration.cpp:328–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328bool TestbenchElaboration::bindDataTypes_() {
329 Compiler* compiler = m_compileDesign->getCompiler();
330 Design* design = compiler->getDesign();
331 ClassNameClassDefinitionMultiMap classes = design->getClassDefinitions();
332
333 // Bind data types
334 for (const auto& [className, classDefinition] : classes) {
335 for (auto& datatype : classDefinition->getUsedDataTypeMap()) {
336 std::string dataTypeName = datatype.first;
337 DataType* dtype = datatype.second;
338 if (dtype->getDefinition()) continue;
339 VObjectType type = dtype->getType();
340 if (type == VObjectType::slStringConst ||
341 type == VObjectType::paNull_rule ||
342 type == VObjectType::paClass_scope) {
343 const DataType* the_def = bindDataType_(
344 dataTypeName, dtype->getFileContent(), dtype->getNodeId(),
345 classDefinition, ErrorDefinition::COMP_UNDEFINED_TYPE);
346 if (the_def != dtype) dtype->setDefinition(the_def);
347 }
348 }
349 for (auto& func : classDefinition->getFunctionMap()) {
350 for (auto& datatype : func.second->getUsedDataTypeMap()) {
351 std::string dataTypeName = datatype.first;
352 DataType* dtype = datatype.second;
353 if (dtype->getDefinition()) continue;
354 VObjectType type = dtype->getType();
355 if (type == VObjectType::slStringConst ||
356 type == VObjectType::paNull_rule ||
357 type == VObjectType::paClass_scope) {
358 const DataType* the_def = bindDataType_(
359 dataTypeName, dtype->getFileContent(), dtype->getNodeId(),
360 classDefinition, ErrorDefinition::COMP_UNDEFINED_TYPE);
361 if (the_def != dtype) dtype->setDefinition(the_def);
362 }
363 }
364 }
365 }
366 return true;
367}
368
369bool TestbenchElaboration::bindFunctions_() {
370 bindFunctionReturnTypesAndParamaters_();

Callers

nothing calls this directly

Calls 7

getDesignMethod · 0.80
setDefinitionMethod · 0.80
getCompilerMethod · 0.45
getDefinitionMethod · 0.45
getTypeMethod · 0.45
getFileContentMethod · 0.45
getNodeIdMethod · 0.45

Tested by

no test coverage detected