From 61a01048f036c40a243eb7f04b1951d486726711 Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Tue, 14 Nov 2023 14:10:51 +0100 Subject: [PATCH] Assign a correct access to a new pin Signed-off-by: Ryszard Rozak --- src/V3Task.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 966ce42fdd..c3cf4ed09e 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -1851,9 +1851,9 @@ AstNodeFTask* V3Task::taskConnectWrapNew(AstNodeFTask* taskp, const string& newn newTaskp->addStmtsp(newAssignp); } oldNewVars.emplace(portp, newPortp); - AstArg* const newArgp - = new AstArg{portp->fileline(), portp->name(), - new AstVarRef{portp->fileline(), newPortp, VAccess::READ}}; + const VAccess pinAccess = portp->isWritable() ? VAccess::WRITE : VAccess::READ; + AstArg* const newArgp = new AstArg{portp->fileline(), portp->name(), + new AstVarRef{portp->fileline(), newPortp, pinAccess}}; newCallp->addPinsp(newArgp); } // Create wrapper call to original, passing arguments, adding setting of return value