// -*- mode: C++; c-file-style: "cc-mode" -*- //************************************************************************* // DESCRIPTION: verilator_coverage: Bucket container // // Code available from: http://www.veripool.org/verilator // //************************************************************************* // // Copyright 2003-2019 by Wilson Snyder. This program is free software; you can // redistribute it and/or modify it under the terms of either the GNU // Lesser General Public License Version 3 or the Perl Artistic License // Version 2.0. // // Verilator is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // //************************************************************************* #ifndef _VLCBUCKET_H_ #define _VLCBUCKET_H_ 1 #include "config_build.h" #include "verilatedos.h" //******************************************************************** // VlcBuckets - Container of all coverage point hits for a given test // This is a bitmap array - we store a single bit to indicate a test // has hit that point with sufficient coverage. class VlcBuckets { private: // MEMBERS vluint64_t* m_datap; ///< Pointer to first bucket (dynamically allocated) vluint64_t m_dataSize; ///< Current entries in m_datap vluint64_t m_bucketsCovered; ///< Num buckets with sufficient coverage private: static inline vluint64_t covBit(vluint64_t point) { return 1ULL<<(point & 63); } inline vluint64_t allocSize() const { return sizeof(vluint64_t) * m_dataSize / 64; } void allocate(vluint64_t point) { vluint64_t oldsize = m_dataSize; if (m_dataSize= sufficient()) { //UINFO(9," addData "<