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

Method getComplexValue

src/Design/ModuleInstance.cpp:74–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74UHDM::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
106const UHDM::constant* resolveFromParamAssign(
107 const UHDM::VectorOfparam_assign* param_assigns,

Callers 7

evalExprMethod · 0.45
elaborateInstance_Method · 0.45
collectParams_Method · 0.45
getObjectMethod · 0.45
getValueMethod · 0.45
compileExpressionMethod · 0.45
elab_parameters_Method · 0.45

Calls 3

param_assignsMethod · 0.80
getTypeMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected