Skip to content

Commit

Permalink
Populate missing ref_obj::actual_group & ref_obj::parent
Browse files Browse the repository at this point in the history
  • Loading branch information
hs-apotell committed Apr 24, 2023
1 parent b36e264 commit 73e0809
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/DesignCompile/CompileExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,7 @@ UHDM::any *CompileHelper::compileSelectExpression(
ref_obj *r2 = s.MakeRef_obj();
r2->VpiName(fC->SymName(Bit_select));
r2->VpiFullName(fC->SymName(Bit_select));
r2->VpiParent(path);
elems->push_back(r2);
hname.append(".").append(fC->SymName(Bit_select));
}
Expand Down Expand Up @@ -1797,6 +1798,7 @@ UHDM::any *CompileHelper::compileExpression(
NodeId Identifier = fC->Sibling(child);
ref_obj *ref = s.MakeRef_obj();
ref->VpiName(fC->SymName(Identifier));
ref->VpiParent(pexpr);
fC->populateCoreMembers(Identifier, Identifier, ref);
result = ref;
break;
Expand Down Expand Up @@ -2927,6 +2929,7 @@ UHDM::any *CompileHelper::compileExpression(
"::", fC->SymName(Class_scope_name));
ref_obj *ref = s.MakeRef_obj();
ref->VpiName(name);
ref->VpiParent(pexpr);
fC->populateCoreMembers(child, child, ref);
result = ref;
break;
Expand Down Expand Up @@ -3686,6 +3689,7 @@ UHDM::any *CompileHelper::compilePartSelectRange(
UHDM::ref_obj *ref = s.MakeRef_obj();
ref->VpiName(name);
ref->VpiDefName(name);
ref->VpiParent(pexpr);
part_select->VpiParent(ref);
}
part_select->VpiConstantSelect(true);
Expand Down Expand Up @@ -3795,6 +3799,7 @@ UHDM::any *CompileHelper::compilePartSelectRange(
UHDM::ref_obj *ref = s.MakeRef_obj();
ref->VpiName(name);
ref->VpiDefName(name);
ref->VpiParent(pexpr);
part_select->VpiParent(ref);
}
part_select->VpiConstantSelect(true);
Expand Down Expand Up @@ -4547,11 +4552,13 @@ UHDM::any *CompileHelper::compileComplexFuncCall(
elems->push_back(ref);
ref->VpiName("$root");
ref->VpiFullName("$root");
ref->VpiParent(path);
std::string name = StrCat("$root.", fC->SymName(nameId));
ref = s.MakeRef_obj();
elems->push_back(ref);
ref->VpiName(fC->SymName(nameId));
ref->VpiFullName(fC->SymName(nameId));
ref->VpiParent(path);
nameId = fC->Sibling(nameId);
while (nameId) {
if (fC->Type(nameId) == VObjectType::slStringConst) {
Expand All @@ -4560,6 +4567,7 @@ UHDM::any *CompileHelper::compileComplexFuncCall(
elems->push_back(ref);
ref->VpiName(fC->SymName(nameId));
ref->VpiFullName(fC->SymName(nameId));
ref->VpiParent(path);
} else if (fC->Type(nameId) == VObjectType::slConstant_expression) {
NodeId Constant_expresion = fC->Child(nameId);
if (Constant_expresion) {
Expand Down Expand Up @@ -4670,6 +4678,7 @@ UHDM::any *CompileHelper::compileComplexFuncCall(
nameId = fC->Child(Method);
}
r->VpiName(fC->SymName(nameId));
r->VpiParent(path);
fullName.append(".").append(fC->SymName(nameId));
elems->push_back(r);
Method = fC->Sibling(Method);
Expand Down Expand Up @@ -4992,6 +5001,7 @@ UHDM::any *CompileHelper::compileComplexFuncCall(
bit_select *select = s.MakeBit_select();
elems->push_back(select);
ref_obj *ref = s.MakeRef_obj();
ref->VpiName(tmpName);
ref->VpiParent(path);
if (!tmpName.empty()) select->VpiParent(ref);
select->VpiIndex(index);
Expand All @@ -5007,6 +5017,7 @@ UHDM::any *CompileHelper::compileComplexFuncCall(
elems->push_back(ref);
ref->VpiName(tmpName);
ref->VpiFullName(tmpName);
ref->VpiParent(path);
fC->populateCoreMembers(name, name, ref);
}
tmpName.clear();
Expand Down Expand Up @@ -5223,6 +5234,7 @@ UHDM::any *CompileHelper::compileComplexFuncCall(
ref_obj *ref = s.MakeRef_obj();
ref->VpiName(the_name);
ref->VpiFullName(the_name);
ref->VpiParent(pexpr);
result = ref;
}
return result;
Expand Down
6 changes: 4 additions & 2 deletions src/DesignCompile/CompileHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2726,11 +2726,12 @@ UHDM::atomic_stmt* CompileHelper::compileProceduralTimingControlStmt(
NodeId IntConst = fC->Child(Delay_control);
const std::string_view value = fC->SymName(IntConst);
UHDM::delay_control* dc = s.MakeDelay_control();
if (value[0] == '#')
if (value[0] == '#') {
dc->VpiDelay(value);
else {
} else {
ref_obj* ref = s.MakeRef_obj();
ref->VpiName(value);
ref->VpiParent(pstmt);
dc->Delay(ref);
}
fC->populateCoreMembers(Delay_control, Delay_control, dc);
Expand Down Expand Up @@ -3705,6 +3706,7 @@ UHDM::any* CompileHelper::compileTfCall(DesignComponent* component,
fcall->VpiName(mname);
ref_obj* prefix = s.MakeRef_obj();
prefix->VpiName(name);
prefix->VpiParent(fcall);
fC->populateCoreMembers(dollar_or_string, dollar_or_string, prefix);
fcall->Prefix(prefix);
call = fcall;
Expand Down
2 changes: 2 additions & 0 deletions src/DesignCompile/CompileType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ UHDM::any* CompileHelper::compileVariable(
std::string fullName(fC->SymName(variable));
ref_obj* obj = s.MakeRef_obj();
obj->VpiName(fullName);
obj->VpiParent(path);
elems->push_back(obj);
while (fC->Type(Packed_dimension) == VObjectType::slStringConst) {
ref_obj* obj = s.MakeRef_obj();
Expand Down Expand Up @@ -1551,6 +1552,7 @@ UHDM::typespec* CompileHelper::compileTypespec(
path->Path_elems(s.MakeAnyVec());
ref_obj* ref = s.MakeRef_obj();
ref->VpiName(typeName);
ref->VpiParent(path);
path->Path_elems()->push_back(ref);
}
if (path) {
Expand Down

0 comments on commit 73e0809

Please sign in to comment.