[#74021] apply review suggestions

This commit is contained in:
Mateusz Gancarz 2025-03-06 10:56:30 +01:00
parent 6339df5770
commit 915d734a3e
2 changed files with 9 additions and 9 deletions

View File

@ -88,7 +88,7 @@ public:
class VerilatedSaifActivityVar final { class VerilatedSaifActivityVar final {
// MEMBERS // 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 VerilatedSaifActivityBit* m_bits; // Pointer to variable bits objects
uint32_t m_width; // Width of variable (in bits) uint32_t m_width; // Width of variable (in bits)
@ -135,15 +135,15 @@ private:
class VerilatedSaifActivityScope final { class VerilatedSaifActivityScope final {
// MEMBERS // MEMBERS
// Absolute path to the scope // Absolute path to the scope
std::string m_scopePath{}; std::string m_scopePath;
// Name of the activity scope // Name of the activity scope
std::string m_scopeName{}; std::string m_scopeName;
// Array indices of child scopes // Array indices of child scopes
std::vector<std::unique_ptr<VerilatedSaifActivityScope>> m_childScopes{}; std::vector<std::unique_ptr<VerilatedSaifActivityScope>> m_childScopes{};
// Children signals codes mapped to their names in the current scope // Children signals codes mapped to their names in the current scope
std::vector<std::pair<uint32_t, std::string>> m_childActivities{}; std::vector<std::pair<uint32_t, std::string>> m_childActivities{};
// Parent scope pointer // Parent scope pointer
VerilatedSaifActivityScope* m_parentScope{nullptr}; VerilatedSaifActivityScope* m_parentScope = nullptr;
public: public:
// CONSTRUCTORS // CONSTRUCTORS
@ -332,7 +332,7 @@ void VerilatedSaif::closeInstanceScope() {
} }
void VerilatedSaif::printScopeActivities(const VerilatedSaifActivityScope& scope) { void VerilatedSaif::printScopeActivities(const VerilatedSaifActivityScope& scope) {
bool anyNetWritten{false}; bool anyNetWritten = false;
for (auto& accumulator : m_activityAccumulators) { for (auto& accumulator : m_activityAccumulators) {
anyNetWritten |= printScopeActivitiesFromAccumulatorIfPresent(scope.path(), *accumulator, anyNetWritten |= printScopeActivitiesFromAccumulatorIfPresent(scope.path(), *accumulator,
@ -369,7 +369,7 @@ void VerilatedSaif::closeNetScope() {
} }
bool VerilatedSaif::printActivityStats(VerilatedSaifActivityVar& activity, 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) { for (size_t i = 0; i < activity.width(); ++i) {
VerilatedSaifActivityBit& bit = activity.bit(i); VerilatedSaifActivityBit& bit = activity.bit(i);

View File

@ -56,13 +56,13 @@ private:
int m_indent = 0; // Indentation size in spaces int m_indent = 0; // Indentation size in spaces
// Currently active scope // Currently active scope
VerilatedSaifActivityScope* m_currentScope{nullptr}; VerilatedSaifActivityScope* m_currentScope = nullptr;
// Array of declared scopes // Array of declared scopes
std::vector<std::unique_ptr<VerilatedSaifActivityScope>> m_scopes{}; std::vector<std::unique_ptr<VerilatedSaifActivityScope>> m_scopes{};
// Activity accumulators used to store variables statistics over simulation time // Activity accumulators used to store variables statistics over simulation time
std::vector<std::unique_ptr<VerilatedSaifActivityAccumulator>> m_activityAccumulators{}; std::vector<std::unique_ptr<VerilatedSaifActivityAccumulator>> m_activityAccumulators{};
// Total time of the currently traced simulation // Total time of the currently traced simulation
uint64_t m_time{0}; uint64_t m_time = 0;
// Stack of declared scopes combined names // Stack of declared scopes combined names
std::vector<std::pair<std::string, VerilatedTracePrefixType>> m_prefixStack{ std::vector<std::pair<std::string, VerilatedTracePrefixType>> m_prefixStack{
@ -83,7 +83,7 @@ private:
bool anyNetWritten); bool anyNetWritten);
void openNetScope(); void openNetScope();
void closeNetScope(); void closeNetScope();
bool printActivityStats(VerilatedSaifActivityVar& activity, const char* activityName, bool printActivityStats(VerilatedSaifActivityVar& activity, const std::string& activityName,
bool anyNetWritten); bool anyNetWritten);
void incrementIndent(); void incrementIndent();