| 112 | } |
| 113 | |
| 114 | std::string Design::reportInstanceTree() const { |
| 115 | std::string tree; |
| 116 | ModuleInstance* tmp; |
| 117 | std::queue<ModuleInstance*> queue; |
| 118 | SymbolTable* symbols = m_errors->getSymbolTable(); |
| 119 | for (auto instance : m_topLevelModuleInstances) { |
| 120 | queue.push(instance); |
| 121 | } |
| 122 | while (!queue.empty()) { |
| 123 | tmp = queue.front(); |
| 124 | queue.pop(); |
| 125 | if (tmp->getNbChildren()) { |
| 126 | for (uint32_t i = 0; i < tmp->getNbChildren(); i++) { |
| 127 | queue.push(tmp->getChildren(i)); |
| 128 | } |
| 129 | } |
| 130 | std::string def; |
| 131 | def = tmp->getModuleName(); |
| 132 | std::string undef; |
| 133 | VObjectType type = tmp->getType(); |
| 134 | if (tmp->getDefinition() == nullptr) { |
| 135 | undef = " [U]"; |
| 136 | } |
| 137 | std::string type_s; |
| 138 | Location loc(tmp->getFileId(), tmp->getLineNb(), tmp->getColumnNb(), |
| 139 | tmp->getFullPathId(symbols)); |
| 140 | if (type == VObjectType::paUdp_instantiation) { |
| 141 | type_s = "[UDP]"; |
| 142 | Error err(ErrorDefinition::ELAB_INSTANCE_PATH, loc); |
| 143 | m_errors->addError(err); |
| 144 | } else if (type == VObjectType::paModule_instantiation) { |
| 145 | type_s = "[MOD]"; |
| 146 | Error err(ErrorDefinition::ELAB_INSTANCE_PATH, loc); |
| 147 | m_errors->addError(err); |
| 148 | } else if ((type == VObjectType::paCmos_switch_instance) || |
| 149 | (type == VObjectType::paEnable_gate_instance) || |
| 150 | (type == VObjectType::paMos_switch_instance) || |
| 151 | (type == VObjectType::paN_input_gate_instance) || |
| 152 | (type == VObjectType::paN_output_gate_instance) || |
| 153 | (type == VObjectType::paPass_enable_switch_instance) || |
| 154 | (type == VObjectType::paPass_switch_instance) || |
| 155 | (type == VObjectType::paPull_gate_instance)) { |
| 156 | type_s = "[GAT]"; |
| 157 | Error err(ErrorDefinition::ELAB_INSTANCE_PATH, loc); |
| 158 | m_errors->addError(err); |
| 159 | } else if (type == VObjectType::paInterface_instantiation) { |
| 160 | type_s = "[I/F]"; |
| 161 | Error err(ErrorDefinition::ELAB_INTERFACE_INSTANCE_PATH, loc); |
| 162 | m_errors->addError(err); |
| 163 | } else if (type == VObjectType::paProgram_instantiation) { |
| 164 | type_s = "[PRG]"; |
| 165 | Error err(ErrorDefinition::ELAB_PROGRAM_INSTANCE_PATH, loc); |
| 166 | m_errors->addError(err); |
| 167 | } else if (type == VObjectType::paModule_declaration) { |
| 168 | type_s = "[TOP]"; |
| 169 | Error err(ErrorDefinition::ELAB_INSTANCE_PATH, loc); |
| 170 | m_errors->addError(err); |
| 171 | } else { |
no test coverage detected