| 72 | } |
| 73 | |
| 74 | UHDM::expr* ModuleInstance::getComplexValue(std::string_view name) const { |
| 75 | ModuleInstance* instance = (ModuleInstance*)this; |
| 76 | while (instance) { |
| 77 | UHDM::expr* res = ValuedComponentI::getComplexValue(name); |
| 78 | if (res) { |
| 79 | return res; |
| 80 | } |
| 81 | |
| 82 | if (instance->m_netlist) { |
| 83 | UHDM::VectorOfparam_assign* param_assigns = |
| 84 | instance->m_netlist->param_assigns(); |
| 85 | if (param_assigns) { |
| 86 | for (param_assign* param : *param_assigns) { |
| 87 | if (param && param->Lhs()) { |
| 88 | const std::string_view param_name = param->Lhs()->VpiName(); |
| 89 | if (param_name == name) { |
| 90 | const any* exp = param->Rhs(); |
| 91 | if (exp) return (UHDM::expr*)exp; |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | if (instance->getType() != VObjectType::paModule_instantiation) |
| 99 | instance = instance->getParent(); |
| 100 | else |
| 101 | instance = nullptr; |
| 102 | } |
| 103 | return nullptr; |
| 104 | } |
| 105 | |
| 106 | const UHDM::constant* resolveFromParamAssign( |
| 107 | const UHDM::VectorOfparam_assign* param_assigns, |
no test coverage detected