| 104 | } |
| 105 | |
| 106 | const UHDM::constant* resolveFromParamAssign( |
| 107 | const UHDM::VectorOfparam_assign* param_assigns, |
| 108 | std::set<std::string>& visited, const std::string_view& name) { |
| 109 | std::string s(name); |
| 110 | if (visited.find(s) != visited.end()) { |
| 111 | return nullptr; |
| 112 | } |
| 113 | visited.insert(std::string(name)); |
| 114 | for (param_assign* param : *param_assigns) { |
| 115 | const std::string_view param_name = param->Lhs()->VpiName(); |
| 116 | if (param_name == name) { |
| 117 | const any* exp = param->Rhs(); |
| 118 | if (exp) { |
| 119 | if (exp->UhdmType() == uhdmconstant) { |
| 120 | return (constant*)exp; |
| 121 | } else if (exp->UhdmType() == UHDM::uhdmref_obj) { |
| 122 | UHDM::ref_obj* ref = (UHDM::ref_obj*)exp; |
| 123 | const std::string_view ref_name = ref->VpiName(); |
| 124 | return resolveFromParamAssign(param_assigns, visited, ref_name); |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | return nullptr; |
| 130 | } |
| 131 | |
| 132 | Value* ModuleInstance::getValue(std::string_view name, |
| 133 | ExprBuilder& exprBuilder) const { |