From f1a03447ae216f9bbab46c15d09a81b6bc8a487c Mon Sep 17 00:00:00 2001 From: alaindargelas Date: Mon, 23 Sep 2024 21:49:10 -0700 Subject: [PATCH] bits in gen scope --- templates/ExprEval.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/templates/ExprEval.cpp b/templates/ExprEval.cpp index 7987ce2f..51ef9b32 100644 --- a/templates/ExprEval.cpp +++ b/templates/ExprEval.cpp @@ -1375,6 +1375,9 @@ uint64_t ExprEval::size(const any *ts, bool &invalidValue, const any *inst, case UHDM_OBJECT_TYPE::uhdmbit_var: { bits = 1; bit_var *lts = (bit_var *)ts; + if (const ref_typespec *rt = lts->Typespec()) { + bits = size(rt->Actual_typespec(), invalidValue, inst, pexpr, full); + } ranges = lts->Ranges(); break; } @@ -1453,7 +1456,12 @@ uint64_t ExprEval::size(const any *ts, bool &invalidValue, const any *inst, } case UHDM_OBJECT_TYPE::uhdmref_obj: { ref_obj *ref = (ref_obj *)ts; - if (const any *act = ref->Actual_group()) { + const any* act = ref->Actual_group(); + if (act == nullptr) { + std::string_view name = ref->VpiName(); + act = getObject(name, inst, pexpr, muteError); + } + if (act) { bits = size(act, invalidValue, inst, pexpr, full); } else { invalidValue = true;