mirror of
https://github.com/verilator/verilator.git
synced 2026-08-30 17:51:59 +02:00
AstCAwait is only ever uses in statement position, so model it as a statement. We should never ever have a coroutine that returns a value. There is no need for it in SV, nor should we rely on it for internals. Also reworks the fix for V3Life incorrectly constant propagating the beforeTrig functions (#7072). The property that upsets V3Life is that a function: 1. Is called from multiple static call sites (multiple AstCCall) 2. Reads model state directly (AstVarRef to non-locals/arguments) Such function can only be created internally after scheduling (V3Task throws an unsupported error on a non-inlined function that reads model state), so added a flag to AstCFunc to mark the dangerous ones for V3Life.
This commit is contained in:
@@ -398,6 +398,7 @@ class LifeVisitor final : public VNVisitor {
|
||||
if (!m_tracingCall && !nodep->entryPoint()) return;
|
||||
m_tracingCall = false;
|
||||
if (nodep->recursive()) setNoopt();
|
||||
if (nodep->noLife()) setNoopt();
|
||||
if (nodep->dpiImportPrototype() && !nodep->dpiPure()) {
|
||||
m_sideEffect = true; // If appears on assign RHS, don't ever delete the assignment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user