C++11: Use member declaration initalizations. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-08-16 11:44:06 -04:00
parent 033e7ac020
commit 72d2cff0a1
117 changed files with 981 additions and 1469 deletions
+12 -33
View File
@@ -255,8 +255,6 @@ Verilated::Serialized::Serialized() {
}
Verilated::NonSerialized::NonSerialized() {
s_profThreadsStart = 1;
s_profThreadsWindow = 2;
s_profThreadsFilenamep = strdup("profile_threads.dat");
}
Verilated::NonSerialized::~NonSerialized() {
@@ -1759,12 +1757,12 @@ static const char* formatBinary(int nBits, vluint32_t bits) {
}
VlReadMem::VlReadMem(bool hex, int bits, const std::string& filename, QData start, QData end)
: m_hex(hex)
, m_bits(bits)
, m_filename(filename)
, m_end(end)
, m_addr(start)
, m_linenum(0) {
: m_hex{hex}
, m_bits{bits}
, m_filename{filename}
, m_end{end}
, m_addr{start}
, m_linenum{0} {
m_fp = fopen(filename.c_str(), "r");
if (VL_UNLIKELY(!m_fp)) {
// We don't report the Verilog source filename as it slow to have to pass it down
@@ -1895,9 +1893,9 @@ void VlReadMem::setData(void* valuep, const std::string& rhs) {
}
VlWriteMem::VlWriteMem(bool hex, int bits, const std::string& filename, QData start, QData end)
: m_hex(hex)
, m_bits(bits)
, m_addr(0) {
: m_hex{hex}
, m_bits{bits}
, m_addr{0} {
if (VL_UNLIKELY(start > end)) {
VL_FATAL_MT(filename.c_str(), 0, "", "$writemem invalid address range");
return;
@@ -2174,17 +2172,7 @@ void VL_TIMEFORMAT_IINI(int units, int precision, const std::string& suffix,
//===========================================================================
// Verilated:: Methods
Verilated::ThreadLocal::ThreadLocal()
:
#ifdef VL_THREADED
t_mtaskId(0)
, t_endOfEvalReqd(0)
,
#endif
t_dpiScopep(nullptr)
, t_dpiFilename(0)
, t_dpiLineno(0) {
}
Verilated::ThreadLocal::ThreadLocal() {}
Verilated::ThreadLocal::~ThreadLocal() {}
void Verilated::debug(int level) VL_MT_SAFE {
@@ -2554,7 +2542,7 @@ VerilatedSyms::~VerilatedSyms() {
// VerilatedModule:: Methods
VerilatedModule::VerilatedModule(const char* namep)
: m_namep(strdup(namep)) {}
: m_namep{strdup(namep)} {}
VerilatedModule::~VerilatedModule() {
// Memory cleanup - not called during normal operation
@@ -2601,16 +2589,7 @@ void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const
//======================================================================
// VerilatedScope:: Methods
VerilatedScope::VerilatedScope() {
m_callbacksp = nullptr;
m_namep = nullptr;
m_identifierp = nullptr;
m_funcnumMax = 0;
m_symsp = nullptr;
m_varsp = nullptr;
m_timeunit = 0;
m_type = SCOPE_OTHER;
}
VerilatedScope::VerilatedScope() {}
VerilatedScope::~VerilatedScope() {
// Memory cleanup - not called during normal operation
+21 -22
View File
@@ -163,7 +163,7 @@ private:
public:
explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr)
: m_mutexr(mutexr) {
: m_mutexr{mutexr} {
m_mutexr.lock();
}
~VerilatedLockGuard() VL_RELEASE() { m_mutexr.unlock(); }
@@ -203,7 +203,7 @@ public:
/// The constructor establishes the thread id for all later calls.
/// If necessary, a different class could be made that inits it otherwise.
VerilatedAssertOneThread()
: m_threadid(VL_THREAD_ID()) {}
: m_threadid{VL_THREAD_ID()} {}
~VerilatedAssertOneThread() { check(); }
// METHODS
/// Check that the current thread ID is the same as the construction thread ID
@@ -319,15 +319,15 @@ public:
} Type; // Type of a scope, currently module is only interesting
private:
// Fastpath:
VerilatedSyms* m_symsp; ///< Symbol table
void** m_callbacksp; ///< Callback table pointer (Fastpath)
int m_funcnumMax; ///< Maxium function number stored (Fastpath)
VerilatedSyms* m_symsp = nullptr; ///< Symbol table
void** m_callbacksp = nullptr; ///< Callback table pointer (Fastpath)
int m_funcnumMax = 0; ///< Maxium function number stored (Fastpath)
// 4 bytes padding (on -m64), for rent.
VerilatedVarNameMap* m_varsp; ///< Variable map
const char* m_namep; ///< Scope name (Slowpath)
const char* m_identifierp; ///< Identifier of scope (with escapes removed)
vlsint8_t m_timeunit; ///< Timeunit in negative power-of-10
Type m_type; ///< Type of the scope
VerilatedVarNameMap* m_varsp = nullptr; ///< Variable map
const char* m_namep = nullptr; ///< Scope name (Slowpath)
const char* m_identifierp = nullptr; ///< Identifier of scope (with escapes removed)
vlsint8_t m_timeunit = 0; ///< Timeunit in negative power-of-10
Type m_type = SCOPE_OTHER; ///< Type of the scope
public: // But internals only - called from VerilatedModule's
VerilatedScope();
@@ -393,8 +393,8 @@ class Verilated {
static struct NonSerialized { // Non-serialized information
// These are reloaded from on command-line settings, so do not need to persist
// Fast path
vluint64_t s_profThreadsStart; ///< +prof+threads starting time
vluint32_t s_profThreadsWindow; ///< +prof+threads window size
vluint64_t s_profThreadsStart = 1; ///< +prof+threads starting time
vluint32_t s_profThreadsWindow = 2; ///< +prof+threads window size
// Slow path
const char* s_profThreadsFilenamep; ///< +prof+threads filename
NonSerialized();
@@ -405,23 +405,22 @@ class Verilated {
// assumption is that the restore is allowed to pass different arguments
static struct CommandArgValues {
VerilatedMutex m_argMutex; ///< Mutex for s_args members, when VL_THREADED
int argc;
const char** argv;
CommandArgValues()
: argc(0)
, argv(nullptr) {}
int argc = 0;
const char** argv = nullptr;
CommandArgValues() {}
~CommandArgValues() {}
} s_args;
// Not covered by mutex, as per-thread
static VL_THREAD_LOCAL struct ThreadLocal {
#ifdef VL_THREADED
vluint32_t t_mtaskId; ///< Current mtask# executing on this thread
vluint32_t t_endOfEvalReqd; ///< Messages may be pending, thread needs endOf-eval calls
vluint32_t t_mtaskId = 0; ///< Current mtask# executing on this thread
vluint32_t t_endOfEvalReqd
= 0; ///< Messages may be pending, thread needs endOf-eval calls
#endif
const VerilatedScope* t_dpiScopep; ///< DPI context scope
const char* t_dpiFilename; ///< DPI context filename
int t_dpiLineno; ///< DPI context line number
const VerilatedScope* t_dpiScopep = nullptr; ///< DPI context scope
const char* t_dpiFilename = nullptr; ///< DPI context filename
int t_dpiLineno = 0; ///< DPI context line number
ThreadLocal();
~ThreadLocal();
+1 -1
View File
@@ -75,7 +75,7 @@ public:
// CONSTRUCTORS
// cppcheck-suppress noExplicitConstructor
explicit VerilatedCoverItemSpec(T* countp)
: m_countp(countp) {
: m_countp{countp} {
*m_countp = 0;
}
virtual ~VerilatedCoverItemSpec() override {}
+1 -3
View File
@@ -58,9 +58,7 @@
// VerilatedFst
VerilatedFst::VerilatedFst(void* fst)
: m_fst(fst)
, m_symbolp(nullptr)
, m_strbuf(nullptr) {}
: m_fst{fst} {}
VerilatedFst::~VerilatedFst() {
if (m_fst) fstWriterClose(m_fst);
+3 -3
View File
@@ -50,8 +50,8 @@ private:
Code2SymbolType m_code2symbol;
Local2FstDtype m_local2fstdtype;
std::list<std::string> m_curScope;
fstHandle* m_symbolp; ///< same as m_code2symbol, but as an array
char* m_strbuf; ///< String buffer long enough to hold maxBits() chars
fstHandle* m_symbolp = nullptr; ///< same as m_code2symbol, but as an array
char* m_strbuf = nullptr; ///< String buffer long enough to hold maxBits() chars
// CONSTRUCTORS
VL_UNCOPYABLE(VerilatedFst);
@@ -136,7 +136,7 @@ class VerilatedFstC {
public:
explicit VerilatedFstC(void* filep = nullptr)
: m_sptrace(filep) {}
: m_sptrace{filep} {}
~VerilatedFstC() { close(); }
/// Routines can only be called from one thread; allow next call from different thread
void changeThread() { spTrace()->changeThread(); }
+11 -15
View File
@@ -62,8 +62,8 @@ private:
public:
// CONSTRUCTORS
VerilatedMsg(const std::function<void()>& cb)
: m_mtaskId(Verilated::mtaskId())
, m_cb(cb) {}
: m_mtaskId{Verilated::mtaskId()}
, m_cb{cb} {}
~VerilatedMsg() {}
// METHODS
vluint32_t mtaskId() const { return m_mtaskId; }
@@ -84,7 +84,7 @@ class VerilatedEvalMsgQueue {
public:
// CONSTRUCTORS
VerilatedEvalMsgQueue()
: m_depth(0) {
: m_depth{0} {
assert(atomic_is_lock_free(&m_depth));
}
~VerilatedEvalMsgQueue() {}
@@ -172,12 +172,11 @@ public:
// FILE* list constructed from a file-descriptor
class VerilatedFpList {
FILE* m_fp[31];
std::size_t m_sz;
std::size_t m_sz = 0;
public:
typedef FILE* const* const_iterator;
explicit VerilatedFpList()
: m_sz(0) {}
explicit VerilatedFpList() {}
const_iterator begin() const { return m_fp; }
const_iterator end() const { return m_fp + m_sz; }
std::size_t size() const { return m_sz; }
@@ -204,14 +203,11 @@ protected:
static VerilatedImp s_s; ///< Static Singleton; One and only static this
struct Serialized { // All these members serialized/deserialized
int m_timeFormatUnits; // $timeformat units
int m_timeFormatPrecision; // $timeformat number of decimal places
int m_timeFormatWidth; // $timeformat character width
int m_timeFormatUnits = UNITS_NONE; // $timeformat units
int m_timeFormatPrecision = 0; // $timeformat number of decimal places
int m_timeFormatWidth = 20; // $timeformat character width
enum { UNITS_NONE = 99 }; // Default based on precision
Serialized()
: m_timeFormatUnits(UNITS_NONE)
, m_timeFormatPrecision(0)
, m_timeFormatWidth(20) {}
Serialized() {}
~Serialized() {}
} m_ser;
@@ -255,8 +251,8 @@ protected:
public: // But only for verilated*.cpp
// CONSTRUCTORS
VerilatedImp()
: m_argVecLoaded(false)
, m_exportNext(0) {
: m_argVecLoaded{false}
, m_exportNext{0} {
s_s.m_fdps.resize(31);
std::fill(s_s.m_fdps.begin(), s_s.m_fdps.end(), (FILE*)0);
s_s.m_fdFreeMct.resize(30);
+39 -39
View File
@@ -44,11 +44,11 @@ protected:
friend class VerilatedVarProps;
friend class VerilatedScope;
VerilatedRange()
: m_left(0)
, m_right(0) {}
: m_left{0}
, m_right{0} {}
VerilatedRange(int left, int right)
: m_left(left)
, m_right(right) {}
: m_left{left}
, m_right{right} {}
void init(int left, int right) {
m_left = left;
m_right = right;
@@ -92,11 +92,11 @@ class VerilatedVarProps {
protected:
friend class VerilatedScope;
VerilatedVarProps(VerilatedVarType vltype, VerilatedVarFlags vlflags, int pdims, int udims)
: m_magic(MAGIC)
, m_vltype(vltype)
, m_vlflags(vlflags)
, m_pdims(pdims)
, m_udims(udims) {
: m_magic{MAGIC}
, m_vltype{vltype}
, m_vlflags{vlflags}
, m_pdims{pdims}
, m_udims{udims} {
initUnpacked(nullptr);
}
@@ -104,36 +104,36 @@ public:
class Unpacked {};
// Without packed
VerilatedVarProps(VerilatedVarType vltype, int vlflags)
: m_magic(MAGIC)
, m_vltype(vltype)
, m_vlflags(VerilatedVarFlags(vlflags))
, m_pdims(0)
, m_udims(0) {}
: m_magic{MAGIC}
, m_vltype{vltype}
, m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims{0}
, m_udims{0} {}
VerilatedVarProps(VerilatedVarType vltype, int vlflags, Unpacked, int udims, const int* ulims)
: m_magic(MAGIC)
, m_vltype(vltype)
, m_vlflags(VerilatedVarFlags(vlflags))
, m_pdims(0)
, m_udims(udims) {
: m_magic{MAGIC}
, m_vltype{vltype}
, m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims{0}
, m_udims{udims} {
initUnpacked(ulims);
}
// With packed
class Packed {};
VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr)
: m_magic(MAGIC)
, m_vltype(vltype)
, m_vlflags(VerilatedVarFlags(vlflags))
, m_pdims(1)
, m_udims(0)
, m_packed(pl, pr) {}
: m_magic{MAGIC}
, m_vltype{vltype}
, m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims{1}
, m_udims{0}
, m_packed{pl, pr} {}
VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr, Unpacked,
int udims, const int* ulims)
: m_magic(MAGIC)
, m_vltype(vltype)
, m_vlflags(VerilatedVarFlags(vlflags))
, m_pdims(1)
, m_udims(udims)
, m_packed(pl, pr) {
: m_magic{MAGIC}
, m_vltype{vltype}
, m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims{1}
, m_udims{udims}
, m_packed{pl, pr} {
initUnpacked(ulims);
}
@@ -196,11 +196,11 @@ class VerilatedDpiOpenVar {
public:
// CONSTRUCTORS
VerilatedDpiOpenVar(const VerilatedVarProps* propsp, void* datap)
: m_propsp(propsp)
, m_datap(datap) {}
: m_propsp{propsp}
, m_datap{datap} {}
VerilatedDpiOpenVar(const VerilatedVarProps* propsp, const void* datap)
: m_propsp(propsp)
, m_datap(const_cast<void*>(datap)) {}
: m_propsp{propsp}
, m_datap{const_cast<void*>(datap)} {}
~VerilatedDpiOpenVar() {}
// METHODS
void* datap() const { return m_datap; }
@@ -237,10 +237,10 @@ protected:
// CONSTRUCTORS
VerilatedVar(const char* namep, void* datap, VerilatedVarType vltype,
VerilatedVarFlags vlflags, int dims, bool isParam)
: VerilatedVarProps(vltype, vlflags, (dims > 0 ? 1 : 0), ((dims > 1) ? dims - 1 : 0))
, m_datap(datap)
, m_namep(namep)
, m_isParam(isParam) {}
: VerilatedVarProps{vltype, vlflags, (dims > 0 ? 1 : 0), ((dims > 1) ? dims - 1 : 0)}
, m_datap{datap}
, m_namep{namep}
, m_isParam{isParam} {}
public:
~VerilatedVar() {}
+8 -10
View File
@@ -27,8 +27,8 @@ VL_THREAD_LOCAL VlThreadPool::ProfileTrace* VlThreadPool::t_profilep = nullptr;
// VlMTaskVertex
VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount)
: m_upstreamDepsDone(0)
, m_upstreamDepCount(upstreamDepCount) {
: m_upstreamDepsDone{0}
, m_upstreamDepCount{upstreamDepCount} {
assert(atomic_is_lock_free(&m_upstreamDepsDone));
}
@@ -36,13 +36,11 @@ VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount)
// VlWorkerThread
VlWorkerThread::VlWorkerThread(VlThreadPool* poolp, bool profiling)
: m_waiting(false)
, m_ready_size(0)
, m_poolp(poolp)
, m_profiling(profiling)
, m_exiting(false)
// Must init this last -- after setting up fields that it might read:
, m_cthread(startWorker, this) {}
: m_waiting{false}
, m_poolp{poolp}
, m_profiling{profiling} // Must init this last -- after setting up fields that it might read:
, m_exiting{false}
, m_cthread{startWorker, this} {}
VlWorkerThread::~VlWorkerThread() {
m_exiting.store(true, std::memory_order_release);
@@ -78,7 +76,7 @@ void VlWorkerThread::startWorker(VlWorkerThread* workerp) { workerp->workerLoop(
// VlThreadPool
VlThreadPool::VlThreadPool(int nThreads, bool profiling)
: m_profiling(profiling) {
: m_profiling{profiling} {
// --threads N passes nThreads=N-1, as the "main" threads counts as 1
unsigned cpus = std::thread::hardware_concurrency();
if (cpus < nThreads + 1) {
+12 -19
View File
@@ -119,23 +119,16 @@ class VlProfileRec {
protected:
friend class VlThreadPool;
enum VlProfileE { TYPE_MTASK_RUN, TYPE_BARRIER };
VlProfileE m_type; // Record type
vluint32_t m_mtaskId; // Mtask we're logging
vluint32_t m_predictTime; // How long scheduler predicted would take
vluint64_t m_startTime; // Tick at start of execution
vluint64_t m_endTime; // Tick at end of execution
VlProfileE m_type = TYPE_BARRIER; // Record type
vluint32_t m_mtaskId = 0; // Mtask we're logging
vluint32_t m_predictTime = 0; // How long scheduler predicted would take
vluint64_t m_startTime = 0; // Tick at start of execution
vluint64_t m_endTime = 0; // Tick at end of execution
unsigned m_cpu; // Execution CPU number (at start anyways)
public:
class Barrier {};
VlProfileRec() {}
explicit VlProfileRec(Barrier) {
m_type = TYPE_BARRIER;
m_mtaskId = 0;
m_predictTime = 0;
m_startTime = 0;
m_endTime = 0;
m_cpu = getcpu();
}
explicit VlProfileRec(Barrier) { m_cpu = getcpu(); }
void startRecord(vluint64_t time, uint32_t mtask, uint32_t predict) {
m_type = VlProfileRec::TYPE_MTASK_RUN;
m_mtaskId = mtask;
@@ -174,13 +167,13 @@ private:
VlThrSymTab m_sym; // Symbol table to execute
bool m_evenCycle; // Even/odd for flag alternation
ExecRec()
: m_fnp(nullptr)
, m_sym(nullptr)
, m_evenCycle(false) {}
: m_fnp{nullptr}
, m_sym{nullptr}
, m_evenCycle{false} {}
ExecRec(VlExecFnp fnp, bool evenCycle, VlThrSymTab sym)
: m_fnp(fnp)
, m_sym(sym)
, m_evenCycle(evenCycle) {}
: m_fnp{fnp}
, m_sym{sym}
, m_evenCycle{evenCycle} {}
};
// MEMBERS
+4 -4
View File
@@ -130,11 +130,11 @@ private:
};
void* m_userp; // The user pointer to pass to the callback (the symbol table)
CallbackRecord(initCb_t cb, void* userp)
: m_initCb(cb)
, m_userp(userp) {}
: m_initCb{cb}
, m_userp{userp} {}
CallbackRecord(dumpCb_t cb, void* userp)
: m_dumpCb(cb)
, m_userp(userp) {}
: m_dumpCb{cb}
, m_userp{userp} {}
};
vluint32_t* m_sigs_oldvalp; ///< Old value store
+12 -10
View File
@@ -276,17 +276,19 @@ template <> void VerilatedTrace<VL_DERIVED_T>::onExit(void* selfp) {
template <>
VerilatedTrace<VL_DERIVED_T>::VerilatedTrace()
: m_sigs_oldvalp(nullptr)
, m_timeLastDump(0)
, m_fullDump(true)
, m_nextCode(0)
, m_numSignals(0)
, m_maxBits(0)
, m_scopeEscape('.')
, m_timeRes(1e-9)
, m_timeUnit(1e-9)
: m_sigs_oldvalp{nullptr}
, m_timeLastDump{0}
, m_fullDump{true}
, m_nextCode{0}
, m_numSignals{0}
, m_maxBits{0}
, m_scopeEscape{'.'}
, m_timeRes{1e-9}
, m_timeUnit {
1e-9
}
#ifdef VL_TRACE_THREADED
, m_numTraceBuffers(0)
, m_numTraceBuffers { 0 }
#endif
{
set_time_unit(Verilated::timeunitString());
+1 -7
View File
@@ -88,20 +88,14 @@ ssize_t VerilatedVcdFile::write(const char* bufp, ssize_t len) VL_MT_UNSAFE {
//=============================================================================
// Opening/Closing
VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep)
: m_isOpen(false)
, m_rolloverMB(0)
, m_modDepth(0) {
VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep) {
// Not in header to avoid link issue if header is included without this .cpp file
m_fileNewed = (filep == nullptr);
m_filep = m_fileNewed ? new VerilatedVcdFile : filep;
m_namemapp = nullptr;
m_evcd = false;
m_wrChunkSize = 8 * 1024;
m_wrBufp = new char[m_wrChunkSize * 8];
m_wrFlushp = m_wrBufp + m_wrChunkSize * 6;
m_writep = m_wrBufp;
m_wroteBytes = 0;
m_suffixesp = nullptr;
}
+7 -7
View File
@@ -61,23 +61,23 @@ private:
VerilatedVcdFile* m_filep; ///< File we're writing to
bool m_fileNewed; ///< m_filep needs destruction
bool m_isOpen; ///< True indicates open file
bool m_evcd; ///< True for evcd format
bool m_isOpen = false; ///< True indicates open file
bool m_evcd = false; ///< True for evcd format
std::string m_filename; ///< Filename we're writing to (if open)
vluint64_t m_rolloverMB; ///< MB of file size to rollover at
int m_modDepth; ///< Depth of module hierarchy
vluint64_t m_rolloverMB = 0; ///< MB of file size to rollover at
int m_modDepth = 0; ///< Depth of module hierarchy
char* m_wrBufp; ///< Output buffer
char* m_wrFlushp; ///< Output buffer flush trigger location
char* m_writep; ///< Write pointer into output buffer
vluint64_t m_wrChunkSize; ///< Output buffer size
vluint64_t m_wroteBytes; ///< Number of bytes written to this file
vluint64_t m_wroteBytes = 0; ///< Number of bytes written to this file
std::vector<char> m_suffixes; ///< VCD line end string codes + metadata
const char* m_suffixesp; ///< Pointer to first element of above
typedef std::map<std::string, std::string> NameMap;
NameMap* m_namemapp; ///< List of names for the header
NameMap* m_namemapp = nullptr; ///< List of names for the header
void bufferResize(vluint64_t minsize);
void bufferFlush() VL_MT_UNSAFE_ONE;
@@ -337,7 +337,7 @@ class VerilatedVcdC {
public:
explicit VerilatedVcdC(VerilatedVcdFile* filep = nullptr)
: m_sptrace(filep) {}
: m_sptrace{filep} {}
~VerilatedVcdC() { close(); }
/// Routines can only be called from one thread; allow next call from different thread
void changeThread() { spTrace()->changeThread(); }
+22 -25
View File
@@ -109,8 +109,8 @@ class VerilatedVpioCb : public VerilatedVpio {
public:
// cppcheck-suppress uninitVar // m_value
VerilatedVpioCb(const t_cb_data* cbDatap, QData time)
: m_cbData(*cbDatap)
, m_time(time) {
: m_cbData{*cbDatap}
, m_time{time} {
m_value.format = cbDatap->value ? cbDatap->value->format : vpiSuppressVal;
m_cbData.value = &m_value;
}
@@ -130,7 +130,7 @@ class VerilatedVpioConst : public VerilatedVpio {
public:
explicit VerilatedVpioConst(vlsint32_t num)
: m_num(num) {}
: m_num{num} {}
virtual ~VerilatedVpioConst() override {}
static inline VerilatedVpioConst* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioConst*>(reinterpret_cast<VerilatedVpio*>(h));
@@ -145,8 +145,8 @@ class VerilatedVpioParam : public VerilatedVpio {
public:
VerilatedVpioParam(const VerilatedVar* varp, const VerilatedScope* scopep)
: m_varp(varp)
, m_scopep(scopep) {}
: m_varp{varp}
, m_scopep{scopep} {}
virtual ~VerilatedVpioParam() override {}
@@ -171,7 +171,7 @@ class VerilatedVpioRange : public VerilatedVpio {
public:
explicit VerilatedVpioRange(const VerilatedRange* range)
: m_range(range) {}
: m_range{range} {}
virtual ~VerilatedVpioRange() override {}
static inline VerilatedVpioRange* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioRange*>(reinterpret_cast<VerilatedVpio*>(h));
@@ -197,7 +197,7 @@ protected:
public:
explicit VerilatedVpioScope(const VerilatedScope* scopep)
: m_scopep(scopep) {}
: m_scopep{scopep} {}
virtual ~VerilatedVpioScope() override {}
static inline VerilatedVpioScope* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioScope*>(reinterpret_cast<VerilatedVpio*>(h));
@@ -227,9 +227,9 @@ protected:
public:
VerilatedVpioVar(const VerilatedVar* varp, const VerilatedScope* scopep)
: m_varp(varp)
, m_scopep(scopep)
, m_index(0) {
: m_varp{varp}
, m_scopep{scopep}
, m_index{0} {
m_prevDatap = nullptr;
m_mask.u32 = VL_MASK_I(varp->packed().elements());
m_entSize = varp->entSize();
@@ -272,7 +272,7 @@ class VerilatedVpioMemoryWord : public VerilatedVpioVar {
public:
VerilatedVpioMemoryWord(const VerilatedVar* varp, const VerilatedScope* scopep,
vlsint32_t index, int offset)
: VerilatedVpioVar(varp, scopep) {
: VerilatedVpioVar{varp, scopep} {
m_index = index;
m_varDatap = (static_cast<vluint8_t*>(varp->datap())) + entSize() * offset;
}
@@ -295,12 +295,11 @@ public:
class VerilatedVpioVarIter : public VerilatedVpio {
const VerilatedScope* m_scopep;
VerilatedVarNameMap::const_iterator m_it;
bool m_started;
bool m_started = false;
public:
explicit VerilatedVpioVarIter(const VerilatedScope* scopep)
: m_scopep(scopep)
, m_started(false) {}
: m_scopep{scopep} {}
virtual ~VerilatedVpioVarIter() override {}
static inline VerilatedVpioVarIter* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioVarIter*>(reinterpret_cast<VerilatedVpio*>(h));
@@ -329,15 +328,14 @@ class VerilatedVpioMemoryWordIter : public VerilatedVpio {
const VerilatedVar* m_varp;
vlsint32_t m_iteration;
vlsint32_t m_direction;
bool m_done;
bool m_done = false;
public:
VerilatedVpioMemoryWordIter(const vpiHandle handle, const VerilatedVar* varp)
: m_handle(handle)
, m_varp(varp)
, m_iteration(varp->unpacked().right())
, m_direction(VL_LIKELY(varp->unpacked().left() > varp->unpacked().right()) ? 1 : -1)
, m_done(false) {}
: m_handle{handle}
, m_varp{varp}
, m_iteration{varp->unpacked().right()}
, m_direction{VL_LIKELY(varp->unpacked().left() > varp->unpacked().right()) ? 1 : -1} {}
virtual ~VerilatedVpioMemoryWordIter() override {}
static inline VerilatedVpioMemoryWordIter* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioMemoryWordIter*>(reinterpret_cast<VerilatedVpio*>(h));
@@ -361,7 +359,7 @@ class VerilatedVpioModule : public VerilatedVpioScope {
public:
explicit VerilatedVpioModule(const VerilatedScope* modulep)
: VerilatedVpioScope(modulep) {
: VerilatedVpioScope{modulep} {
m_fullname = m_scopep->name();
if (strncmp(m_fullname, "TOP.", 4) == 0) m_fullname += 4;
m_name = m_scopep->identifier();
@@ -380,7 +378,7 @@ class VerilatedVpioModuleIter : public VerilatedVpio {
public:
explicit VerilatedVpioModuleIter(const std::vector<const VerilatedScope*>& vec)
: m_vec(&vec) {
: m_vec{&vec} {
m_it = m_vec->begin();
}
virtual ~VerilatedVpioModuleIter() override {}
@@ -529,7 +527,7 @@ class VerilatedVpiError {
//// Container for vpi error info
t_vpi_error_info m_errorInfo;
bool m_flag;
bool m_flag = false;
char m_buff[VL_VPI_LINE_SIZE];
void setError(PLI_BYTE8* message, PLI_BYTE8* code, PLI_BYTE8* file, PLI_INT32 line) {
m_errorInfo.message = message;
@@ -550,8 +548,7 @@ class VerilatedVpiError {
}
public:
VerilatedVpiError()
: m_flag(false) {
VerilatedVpiError() {
m_buff[0] = '\0';
m_errorInfo.product = const_cast<PLI_BYTE8*>(Verilated::productName());
}