From 987858775378672ace7f8b2b9f64917447f50444 Mon Sep 17 00:00:00 2001 From: Mateusz Gancarz Date: Mon, 10 Feb 2025 15:52:02 +0100 Subject: [PATCH] [#72179] add more notes --- include/verilated_saif_c.cpp | 8 +++++++- include/verilated_saif_c.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/verilated_saif_c.cpp b/include/verilated_saif_c.cpp index ca77eace2..4f1a91fd0 100644 --- a/include/verilated_saif_c.cpp +++ b/include/verilated_saif_c.cpp @@ -259,7 +259,7 @@ void VerilatedSaif::close() VL_MT_SAFE_EXCLUDES(m_mutex) { printStr("))\n"); // NOTE: TZ, TX and TB will be allways 0 - // NOTE: I.3.4 and I.3.5 mentions also about TZ, TB, TG, IG and IK + // NOTE: I.3.4 and I.3.5 mentions also about TG, IG and IK } activity.lastTime = m_time; } @@ -392,21 +392,27 @@ void VerilatedSaif::declare(uint32_t code, const char* name, const char* wirep, const bool enabled = Super::declCode(code, hierarchicalName, bits); + //NOTE: m_suffixes currently not used anywhere if (m_suffixes.size() <= nextCode() * VL_TRACE_SUFFIX_ENTRY_SIZE) { m_suffixes.resize(nextCode() * VL_TRACE_SUFFIX_ENTRY_SIZE * 2, 0); } + //NOTE: m_maxSignalBytes currently used only here // Keep upper bound on bytes a single signal can emit into the buffer m_maxSignalBytes = std::max(m_maxSignalBytes, bits + 32); // Make sure write buffer is large enough, plus header bufferResize(m_maxSignalBytes + 1024); + //NOTE: enabled is set much earlier but returned here if (!enabled) return; const size_t block_size = 1024; if (m_activityArena.empty() || m_activityArena.back().size() + bits > m_activityArena.back().capacity()) { m_activityArena.emplace_back(); + + fprintf(stdout, "Adding new activity arena block with size %d\n", block_size); + m_activityArena.back().reserve(block_size); } size_t bitsIdx = m_activityArena.back().size(); diff --git a/include/verilated_saif_c.h b/include/verilated_saif_c.h index cf857aece..373cd0ae3 100644 --- a/include/verilated_saif_c.h +++ b/include/verilated_saif_c.h @@ -212,7 +212,7 @@ class VerilatedSaifBuffer VL_NOT_FINAL { char* const m_wrFlushp = m_owner.parallel() ? nullptr : m_owner.m_wrFlushp; // SAIF line end string codes + metadata - const char* const m_suffixes = m_owner.m_suffixes.data(); + const char* const m_suffixes = m_owner.m_suffixes.data(); //NOTE: currently not used anywhere // The maximum number of bytes a single signal can emit const size_t m_maxSignalBytes = m_owner.m_maxSignalBytes;