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

Method collectInterfaceObjects_

src/DesignCompile/CompileModule.cpp:1026–1526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024}
1025
1026bool CompileModule::collectInterfaceObjects_(CollectType collectType) {
1027 std::vector<VObjectType> stopPoints = {
1028 VObjectType::paConditional_generate_construct,
1029 VObjectType::paGenerate_module_conditional_statement,
1030 VObjectType::paGenerate_interface_conditional_statement,
1031 VObjectType::paLoop_generate_construct,
1032 VObjectType::paGenerate_module_loop_statement,
1033 VObjectType::paGenerate_interface_loop_statement,
1034 VObjectType::paPar_block,
1035 VObjectType::paSeq_block,
1036 VObjectType::paModule_declaration,
1037 VObjectType::paInterface_declaration,
1038 VObjectType::paClass_declaration,
1039 VObjectType::paFunction_body_declaration,
1040 VObjectType::paTask_body_declaration};
1041 if (collectType == CollectType::GENERATE_REGIONS) {
1042 if (m_instance != nullptr) {
1043 stopPoints.push_back(VObjectType::paGenerate_region);
1044 }
1045 } else {
1046 stopPoints.push_back(VObjectType::paGenerate_region);
1047 }
1048 for (uint32_t i = 0; i < m_module->m_fileContents.size(); i++) {
1049 const FileContent* fC = m_module->m_fileContents[i];
1050 VObject current = fC->Object(m_module->m_nodeIds[i]);
1051 NodeId id = current.m_child;
1052 if (!id) id = current.m_sibling;
1053 if (!id) return false;
1054
1055 if (collectType == CollectType::FUNCTION) {
1056 // Package imports
1057 std::vector<FileCNodeId> pack_imports;
1058 // - Local file imports
1059 for (auto import : fC->getObjects(VObjectType::paPackage_import_item)) {
1060 pack_imports.push_back(import);
1061 }
1062
1063 for (auto pack_import : pack_imports) {
1064 const FileContent* pack_fC = pack_import.fC;
1065 NodeId pack_id = pack_import.nodeId;
1066 m_helper.importPackage(m_module, m_design, pack_fC, pack_id,
1067 m_compileDesign);
1068 }
1069 }
1070 NodeId ParameterPortListId;
1071 std::stack<NodeId> stack;
1072 stack.push(id);
1073 VObjectType port_direction = VObjectType::slNoType;
1074 NodeId startId = id;
1075 while (!stack.empty()) {
1076 id = stack.top();
1077 if (ParameterPortListId && (id == ParameterPortListId)) {
1078 ParameterPortListId = InvalidNodeId;
1079 }
1080 stack.pop();
1081 current = fC->Object(id);
1082 VObjectType type = fC->Type(id);
1083 bool skipChildren = false;

Callers

nothing calls this directly

Calls 15

ObjectMethod · 0.80
importPackageMethod · 0.80
compileNetDeclarationMethod · 0.80
compileAttributesMethod · 0.80
getContAssignsMethod · 0.80
setContAssignsMethod · 0.80
compileAlwaysBlockMethod · 0.80

Tested by

no test coverage detected