From 8b7a8779ae206b8c8d4762cf30f7c17e150143a8 Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Wed, 15 Nov 2023 16:50:08 +0100 Subject: [PATCH] Format Signed-off-by: Ryszard Rozak --- src/V3Ast.h | 43 +++++++++++++++++++++++++++++-------------- src/V3AstNodeDType.h | 4 +++- src/V3Randomize.cpp | 10 +++++----- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 993d07b0848..051f87dc662 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -561,19 +561,33 @@ class VBasicDTypeKwd final { return names[m_e]; } const char* dpiType() const { - static const char* const names[] = {"%E-unk", "svBit", - "char", "void*", - "char", "int", - "%E-integer", "svLogic", - "long long", "double", - "short", "%E-time", - "const char*", "%E-untyped", - "dpiScope", "const char*", - "%E-mtaskstate", "%E-triggervec", - "%E-dly-sched", "%E-trig-sched", - "%E-dyn-sched", "%E-fork", "%error-rand-gen", - "%E-proc-ref", "IData", - "QData", "%E-logic-implct", + static const char* const names[] = {"%E-unk", + "svBit", + "char", + "void*", + "char", + "int", + "%E-integer", + "svLogic", + "long long", + "double", + "short", + "%E-time", + "const char*", + "%E-untyped", + "dpiScope", + "const char*", + "%E-mtaskstate", + "%E-triggervec", + "%E-dly-sched", + "%E-trig-sched", + "%E-dyn-sched", + "%E-fork", + "%error-rand-gen", + "%E-proc-ref", + "IData", + "QData", + "%E-logic-implct", " MAX"}; return names[m_e]; } @@ -654,7 +668,8 @@ class VBasicDTypeKwd final { return (m_e == EVENT || m_e == STRING || m_e == SCOPEPTR || m_e == CHARPTR || m_e == MTASKSTATE || m_e == TRIGGERVEC || m_e == DELAY_SCHEDULER || m_e == TRIGGER_SCHEDULER || m_e == DYNAMIC_TRIGGER_SCHEDULER || m_e == FORK_SYNC - || m_e == RANDOM_GENERATOR || m_e == PROCESS_REFERENCE || m_e == DOUBLE || m_e == UNTYPED); + || m_e == RANDOM_GENERATOR || m_e == PROCESS_REFERENCE || m_e == DOUBLE + || m_e == UNTYPED); } bool isDouble() const VL_MT_SAFE { return m_e == DOUBLE; } bool isEvent() const { return m_e == EVENT; } diff --git a/src/V3AstNodeDType.h b/src/V3AstNodeDType.h index 8635dcbaa41..9f9948683c8 100644 --- a/src/V3AstNodeDType.h +++ b/src/V3AstNodeDType.h @@ -434,7 +434,9 @@ class AstBasicDType final : public AstNodeDType { bool isDynamicTriggerScheduler() const VL_MT_SAFE { return keyword() == VBasicDTypeKwd::DYNAMIC_TRIGGER_SCHEDULER; } - bool isRandomGenerator() const VL_MT_SAFE { return keyword() == VBasicDTypeKwd::RANDOM_GENERATOR; } + bool isRandomGenerator() const VL_MT_SAFE { + return keyword() == VBasicDTypeKwd::RANDOM_GENERATOR; + } bool isOpaque() const VL_MT_SAFE { return keyword().isOpaque(); } bool isString() const VL_MT_SAFE { return keyword().isString(); } bool isZeroInit() const { return keyword().isZeroInit(); } diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 0dd5d9fd42e..d6e195a5047 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -391,11 +391,11 @@ class RandomizeVisitor final : public VNVisitor { AstNodeExpr* exprp = condsp->exprp()->unlinkFrBack(); pushDeletep(condsp); // only hard constraints are now supported - auto* const methodp = new AstCMethodHard{ - fl, new AstVarRef{fl, genp, VAccess::READWRITE}, "hard", exprp}; - methodp->dtypeSetVoid(); - taskp->addStmtsp(new AstStmtExpr{fl, methodp}); - } + auto* const methodp = new AstCMethodHard{ + fl, new AstVarRef{fl, genp, VAccess::READWRITE}, "hard", exprp}; + methodp->dtypeSetVoid(); + taskp->addStmtsp(new AstStmtExpr{fl, methodp}); + } }); } void visit(AstRandCase* nodep) override {