From 915d734a3e8e05174ea3dce009d7f52f85b32284 Mon Sep 17 00:00:00 2001 From: Mateusz Gancarz Date: Thu, 6 Mar 2025 10:56:30 +0100 Subject: [PATCH] [#74021] apply review suggestions --- include/verilated_saif_c.cpp | 12 ++++++------ include/verilated_saif_c.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/verilated_saif_c.cpp b/include/verilated_saif_c.cpp index 44c7f25ac..70c04cd5c 100644 --- a/include/verilated_saif_c.cpp +++ b/include/verilated_saif_c.cpp @@ -88,7 +88,7 @@ public: class VerilatedSaifActivityVar final { // MEMBERS - uint64_t m_lastTime{0}; // Last time when variable value was updated + uint64_t m_lastTime = 0; // Last time when variable value was updated VerilatedSaifActivityBit* m_bits; // Pointer to variable bits objects uint32_t m_width; // Width of variable (in bits) @@ -135,15 +135,15 @@ private: class VerilatedSaifActivityScope final { // MEMBERS // Absolute path to the scope - std::string m_scopePath{}; + std::string m_scopePath; // Name of the activity scope - std::string m_scopeName{}; + std::string m_scopeName; // Array indices of child scopes std::vector> m_childScopes{}; // Children signals codes mapped to their names in the current scope std::vector> m_childActivities{}; // Parent scope pointer - VerilatedSaifActivityScope* m_parentScope{nullptr}; + VerilatedSaifActivityScope* m_parentScope = nullptr; public: // CONSTRUCTORS @@ -332,7 +332,7 @@ void VerilatedSaif::closeInstanceScope() { } void VerilatedSaif::printScopeActivities(const VerilatedSaifActivityScope& scope) { - bool anyNetWritten{false}; + bool anyNetWritten = false; for (auto& accumulator : m_activityAccumulators) { anyNetWritten |= printScopeActivitiesFromAccumulatorIfPresent(scope.path(), *accumulator, @@ -369,7 +369,7 @@ void VerilatedSaif::closeNetScope() { } bool VerilatedSaif::printActivityStats(VerilatedSaifActivityVar& activity, - const char* activityName, bool anyNetWritten) { + const std::string& activityName, bool anyNetWritten) { for (size_t i = 0; i < activity.width(); ++i) { VerilatedSaifActivityBit& bit = activity.bit(i); diff --git a/include/verilated_saif_c.h b/include/verilated_saif_c.h index aa1457d06..ad6e6f59f 100644 --- a/include/verilated_saif_c.h +++ b/include/verilated_saif_c.h @@ -56,13 +56,13 @@ private: int m_indent = 0; // Indentation size in spaces // Currently active scope - VerilatedSaifActivityScope* m_currentScope{nullptr}; + VerilatedSaifActivityScope* m_currentScope = nullptr; // Array of declared scopes std::vector> m_scopes{}; // Activity accumulators used to store variables statistics over simulation time std::vector> m_activityAccumulators{}; // Total time of the currently traced simulation - uint64_t m_time{0}; + uint64_t m_time = 0; // Stack of declared scopes combined names std::vector> m_prefixStack{ @@ -83,7 +83,7 @@ private: bool anyNetWritten); void openNetScope(); void closeNetScope(); - bool printActivityStats(VerilatedSaifActivityVar& activity, const char* activityName, + bool printActivityStats(VerilatedSaifActivityVar& activity, const std::string& activityName, bool anyNetWritten); void incrementIndent();