diff --git a/include/verilateddpi.cpp b/include/verilateddpi.cpp index bc6d0d816..de3dd4a09 100644 --- a/include/verilateddpi.cpp +++ b/include/verilateddpi.cpp @@ -258,9 +258,10 @@ svScope svGetScope() { } svScope svSetScope(const svScope scope) { + const VerilatedScope* prevScopep = Verilated::dpiScope(); const VerilatedScope* vscopep = (const VerilatedScope*)(scope); Verilated::dpiScope(vscopep); - return (svScope)vscopep; + return (svScope)prevScopep; } const char* svGetNameFromScope(const svScope scope) { diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 8e06977b0..a358532f1 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -133,7 +133,7 @@ string AstVar::vlArgType(bool named, bool forReturn) const { return arg; } -string AstVar::cpubArgType(bool named, bool forReturn) const { +string AstVar::cPubArgType(bool named, bool forReturn) const { if (forReturn) named=false; string arg; if (isWide() && isInOnly()) arg += "const "; diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 980775f2d..6c6aea34b 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -483,7 +483,7 @@ public: void varType2Out() { m_tristate=0; m_input=0; m_output=1; } void varType2In() { m_tristate=0; m_input=1; m_output=0; } string scType() const; // Return SysC type: bool, uint32_t, uint64_t, sc_bv - string cpubArgType(bool named, bool forReturn) const; // Return C /*public*/ type for argument: bool, uint32_t, uint64_t, etc. + string cPubArgType(bool named, bool forReturn) const; // Return C /*public*/ type for argument: bool, uint32_t, uint64_t, etc. string dpiArgType(bool named, bool forReturn) const; // Return DPI-C type for argument string vlArgType(bool named, bool forReturn) const; // Return Verilator internal type for argument: CData, SData, IData, WData void combineType(AstVarType type); diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 34297915a..5c985ed16 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -91,7 +91,7 @@ public: if (portp->isIO() && !portp->isFuncReturn()) { if (args != "") args+= ", "; if (nodep->dpiImport()) args += portp->dpiArgType(true,false); - else if (nodep->funcPublic()) args += portp->cpubArgType(true,false); + else if (nodep->funcPublic()) args += portp->cPubArgType(true,false); else args += portp->vlArgType(true,false); } } diff --git a/src/V3Task.cpp b/src/V3Task.cpp index a3d38350b..4b64e137d 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -671,7 +671,7 @@ private: AstCFunc* cfuncp = new AstCFunc(nodep->fileline(), prefix + nodep->name() + suffix, m_scopep, - ((nodep->taskPublic() && rtnvarp)?rtnvarp->cpubArgType(true,true):"")); + ((nodep->taskPublic() && rtnvarp)?rtnvarp->cPubArgType(true,true):"")); // It's ok to combine imports because this is just a wrapper; duplicate wrappers can get merged. cfuncp->dontCombine(!nodep->dpiImport()); cfuncp->entryPoint (!nodep->dpiImport());