From 0baee84e96114343811f5fb635eb0cf903294e0d Mon Sep 17 00:00:00 2001 From: Kamil Rakoczy Date: Mon, 11 Sep 2023 15:01:09 +0200 Subject: [PATCH] Move `dpiTemporaryVarSuffix()` to header. (#4474) Co-authored-by: Mariusz Glebocki --- src/V3Task.cpp | 7 ++----- src/V3Task.h | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/V3Task.cpp b/src/V3Task.cpp index b5af41942..0a1880e67 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -1554,6 +1554,8 @@ public: //###################################################################### // Task class functions +const char* const V3Task::s_dpiTemporaryVarSuffix = "__Vcvt"; + V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp) { // Output list will be in order of the port declaration variables (so // func calls are made right in C) @@ -1811,11 +1813,6 @@ string V3Task::assignDpiToInternal(const string& lhsName, AstVar* varp) { return statements; } -const char* V3Task::dpiTemporaryVarSuffix() { - static const char* const suffix = "__Vcvt"; - return suffix; -} - void V3Task::taskAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ": " << endl); { diff --git a/src/V3Task.h b/src/V3Task.h index 1a1a5ef8e..1d7397da6 100644 --- a/src/V3Task.h +++ b/src/V3Task.h @@ -34,6 +34,8 @@ using V3TaskConnects = std::vector; // [ [port, pin-connects-to] //============================================================================ class V3Task final { + static const char* const s_dpiTemporaryVarSuffix; + public: static void taskAll(AstNetlist* nodep); /// Return vector of [port, pin-connects-to] (SLOW) @@ -41,7 +43,7 @@ public: static string assignInternalToDpi(AstVar* portp, bool isPtr, const string& frSuffix, const string& toSuffix, const string& frPrefix = ""); static string assignDpiToInternal(const string& lhsName, AstVar* rhsp); - static const char* dpiTemporaryVarSuffix(); + static const char* dpiTemporaryVarSuffix() VL_MT_SAFE { return s_dpiTemporaryVarSuffix; } }; #endif // Guard