Skip to content

Commit

Permalink
Correct assign_stmt to assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Nov 9, 2023
1 parent 34fdf0d commit 20f0ff8
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/DesignCompile/CompileStmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ VectorOfany* CompileHelper::compileStmt(DesignComponent* component,
assignment* assign = (assignment*)cstmt;
if (assign->Rhs() == nullptr) {
isDecl = true;
if (assign->Lhs())
((variables*)assign->Lhs())->VpiParent(stmt);
if (assign->Lhs()) ((variables*)assign->Lhs())->VpiParent(stmt);
}
} else if (cstmt->UhdmType() == uhdmsequence_decl) {
VectorOfsequence_decl* decls = scope->Sequence_decls();
Expand Down Expand Up @@ -2069,7 +2068,8 @@ bool CompileHelper::compileTask(DesignComponent* component,
}
if (param_assign* pst = any_cast<param_assign*>(st))
param_assigns->push_back(pst);
} if (stmt_type == uhdmassignment) {
}
if (stmt_type == uhdmassignment) {
assignment* stmt = (assignment*)st;
if (stmt->Rhs() == nullptr ||
any_cast<variables*>((expr*)stmt->Lhs())) {
Expand All @@ -2079,8 +2079,7 @@ bool CompileHelper::compileTask(DesignComponent* component,
task->Variables(s.MakeVariablesVec());
vars = task->Variables();
}
if (stmt->Lhs())
vars->push_back((variables*)stmt->Lhs());
if (stmt->Lhs()) vars->push_back((variables*)stmt->Lhs());
if (stmt->Rhs() != nullptr) {
stmts->push_back(st);
} else {
Expand Down Expand Up @@ -2127,13 +2126,12 @@ bool CompileHelper::compileTask(DesignComponent* component,
task->Variables(s.MakeVariablesVec());
vars = task->Variables();
}
if (stmt->Lhs())
vars->push_back((variables*)stmt->Lhs());
if (stmt->Lhs()) vars->push_back((variables*)stmt->Lhs());
if (stmt->Rhs() != nullptr) {
task->Stmt(st);
} else {
if (variables* var = any_cast<variables*>((expr*)stmt->Lhs()))
var->VpiParent(task);
var->VpiParent(task);
// s.Erase(stmt);
}
} else {
Expand Down Expand Up @@ -2500,14 +2498,13 @@ bool CompileHelper::compileFunction(DesignComponent* component,
func->Variables(s.MakeVariablesVec());
vars = func->Variables();
}
if (stmt->Lhs())
vars->push_back((variables*)stmt->Lhs());
if (stmt->Lhs()) vars->push_back((variables*)stmt->Lhs());
if (stmt->Rhs() != nullptr) {
stmts->push_back(st);
} else {
if (variables* var = any_cast<variables*>((expr*)stmt->Lhs()))
var->VpiParent(begin);
//s.Erase(stmt);
// s.Erase(stmt);
}
} else {
stmts->push_back(st);
Expand Down Expand Up @@ -2548,8 +2545,7 @@ bool CompileHelper::compileFunction(DesignComponent* component,
func->Variables(s.MakeVariablesVec());
vars = func->Variables();
}
if (stmt->Lhs())
vars->push_back((variables*)stmt->Lhs());
if (stmt->Lhs()) vars->push_back((variables*)stmt->Lhs());
if (stmt->Rhs() != nullptr) {
func->Stmt(st);
} else {
Expand Down

0 comments on commit 20f0ff8

Please sign in to comment.