Fix wait() hang when interface with combinational logic using process calls and VIF function (#7342)

This commit is contained in:
Yilou Wang
2026-03-30 15:34:32 +01:00
committed by GitHub
parent bf453361f6
commit 04f410622b
3 changed files with 102 additions and 1 deletions
+5 -1
View File
@@ -892,7 +892,11 @@ class TimingControlVisitor final : public VNVisitor {
m_underProcedure = true;
// Workaround for killing `always` processes (doing that is pretty much UB)
// TODO: Disallow killing `always` at runtime (throw an error)
if (hasFlags(nodep, T_HAS_PROC)) addFlags(nodep, T_SUSPENDEE);
// Skip for combinational blocks; if the body has timing controls
// iterateChildren will add T_SUSPENDEE, otherwise it would spin.
if (hasFlags(nodep, T_HAS_PROC)
&& !(m_activep && m_activep->sentreep() && m_activep->sentreep()->hasCombo()))
addFlags(nodep, T_SUSPENDEE);
iterateChildren(nodep);
if (hasFlags(nodep, T_HAS_PROC)) nodep->setNeedProcess();