From cea8b65f8ca36fb33d1acaa6c7b7813cd7822364 Mon Sep 17 00:00:00 2001 From: Yutetsu TAKATSUKASA Date: Sat, 16 Jan 2021 23:47:04 +0900 Subject: [PATCH] Internals: Make some accessors in V3Number public (#2756). No functional change. --- src/V3Number.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/V3Number.h b/src/V3Number.h index 47ca60a11..c2fef325b 100644 --- a/src/V3Number.h +++ b/src/V3Number.h @@ -109,6 +109,8 @@ private: return ("01zx"[(((m_value[bit / 32] & (1UL << (bit & 31))) ? 1 : 0) | ((m_valueX[bit / 32] & (1UL << (bit & 31))) ? 2 : 0))]); } + +public: bool bitIs0(int bit) const { if (bit < 0) return false; if (bit >= m_width) return !bitIsXZ(m_width - 1); @@ -144,6 +146,8 @@ private: return ((~m_value[bit / 32] & (1UL << (bit & 31))) && (m_valueX[bit / 32] & (1UL << (bit & 31)))); } + +private: uint32_t bitsValue(int lsb, int nbits) const { uint32_t v = 0; for (int bitn = 0; bitn < nbits; bitn++) { v |= (bitIs1(lsb + bitn) << bitn); }