Refine dynamic NBA condition (#4773)

Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
Krzysztof Bieganski
2023-12-20 18:12:17 +01:00
committed by GitHub
parent 69b779b4a8
commit 016e630ecf
3 changed files with 42 additions and 1 deletions
+3 -1
View File
@@ -414,7 +414,9 @@ class DynScopeVisitor final : public VNVisitor {
void visit(AstAssignDly* nodep) override {
if (m_procp && !nodep->user2() // Unhandled AssignDly in function/task
&& nodep->lhsp()->exists( // And writes to a local variable
[](AstVarRef* refp) { return refp->varp()->isFuncLocal(); })) {
[](AstVarRef* refp) {
return refp->access().isWriteOrRW() && refp->varp()->isFuncLocal();
})) {
nodep->user2(true);
// Put it in a fork to prevent lifetime issues with the local
AstFork* const forkp = new AstFork{nodep->fileline(), "", nullptr};