From e0b2c4666473dba5ef5d51fe6ea59d127d6b0e9c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 25 Nov 2018 19:50:53 -0500 Subject: [PATCH] Internals: Function return values act as vars, not wires. --- src/V3LinkDot.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 145a76546..9d1a3656d 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -867,11 +867,11 @@ class LinkDotFindVisitor : public AstNVisitor { if (nodep->fvarp() && !VN_IS(nodep->fvarp(), Var)) { AstNodeDType* dtypep = VN_CAST(nodep->fvarp(), NodeDType); - // If unspecified, function returns one bit; however when we support NEW() it could - // also return the class reference. - if (dtypep) dtypep->unlinkFrBack(); - else dtypep = new AstBasicDType(nodep->fileline(), AstBasicDTypeKwd::LOGIC); - AstVar* newvarp = new AstVar(nodep->fileline(), AstVarType::WIRE, nodep->name(), + // If unspecified, function returns one bit; however when we support NEW() it could + // also return the class reference. + if (dtypep) dtypep->unlinkFrBack(); + else dtypep = new AstBasicDType(nodep->fileline(), AstBasicDTypeKwd::LOGIC); + AstVar* newvarp = new AstVar(nodep->fileline(), AstVarType::VAR, nodep->name(), VFlagChildDType(), dtypep); // Not dtype resolved yet newvarp->direction(VDirection::OUTPUT); newvarp->funcReturn(true);