Skip to content

Commit 2b14998

Browse files
Merge pull request #1122 from alainmarcel/alainmarcel-patch-1
hier path binding
2 parents eaa6359 + 06d1a14 commit 2b14998

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

templates/ElaboratorListener.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,11 +1496,17 @@ void ElaboratorListener::leaveMethod_func_call(const method_func_call* object,
14961496
}
14971497

14981498
void ElaboratorListener::leaveRef_obj(const ref_obj* object, vpiHandle handle) {
1499-
// if (!((ref_obj*)object)->Actual_group()) {
1500-
if (any* res = bindAny(object->VpiName())) {
1501-
((ref_obj*)object)->Actual_group(res);
1499+
const any* actual = (any_cast<ref_obj*>(object))->Actual_group();
1500+
const any* parent = object->VpiParent();
1501+
// Last call binding happens here.
1502+
// Logic net are the default binding (When no proper binding was found).
1503+
// Hier path binding leaf node is more accurately done in the clone_tree operation
1504+
// because of variable name scope shadowing issues.
1505+
if ((!actual) || (actual && parent->UhdmType() != uhdmhier_path)) {
1506+
if (any* res = bindAny(object->VpiName())) {
1507+
((ref_obj*)object)->Actual_group(res);
1508+
}
15021509
}
1503-
//}
15041510
}
15051511

15061512
void ElaboratorListener::leaveBit_select(const bit_select* object,

0 commit comments

Comments
 (0)