diff --git a/include/verilated_types.h b/include/verilated_types.h index 05bc34c2c..76126e3a1 100644 --- a/include/verilated_types.h +++ b/include/verilated_types.h @@ -209,6 +209,12 @@ struct VlWide final { // Default copy assignment operators are used. operator WDataOutP() { return &m_storage[0]; } // This also allows [] operator WDataInP() const { return &m_storage[0]; } // This also allows [] + bool operator!=(const VlWide& that) const { + for (size_t i = 0; i < T_Words; ++i) { + if (m_storage[i] != that.m_storage[i]) return true; + } + return false; + } // METHODS const EData& at(size_t index) const { return m_storage[index]; } @@ -974,7 +980,7 @@ struct VlUnpacked final { private: template static bool neq(const VlUnpacked& a, const VlUnpacked& b) { - for (int i = 0; i < T_Dep; ++i) { + for (size_t i = 0; i < T_Dep; ++i) { // Recursive 'neq', in case T_Val is also a VlUnpacked<_, _> if (neq(a.m_storage[i], b.m_storage[i])) return true; }