mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 18:42:58 +02:00
Fix access types of refs and inouts (#8380)
This commit is contained in:
+5
-5
@@ -1002,7 +1002,7 @@ class TaskVisitor final : public VNVisitor {
|
||||
vscp->varp()->protect(false);
|
||||
portp->protect(false);
|
||||
// Add argument to call
|
||||
const VAccess access = portp->isWritable() ? VAccess::WRITE : VAccess::READ;
|
||||
const VAccess access = portp->direction().pinAccess();
|
||||
callp->add(", ");
|
||||
callp->add(new AstVarRef{portp->fileline(), vscp, access});
|
||||
return vscp;
|
||||
@@ -2212,7 +2212,7 @@ AstNodeFTask* V3Task::taskConnectWrapNew(AstNodeFTask* taskp, const string& newn
|
||||
} else { // Defaulting arg
|
||||
AstNodeExpr* const valuep = VN_AS(portp->valuep(), NodeExpr);
|
||||
if ((portp->isRef() || portp->isConstRef()) && VN_IS(valuep, VarRef)) {
|
||||
const VAccess refAccess = portp->isWritable() ? VAccess::WRITE : VAccess::READ;
|
||||
const VAccess refAccess = portp->direction().pinAccess();
|
||||
AstVarRef* const refp = VN_AS(valuep->cloneTree(false), VarRef);
|
||||
refp->access(refAccess);
|
||||
AstArg* const newArgp = new AstArg{portp->fileline(), portp->name(), refp};
|
||||
@@ -2235,9 +2235,9 @@ AstNodeFTask* V3Task::taskConnectWrapNew(AstNodeFTask* taskp, const string& newn
|
||||
}
|
||||
}
|
||||
oldNewVars.emplace(portp, newPortp);
|
||||
const VAccess pinAccess = portp->isWritable() ? VAccess::WRITE : VAccess::READ;
|
||||
AstArg* const newArgp = new AstArg{portp->fileline(), portp->name(),
|
||||
new AstVarRef{portp->fileline(), newPortp, pinAccess}};
|
||||
AstArg* const newArgp = new AstArg{
|
||||
portp->fileline(), portp->name(),
|
||||
new AstVarRef{portp->fileline(), newPortp, portp->direction().pinAccess()}};
|
||||
newCallp->addArgsp(newArgp);
|
||||
}
|
||||
// Create wrapper call to original, passing arguments, adding setting of return value
|
||||
|
||||
Reference in New Issue
Block a user