| 431 | } |
| 432 | |
| 433 | void decompile(ValuedComponentI* instance) { |
| 434 | FileSystem* const fileSystem = FileSystem::getInstance(); |
| 435 | if (instance) { |
| 436 | ModuleInstance* inst = valuedcomponenti_cast<ModuleInstance*>(instance); |
| 437 | if (inst) { |
| 438 | DesignComponent* component = inst->getDefinition(); |
| 439 | while (inst) { |
| 440 | std::cout << "Instance:" << inst->getFullPathName() << " " |
| 441 | << fileSystem->toPath(inst->getFileId()) << "\n"; |
| 442 | std::cout << "Mod: " << inst->getModuleName() << " " |
| 443 | << fileSystem->toPath( |
| 444 | component->getFileContents()[0]->getFileId()) |
| 445 | << "\n"; |
| 446 | |
| 447 | for (const auto& ps : inst->getMappedValues()) { |
| 448 | const std::string& name = ps.first; |
| 449 | Value* val = ps.second.first; |
| 450 | std::cout << std::string(" " + name + " = " + val->uhdmValue() + |
| 451 | "\n"); |
| 452 | } |
| 453 | for (const auto& ps : inst->getComplexValues()) { |
| 454 | const std::string& name = ps.first; |
| 455 | std::cout << std::string(" " + name + " = complex\n"); |
| 456 | } |
| 457 | if (inst->getNetlist() && inst->getNetlist()->param_assigns()) { |
| 458 | for (auto ps : *inst->getNetlist()->param_assigns()) { |
| 459 | std::cout << ps->Lhs()->VpiName() << " = " |
| 460 | << "\n"; |
| 461 | decompile((UHDM::any*)ps->Rhs()); |
| 462 | } |
| 463 | } |
| 464 | inst = inst->getParent(); |
| 465 | } |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | } // namespace SURELOG |
no test coverage detected