From 8cfa430902040bb9b21227f1968b94ec9dc8dd57 Mon Sep 17 00:00:00 2001 From: Mateusz Gancarz Date: Thu, 27 Feb 2025 08:19:47 +0100 Subject: [PATCH] [#73220] remove unused code --- include/verilated_saif_c.cpp | 25 ++++++------------------- include/verilated_saif_c.h | 8 +------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/include/verilated_saif_c.cpp b/include/verilated_saif_c.cpp index 018745ed3..2d18ec777 100644 --- a/include/verilated_saif_c.cpp +++ b/include/verilated_saif_c.cpp @@ -50,18 +50,6 @@ // clang-format on -// This size comes form SAIF allowing use of printable ASCII characters between -// '!' and '~' inclusive, which are a total of 94 different values. Encoding a -// 32 bit code hence needs a maximum of std::ceil(log94(2**32-1)) == 5 bytes. -constexpr unsigned VL_TRACE_MAX_SAIF_CODE_SIZE = 5; // Maximum length of a SAIF string code - -// We use 8 bytes per code in a suffix buffer array. -// 1 byte optional separator + VL_TRACE_MAX_SAIF_CODE_SIZE bytes for code -// + 1 byte '\n' + 1 byte suffix size. This luckily comes out to a power of 2, -// meaning the array can be aligned such that entries never straddle multiple -// cache-lines. -constexpr unsigned VL_TRACE_SUFFIX_ENTRY_SIZE = 8; // Size of a suffix entry - //============================================================================= // Specialization of the generics for this trace format @@ -77,8 +65,7 @@ constexpr unsigned VL_TRACE_SUFFIX_ENTRY_SIZE = 8; // Size of a suffix entry // VerilatedSaifFile bool VerilatedSaifFile::open(const std::string& name) VL_MT_UNSAFE { - m_fd = ::open(name.c_str(), - O_CREAT | O_WRONLY | O_TRUNC | O_LARGEFILE | O_NONBLOCK | O_CLOEXEC, 0666); + m_fd = ::open(name.c_str(), O_CREAT | O_WRONLY | O_TRUNC | O_LARGEFILE | O_NONBLOCK | O_CLOEXEC, 0666); return m_fd >= 0; } @@ -347,12 +334,11 @@ void VerilatedSaif::pushPrefix(const std::string& name, VerilatedTracePrefixType assert(!m_prefixStack.empty()); std::string pname = name; - if (name.empty()) { + if (pname.empty()) { pname = "$rootio"; } - if (type != VerilatedTracePrefixType::ARRAY_UNPACKED && type != VerilatedTracePrefixType::ARRAY_PACKED) - { + if (type != VerilatedTracePrefixType::ARRAY_UNPACKED && type != VerilatedTracePrefixType::ARRAY_PACKED) { int32_t newScopeIndex = m_scopes.size(); m_scopes.emplace_back(); SaifScope& newScope = m_scopes.back(); @@ -392,8 +378,9 @@ void VerilatedSaif::declare(uint32_t code, const char* name, const char* wirep, std::string hierarchicalName = m_prefixStack.back().first + name; - const bool enabled = Super::declCode(code, hierarchicalName, bits); - if (!enabled) return; + if (!Super::declCode(code, hierarchicalName, bits)) { + return; + } const size_t block_size = 1024; if (m_activityArena.empty() || m_activityArena.back().size() + bits > m_activityArena.back().capacity()) { diff --git a/include/verilated_saif_c.h b/include/verilated_saif_c.h index 12291fc16..0ebf608df 100644 --- a/include/verilated_saif_c.h +++ b/include/verilated_saif_c.h @@ -127,7 +127,7 @@ protected: void commitTraceBuffer(Buffer*) override; // Configure sub-class - void configure(const VerilatedTraceConfig&) override{}; + void configure(const VerilatedTraceConfig&) override {} public: //========================================================================= @@ -177,12 +177,6 @@ public: void declDouble(uint32_t code, uint32_t fidx, const char* name, int dtypenum, VerilatedTraceSigDirection, VerilatedTraceSigKind, VerilatedTraceSigType, bool array, int arraynum); - -// For debugging purposes -private: - void printSignalDirection(VerilatedTraceSigDirection signalDirection); - void printSignalKind(VerilatedTraceSigKind signalKind); - void printSignalType(VerilatedTraceSigType signalType); }; #ifndef DOXYGEN