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

This commit is contained in:
Wilson Snyder 2020-08-16 09:55:36 -04:00
parent 033e7ac020
commit 72d2cff0a1
117 changed files with 981 additions and 1469 deletions

View File

@ -255,8 +255,6 @@ Verilated::Serialized::Serialized() {
} }
Verilated::NonSerialized::NonSerialized() { Verilated::NonSerialized::NonSerialized() {
s_profThreadsStart = 1;
s_profThreadsWindow = 2;
s_profThreadsFilenamep = strdup("profile_threads.dat"); s_profThreadsFilenamep = strdup("profile_threads.dat");
} }
Verilated::NonSerialized::~NonSerialized() { 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) VlReadMem::VlReadMem(bool hex, int bits, const std::string& filename, QData start, QData end)
: m_hex(hex) : m_hex{hex}
, m_bits(bits) , m_bits{bits}
, m_filename(filename) , m_filename{filename}
, m_end(end) , m_end{end}
, m_addr(start) , m_addr{start}
, m_linenum(0) { , m_linenum{0} {
m_fp = fopen(filename.c_str(), "r"); m_fp = fopen(filename.c_str(), "r");
if (VL_UNLIKELY(!m_fp)) { if (VL_UNLIKELY(!m_fp)) {
// We don't report the Verilog source filename as it slow to have to pass it down // 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) VlWriteMem::VlWriteMem(bool hex, int bits, const std::string& filename, QData start, QData end)
: m_hex(hex) : m_hex{hex}
, m_bits(bits) , m_bits{bits}
, m_addr(0) { , m_addr{0} {
if (VL_UNLIKELY(start > end)) { if (VL_UNLIKELY(start > end)) {
VL_FATAL_MT(filename.c_str(), 0, "", "$writemem invalid address range"); VL_FATAL_MT(filename.c_str(), 0, "", "$writemem invalid address range");
return; return;
@ -2174,17 +2172,7 @@ void VL_TIMEFORMAT_IINI(int units, int precision, const std::string& suffix,
//=========================================================================== //===========================================================================
// Verilated:: Methods // Verilated:: Methods
Verilated::ThreadLocal::ThreadLocal() 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 { void Verilated::debug(int level) VL_MT_SAFE {
@ -2554,7 +2542,7 @@ VerilatedSyms::~VerilatedSyms() {
// VerilatedModule:: Methods // VerilatedModule:: Methods
VerilatedModule::VerilatedModule(const char* namep) VerilatedModule::VerilatedModule(const char* namep)
: m_namep(strdup(namep)) {} : m_namep{strdup(namep)} {}
VerilatedModule::~VerilatedModule() { VerilatedModule::~VerilatedModule() {
// Memory cleanup - not called during normal operation // Memory cleanup - not called during normal operation
@ -2601,16 +2589,7 @@ void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const
//====================================================================== //======================================================================
// VerilatedScope:: Methods // VerilatedScope:: Methods
VerilatedScope::VerilatedScope() { 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 // Memory cleanup - not called during normal operation

View File

@ -163,7 +163,7 @@ private:
public: public:
explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr)
: m_mutexr(mutexr) { : m_mutexr{mutexr} {
m_mutexr.lock(); m_mutexr.lock();
} }
~VerilatedLockGuard() VL_RELEASE() { m_mutexr.unlock(); } ~VerilatedLockGuard() VL_RELEASE() { m_mutexr.unlock(); }
@ -203,7 +203,7 @@ public:
/// The constructor establishes the thread id for all later calls. /// The constructor establishes the thread id for all later calls.
/// If necessary, a different class could be made that inits it otherwise. /// If necessary, a different class could be made that inits it otherwise.
VerilatedAssertOneThread() VerilatedAssertOneThread()
: m_threadid(VL_THREAD_ID()) {} : m_threadid{VL_THREAD_ID()} {}
~VerilatedAssertOneThread() { check(); } ~VerilatedAssertOneThread() { check(); }
// METHODS // METHODS
/// Check that the current thread ID is the same as the construction thread ID /// 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 } Type; // Type of a scope, currently module is only interesting
private: private:
// Fastpath: // Fastpath:
VerilatedSyms* m_symsp; ///< Symbol table VerilatedSyms* m_symsp = nullptr; ///< Symbol table
void** m_callbacksp; ///< Callback table pointer (Fastpath) void** m_callbacksp = nullptr; ///< Callback table pointer (Fastpath)
int m_funcnumMax; ///< Maxium function number stored (Fastpath) int m_funcnumMax = 0; ///< Maxium function number stored (Fastpath)
// 4 bytes padding (on -m64), for rent. // 4 bytes padding (on -m64), for rent.
VerilatedVarNameMap* m_varsp; ///< Variable map VerilatedVarNameMap* m_varsp = nullptr; ///< Variable map
const char* m_namep; ///< Scope name (Slowpath) const char* m_namep = nullptr; ///< Scope name (Slowpath)
const char* m_identifierp; ///< Identifier of scope (with escapes removed) const char* m_identifierp = nullptr; ///< Identifier of scope (with escapes removed)
vlsint8_t m_timeunit; ///< Timeunit in negative power-of-10 vlsint8_t m_timeunit = 0; ///< Timeunit in negative power-of-10
Type m_type; ///< Type of the scope Type m_type = SCOPE_OTHER; ///< Type of the scope
public: // But internals only - called from VerilatedModule's public: // But internals only - called from VerilatedModule's
VerilatedScope(); VerilatedScope();
@ -393,8 +393,8 @@ class Verilated {
static struct NonSerialized { // Non-serialized information static struct NonSerialized { // Non-serialized information
// These are reloaded from on command-line settings, so do not need to persist // These are reloaded from on command-line settings, so do not need to persist
// Fast path // Fast path
vluint64_t s_profThreadsStart; ///< +prof+threads starting time vluint64_t s_profThreadsStart = 1; ///< +prof+threads starting time
vluint32_t s_profThreadsWindow; ///< +prof+threads window size vluint32_t s_profThreadsWindow = 2; ///< +prof+threads window size
// Slow path // Slow path
const char* s_profThreadsFilenamep; ///< +prof+threads filename const char* s_profThreadsFilenamep; ///< +prof+threads filename
NonSerialized(); NonSerialized();
@ -405,23 +405,22 @@ class Verilated {
// assumption is that the restore is allowed to pass different arguments // assumption is that the restore is allowed to pass different arguments
static struct CommandArgValues { static struct CommandArgValues {
VerilatedMutex m_argMutex; ///< Mutex for s_args members, when VL_THREADED VerilatedMutex m_argMutex; ///< Mutex for s_args members, when VL_THREADED
int argc; int argc = 0;
const char** argv; const char** argv = nullptr;
CommandArgValues() CommandArgValues() {}
: argc(0)
, argv(nullptr) {}
~CommandArgValues() {} ~CommandArgValues() {}
} s_args; } s_args;
// Not covered by mutex, as per-thread // Not covered by mutex, as per-thread
static VL_THREAD_LOCAL struct ThreadLocal { static VL_THREAD_LOCAL struct ThreadLocal {
#ifdef VL_THREADED #ifdef VL_THREADED
vluint32_t t_mtaskId; ///< Current mtask# executing on this thread vluint32_t t_mtaskId = 0; ///< Current mtask# executing on this thread
vluint32_t t_endOfEvalReqd; ///< Messages may be pending, thread needs endOf-eval calls vluint32_t t_endOfEvalReqd
= 0; ///< Messages may be pending, thread needs endOf-eval calls
#endif #endif
const VerilatedScope* t_dpiScopep; ///< DPI context scope const VerilatedScope* t_dpiScopep = nullptr; ///< DPI context scope
const char* t_dpiFilename; ///< DPI context filename const char* t_dpiFilename = nullptr; ///< DPI context filename
int t_dpiLineno; ///< DPI context line number int t_dpiLineno = 0; ///< DPI context line number
ThreadLocal(); ThreadLocal();
~ThreadLocal(); ~ThreadLocal();

View File

@ -75,7 +75,7 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
// cppcheck-suppress noExplicitConstructor // cppcheck-suppress noExplicitConstructor
explicit VerilatedCoverItemSpec(T* countp) explicit VerilatedCoverItemSpec(T* countp)
: m_countp(countp) { : m_countp{countp} {
*m_countp = 0; *m_countp = 0;
} }
virtual ~VerilatedCoverItemSpec() override {} virtual ~VerilatedCoverItemSpec() override {}

View File

@ -58,9 +58,7 @@
// VerilatedFst // VerilatedFst
VerilatedFst::VerilatedFst(void* fst) VerilatedFst::VerilatedFst(void* fst)
: m_fst(fst) : m_fst{fst} {}
, m_symbolp(nullptr)
, m_strbuf(nullptr) {}
VerilatedFst::~VerilatedFst() { VerilatedFst::~VerilatedFst() {
if (m_fst) fstWriterClose(m_fst); if (m_fst) fstWriterClose(m_fst);

View File

@ -50,8 +50,8 @@ private:
Code2SymbolType m_code2symbol; Code2SymbolType m_code2symbol;
Local2FstDtype m_local2fstdtype; Local2FstDtype m_local2fstdtype;
std::list<std::string> m_curScope; std::list<std::string> m_curScope;
fstHandle* m_symbolp; ///< same as m_code2symbol, but as an array fstHandle* m_symbolp = nullptr; ///< same as m_code2symbol, but as an array
char* m_strbuf; ///< String buffer long enough to hold maxBits() chars char* m_strbuf = nullptr; ///< String buffer long enough to hold maxBits() chars
// CONSTRUCTORS // CONSTRUCTORS
VL_UNCOPYABLE(VerilatedFst); VL_UNCOPYABLE(VerilatedFst);
@ -136,7 +136,7 @@ class VerilatedFstC {
public: public:
explicit VerilatedFstC(void* filep = nullptr) explicit VerilatedFstC(void* filep = nullptr)
: m_sptrace(filep) {} : m_sptrace{filep} {}
~VerilatedFstC() { close(); } ~VerilatedFstC() { close(); }
/// Routines can only be called from one thread; allow next call from different thread /// Routines can only be called from one thread; allow next call from different thread
void changeThread() { spTrace()->changeThread(); } void changeThread() { spTrace()->changeThread(); }

View File

@ -62,8 +62,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
VerilatedMsg(const std::function<void()>& cb) VerilatedMsg(const std::function<void()>& cb)
: m_mtaskId(Verilated::mtaskId()) : m_mtaskId{Verilated::mtaskId()}
, m_cb(cb) {} , m_cb{cb} {}
~VerilatedMsg() {} ~VerilatedMsg() {}
// METHODS // METHODS
vluint32_t mtaskId() const { return m_mtaskId; } vluint32_t mtaskId() const { return m_mtaskId; }
@ -84,7 +84,7 @@ class VerilatedEvalMsgQueue {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
VerilatedEvalMsgQueue() VerilatedEvalMsgQueue()
: m_depth(0) { : m_depth{0} {
assert(atomic_is_lock_free(&m_depth)); assert(atomic_is_lock_free(&m_depth));
} }
~VerilatedEvalMsgQueue() {} ~VerilatedEvalMsgQueue() {}
@ -172,12 +172,11 @@ public:
// FILE* list constructed from a file-descriptor // FILE* list constructed from a file-descriptor
class VerilatedFpList { class VerilatedFpList {
FILE* m_fp[31]; FILE* m_fp[31];
std::size_t m_sz; std::size_t m_sz = 0;
public: public:
typedef FILE* const* const_iterator; typedef FILE* const* const_iterator;
explicit VerilatedFpList() explicit VerilatedFpList() {}
: m_sz(0) {}
const_iterator begin() const { return m_fp; } const_iterator begin() const { return m_fp; }
const_iterator end() const { return m_fp + m_sz; } const_iterator end() const { return m_fp + m_sz; }
std::size_t size() const { return 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 static VerilatedImp s_s; ///< Static Singleton; One and only static this
struct Serialized { // All these members serialized/deserialized struct Serialized { // All these members serialized/deserialized
int m_timeFormatUnits; // $timeformat units int m_timeFormatUnits = UNITS_NONE; // $timeformat units
int m_timeFormatPrecision; // $timeformat number of decimal places int m_timeFormatPrecision = 0; // $timeformat number of decimal places
int m_timeFormatWidth; // $timeformat character width int m_timeFormatWidth = 20; // $timeformat character width
enum { UNITS_NONE = 99 }; // Default based on precision enum { UNITS_NONE = 99 }; // Default based on precision
Serialized() Serialized() {}
: m_timeFormatUnits(UNITS_NONE)
, m_timeFormatPrecision(0)
, m_timeFormatWidth(20) {}
~Serialized() {} ~Serialized() {}
} m_ser; } m_ser;
@ -255,8 +251,8 @@ protected:
public: // But only for verilated*.cpp public: // But only for verilated*.cpp
// CONSTRUCTORS // CONSTRUCTORS
VerilatedImp() VerilatedImp()
: m_argVecLoaded(false) : m_argVecLoaded{false}
, m_exportNext(0) { , m_exportNext{0} {
s_s.m_fdps.resize(31); s_s.m_fdps.resize(31);
std::fill(s_s.m_fdps.begin(), s_s.m_fdps.end(), (FILE*)0); std::fill(s_s.m_fdps.begin(), s_s.m_fdps.end(), (FILE*)0);
s_s.m_fdFreeMct.resize(30); s_s.m_fdFreeMct.resize(30);

View File

@ -44,11 +44,11 @@ protected:
friend class VerilatedVarProps; friend class VerilatedVarProps;
friend class VerilatedScope; friend class VerilatedScope;
VerilatedRange() VerilatedRange()
: m_left(0) : m_left{0}
, m_right(0) {} , m_right{0} {}
VerilatedRange(int left, int right) VerilatedRange(int left, int right)
: m_left(left) : m_left{left}
, m_right(right) {} , m_right{right} {}
void init(int left, int right) { void init(int left, int right) {
m_left = left; m_left = left;
m_right = right; m_right = right;
@ -92,11 +92,11 @@ class VerilatedVarProps {
protected: protected:
friend class VerilatedScope; friend class VerilatedScope;
VerilatedVarProps(VerilatedVarType vltype, VerilatedVarFlags vlflags, int pdims, int udims) VerilatedVarProps(VerilatedVarType vltype, VerilatedVarFlags vlflags, int pdims, int udims)
: m_magic(MAGIC) : m_magic{MAGIC}
, m_vltype(vltype) , m_vltype{vltype}
, m_vlflags(vlflags) , m_vlflags{vlflags}
, m_pdims(pdims) , m_pdims{pdims}
, m_udims(udims) { , m_udims{udims} {
initUnpacked(nullptr); initUnpacked(nullptr);
} }
@ -104,36 +104,36 @@ public:
class Unpacked {}; class Unpacked {};
// Without packed // Without packed
VerilatedVarProps(VerilatedVarType vltype, int vlflags) VerilatedVarProps(VerilatedVarType vltype, int vlflags)
: m_magic(MAGIC) : m_magic{MAGIC}
, m_vltype(vltype) , m_vltype{vltype}
, m_vlflags(VerilatedVarFlags(vlflags)) , m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims(0) , m_pdims{0}
, m_udims(0) {} , m_udims{0} {}
VerilatedVarProps(VerilatedVarType vltype, int vlflags, Unpacked, int udims, const int* ulims) VerilatedVarProps(VerilatedVarType vltype, int vlflags, Unpacked, int udims, const int* ulims)
: m_magic(MAGIC) : m_magic{MAGIC}
, m_vltype(vltype) , m_vltype{vltype}
, m_vlflags(VerilatedVarFlags(vlflags)) , m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims(0) , m_pdims{0}
, m_udims(udims) { , m_udims{udims} {
initUnpacked(ulims); initUnpacked(ulims);
} }
// With packed // With packed
class Packed {}; class Packed {};
VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr) VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr)
: m_magic(MAGIC) : m_magic{MAGIC}
, m_vltype(vltype) , m_vltype{vltype}
, m_vlflags(VerilatedVarFlags(vlflags)) , m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims(1) , m_pdims{1}
, m_udims(0) , m_udims{0}
, m_packed(pl, pr) {} , m_packed{pl, pr} {}
VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr, Unpacked, VerilatedVarProps(VerilatedVarType vltype, int vlflags, Packed, int pl, int pr, Unpacked,
int udims, const int* ulims) int udims, const int* ulims)
: m_magic(MAGIC) : m_magic{MAGIC}
, m_vltype(vltype) , m_vltype{vltype}
, m_vlflags(VerilatedVarFlags(vlflags)) , m_vlflags{VerilatedVarFlags(vlflags)}
, m_pdims(1) , m_pdims{1}
, m_udims(udims) , m_udims{udims}
, m_packed(pl, pr) { , m_packed{pl, pr} {
initUnpacked(ulims); initUnpacked(ulims);
} }
@ -196,11 +196,11 @@ class VerilatedDpiOpenVar {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
VerilatedDpiOpenVar(const VerilatedVarProps* propsp, void* datap) VerilatedDpiOpenVar(const VerilatedVarProps* propsp, void* datap)
: m_propsp(propsp) : m_propsp{propsp}
, m_datap(datap) {} , m_datap{datap} {}
VerilatedDpiOpenVar(const VerilatedVarProps* propsp, const void* datap) VerilatedDpiOpenVar(const VerilatedVarProps* propsp, const void* datap)
: m_propsp(propsp) : m_propsp{propsp}
, m_datap(const_cast<void*>(datap)) {} , m_datap{const_cast<void*>(datap)} {}
~VerilatedDpiOpenVar() {} ~VerilatedDpiOpenVar() {}
// METHODS // METHODS
void* datap() const { return m_datap; } void* datap() const { return m_datap; }
@ -237,10 +237,10 @@ protected:
// CONSTRUCTORS // CONSTRUCTORS
VerilatedVar(const char* namep, void* datap, VerilatedVarType vltype, VerilatedVar(const char* namep, void* datap, VerilatedVarType vltype,
VerilatedVarFlags vlflags, int dims, bool isParam) VerilatedVarFlags vlflags, int dims, bool isParam)
: VerilatedVarProps(vltype, vlflags, (dims > 0 ? 1 : 0), ((dims > 1) ? dims - 1 : 0)) : VerilatedVarProps{vltype, vlflags, (dims > 0 ? 1 : 0), ((dims > 1) ? dims - 1 : 0)}
, m_datap(datap) , m_datap{datap}
, m_namep(namep) , m_namep{namep}
, m_isParam(isParam) {} , m_isParam{isParam} {}
public: public:
~VerilatedVar() {} ~VerilatedVar() {}

View File

@ -27,8 +27,8 @@ VL_THREAD_LOCAL VlThreadPool::ProfileTrace* VlThreadPool::t_profilep = nullptr;
// VlMTaskVertex // VlMTaskVertex
VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount) VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount)
: m_upstreamDepsDone(0) : m_upstreamDepsDone{0}
, m_upstreamDepCount(upstreamDepCount) { , m_upstreamDepCount{upstreamDepCount} {
assert(atomic_is_lock_free(&m_upstreamDepsDone)); assert(atomic_is_lock_free(&m_upstreamDepsDone));
} }
@ -36,13 +36,11 @@ VlMTaskVertex::VlMTaskVertex(vluint32_t upstreamDepCount)
// VlWorkerThread // VlWorkerThread
VlWorkerThread::VlWorkerThread(VlThreadPool* poolp, bool profiling) VlWorkerThread::VlWorkerThread(VlThreadPool* poolp, bool profiling)
: m_waiting(false) : m_waiting{false}
, m_ready_size(0) , m_poolp{poolp}
, m_poolp(poolp) , m_profiling{profiling} // Must init this last -- after setting up fields that it might read:
, m_profiling(profiling) , m_exiting{false}
, m_exiting(false) , m_cthread{startWorker, this} {}
// Must init this last -- after setting up fields that it might read:
, m_cthread(startWorker, this) {}
VlWorkerThread::~VlWorkerThread() { VlWorkerThread::~VlWorkerThread() {
m_exiting.store(true, std::memory_order_release); m_exiting.store(true, std::memory_order_release);
@ -78,7 +76,7 @@ void VlWorkerThread::startWorker(VlWorkerThread* workerp) { workerp->workerLoop(
// VlThreadPool // VlThreadPool
VlThreadPool::VlThreadPool(int nThreads, bool profiling) 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 // --threads N passes nThreads=N-1, as the "main" threads counts as 1
unsigned cpus = std::thread::hardware_concurrency(); unsigned cpus = std::thread::hardware_concurrency();
if (cpus < nThreads + 1) { if (cpus < nThreads + 1) {

View File

@ -119,23 +119,16 @@ class VlProfileRec {
protected: protected:
friend class VlThreadPool; friend class VlThreadPool;
enum VlProfileE { TYPE_MTASK_RUN, TYPE_BARRIER }; enum VlProfileE { TYPE_MTASK_RUN, TYPE_BARRIER };
VlProfileE m_type; // Record type VlProfileE m_type = TYPE_BARRIER; // Record type
vluint32_t m_mtaskId; // Mtask we're logging vluint32_t m_mtaskId = 0; // Mtask we're logging
vluint32_t m_predictTime; // How long scheduler predicted would take vluint32_t m_predictTime = 0; // How long scheduler predicted would take
vluint64_t m_startTime; // Tick at start of execution vluint64_t m_startTime = 0; // Tick at start of execution
vluint64_t m_endTime; // Tick at end of execution vluint64_t m_endTime = 0; // Tick at end of execution
unsigned m_cpu; // Execution CPU number (at start anyways) unsigned m_cpu; // Execution CPU number (at start anyways)
public: public:
class Barrier {}; class Barrier {};
VlProfileRec() {} VlProfileRec() {}
explicit VlProfileRec(Barrier) { explicit VlProfileRec(Barrier) { m_cpu = getcpu(); }
m_type = TYPE_BARRIER;
m_mtaskId = 0;
m_predictTime = 0;
m_startTime = 0;
m_endTime = 0;
m_cpu = getcpu();
}
void startRecord(vluint64_t time, uint32_t mtask, uint32_t predict) { void startRecord(vluint64_t time, uint32_t mtask, uint32_t predict) {
m_type = VlProfileRec::TYPE_MTASK_RUN; m_type = VlProfileRec::TYPE_MTASK_RUN;
m_mtaskId = mtask; m_mtaskId = mtask;
@ -174,13 +167,13 @@ private:
VlThrSymTab m_sym; // Symbol table to execute VlThrSymTab m_sym; // Symbol table to execute
bool m_evenCycle; // Even/odd for flag alternation bool m_evenCycle; // Even/odd for flag alternation
ExecRec() ExecRec()
: m_fnp(nullptr) : m_fnp{nullptr}
, m_sym(nullptr) , m_sym{nullptr}
, m_evenCycle(false) {} , m_evenCycle{false} {}
ExecRec(VlExecFnp fnp, bool evenCycle, VlThrSymTab sym) ExecRec(VlExecFnp fnp, bool evenCycle, VlThrSymTab sym)
: m_fnp(fnp) : m_fnp{fnp}
, m_sym(sym) , m_sym{sym}
, m_evenCycle(evenCycle) {} , m_evenCycle{evenCycle} {}
}; };
// MEMBERS // MEMBERS

View File

@ -130,11 +130,11 @@ private:
}; };
void* m_userp; // The user pointer to pass to the callback (the symbol table) void* m_userp; // The user pointer to pass to the callback (the symbol table)
CallbackRecord(initCb_t cb, void* userp) CallbackRecord(initCb_t cb, void* userp)
: m_initCb(cb) : m_initCb{cb}
, m_userp(userp) {} , m_userp{userp} {}
CallbackRecord(dumpCb_t cb, void* userp) CallbackRecord(dumpCb_t cb, void* userp)
: m_dumpCb(cb) : m_dumpCb{cb}
, m_userp(userp) {} , m_userp{userp} {}
}; };
vluint32_t* m_sigs_oldvalp; ///< Old value store vluint32_t* m_sigs_oldvalp; ///< Old value store

View File

@ -276,17 +276,19 @@ template <> void VerilatedTrace<VL_DERIVED_T>::onExit(void* selfp) {
template <> template <>
VerilatedTrace<VL_DERIVED_T>::VerilatedTrace() VerilatedTrace<VL_DERIVED_T>::VerilatedTrace()
: m_sigs_oldvalp(nullptr) : m_sigs_oldvalp{nullptr}
, m_timeLastDump(0) , m_timeLastDump{0}
, m_fullDump(true) , m_fullDump{true}
, m_nextCode(0) , m_nextCode{0}
, m_numSignals(0) , m_numSignals{0}
, m_maxBits(0) , m_maxBits{0}
, m_scopeEscape('.') , m_scopeEscape{'.'}
, m_timeRes(1e-9) , m_timeRes{1e-9}
, m_timeUnit(1e-9) , m_timeUnit {
1e-9
}
#ifdef VL_TRACE_THREADED #ifdef VL_TRACE_THREADED
, m_numTraceBuffers(0) , m_numTraceBuffers { 0 }
#endif #endif
{ {
set_time_unit(Verilated::timeunitString()); set_time_unit(Verilated::timeunitString());

View File

@ -88,20 +88,14 @@ ssize_t VerilatedVcdFile::write(const char* bufp, ssize_t len) VL_MT_UNSAFE {
//============================================================================= //=============================================================================
// Opening/Closing // Opening/Closing
VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep) VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep) {
: m_isOpen(false)
, m_rolloverMB(0)
, m_modDepth(0) {
// Not in header to avoid link issue if header is included without this .cpp file // Not in header to avoid link issue if header is included without this .cpp file
m_fileNewed = (filep == nullptr); m_fileNewed = (filep == nullptr);
m_filep = m_fileNewed ? new VerilatedVcdFile : filep; m_filep = m_fileNewed ? new VerilatedVcdFile : filep;
m_namemapp = nullptr;
m_evcd = false;
m_wrChunkSize = 8 * 1024; m_wrChunkSize = 8 * 1024;
m_wrBufp = new char[m_wrChunkSize * 8]; m_wrBufp = new char[m_wrChunkSize * 8];
m_wrFlushp = m_wrBufp + m_wrChunkSize * 6; m_wrFlushp = m_wrBufp + m_wrChunkSize * 6;
m_writep = m_wrBufp; m_writep = m_wrBufp;
m_wroteBytes = 0;
m_suffixesp = nullptr; m_suffixesp = nullptr;
} }

View File

@ -61,23 +61,23 @@ private:
VerilatedVcdFile* m_filep; ///< File we're writing to VerilatedVcdFile* m_filep; ///< File we're writing to
bool m_fileNewed; ///< m_filep needs destruction bool m_fileNewed; ///< m_filep needs destruction
bool m_isOpen; ///< True indicates open file bool m_isOpen = false; ///< True indicates open file
bool m_evcd; ///< True for evcd format bool m_evcd = false; ///< True for evcd format
std::string m_filename; ///< Filename we're writing to (if open) std::string m_filename; ///< Filename we're writing to (if open)
vluint64_t m_rolloverMB; ///< MB of file size to rollover at vluint64_t m_rolloverMB = 0; ///< MB of file size to rollover at
int m_modDepth; ///< Depth of module hierarchy int m_modDepth = 0; ///< Depth of module hierarchy
char* m_wrBufp; ///< Output buffer char* m_wrBufp; ///< Output buffer
char* m_wrFlushp; ///< Output buffer flush trigger location char* m_wrFlushp; ///< Output buffer flush trigger location
char* m_writep; ///< Write pointer into output buffer char* m_writep; ///< Write pointer into output buffer
vluint64_t m_wrChunkSize; ///< Output buffer size 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 std::vector<char> m_suffixes; ///< VCD line end string codes + metadata
const char* m_suffixesp; ///< Pointer to first element of above const char* m_suffixesp; ///< Pointer to first element of above
typedef std::map<std::string, std::string> NameMap; 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 bufferResize(vluint64_t minsize);
void bufferFlush() VL_MT_UNSAFE_ONE; void bufferFlush() VL_MT_UNSAFE_ONE;
@ -337,7 +337,7 @@ class VerilatedVcdC {
public: public:
explicit VerilatedVcdC(VerilatedVcdFile* filep = nullptr) explicit VerilatedVcdC(VerilatedVcdFile* filep = nullptr)
: m_sptrace(filep) {} : m_sptrace{filep} {}
~VerilatedVcdC() { close(); } ~VerilatedVcdC() { close(); }
/// Routines can only be called from one thread; allow next call from different thread /// Routines can only be called from one thread; allow next call from different thread
void changeThread() { spTrace()->changeThread(); } void changeThread() { spTrace()->changeThread(); }

View File

@ -109,8 +109,8 @@ class VerilatedVpioCb : public VerilatedVpio {
public: public:
// cppcheck-suppress uninitVar // m_value // cppcheck-suppress uninitVar // m_value
VerilatedVpioCb(const t_cb_data* cbDatap, QData time) VerilatedVpioCb(const t_cb_data* cbDatap, QData time)
: m_cbData(*cbDatap) : m_cbData{*cbDatap}
, m_time(time) { , m_time{time} {
m_value.format = cbDatap->value ? cbDatap->value->format : vpiSuppressVal; m_value.format = cbDatap->value ? cbDatap->value->format : vpiSuppressVal;
m_cbData.value = &m_value; m_cbData.value = &m_value;
} }
@ -130,7 +130,7 @@ class VerilatedVpioConst : public VerilatedVpio {
public: public:
explicit VerilatedVpioConst(vlsint32_t num) explicit VerilatedVpioConst(vlsint32_t num)
: m_num(num) {} : m_num{num} {}
virtual ~VerilatedVpioConst() override {} virtual ~VerilatedVpioConst() override {}
static inline VerilatedVpioConst* castp(vpiHandle h) { static inline VerilatedVpioConst* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioConst*>(reinterpret_cast<VerilatedVpio*>(h)); return dynamic_cast<VerilatedVpioConst*>(reinterpret_cast<VerilatedVpio*>(h));
@ -145,8 +145,8 @@ class VerilatedVpioParam : public VerilatedVpio {
public: public:
VerilatedVpioParam(const VerilatedVar* varp, const VerilatedScope* scopep) VerilatedVpioParam(const VerilatedVar* varp, const VerilatedScope* scopep)
: m_varp(varp) : m_varp{varp}
, m_scopep(scopep) {} , m_scopep{scopep} {}
virtual ~VerilatedVpioParam() override {} virtual ~VerilatedVpioParam() override {}
@ -171,7 +171,7 @@ class VerilatedVpioRange : public VerilatedVpio {
public: public:
explicit VerilatedVpioRange(const VerilatedRange* range) explicit VerilatedVpioRange(const VerilatedRange* range)
: m_range(range) {} : m_range{range} {}
virtual ~VerilatedVpioRange() override {} virtual ~VerilatedVpioRange() override {}
static inline VerilatedVpioRange* castp(vpiHandle h) { static inline VerilatedVpioRange* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioRange*>(reinterpret_cast<VerilatedVpio*>(h)); return dynamic_cast<VerilatedVpioRange*>(reinterpret_cast<VerilatedVpio*>(h));
@ -197,7 +197,7 @@ protected:
public: public:
explicit VerilatedVpioScope(const VerilatedScope* scopep) explicit VerilatedVpioScope(const VerilatedScope* scopep)
: m_scopep(scopep) {} : m_scopep{scopep} {}
virtual ~VerilatedVpioScope() override {} virtual ~VerilatedVpioScope() override {}
static inline VerilatedVpioScope* castp(vpiHandle h) { static inline VerilatedVpioScope* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioScope*>(reinterpret_cast<VerilatedVpio*>(h)); return dynamic_cast<VerilatedVpioScope*>(reinterpret_cast<VerilatedVpio*>(h));
@ -227,9 +227,9 @@ protected:
public: public:
VerilatedVpioVar(const VerilatedVar* varp, const VerilatedScope* scopep) VerilatedVpioVar(const VerilatedVar* varp, const VerilatedScope* scopep)
: m_varp(varp) : m_varp{varp}
, m_scopep(scopep) , m_scopep{scopep}
, m_index(0) { , m_index{0} {
m_prevDatap = nullptr; m_prevDatap = nullptr;
m_mask.u32 = VL_MASK_I(varp->packed().elements()); m_mask.u32 = VL_MASK_I(varp->packed().elements());
m_entSize = varp->entSize(); m_entSize = varp->entSize();
@ -272,7 +272,7 @@ class VerilatedVpioMemoryWord : public VerilatedVpioVar {
public: public:
VerilatedVpioMemoryWord(const VerilatedVar* varp, const VerilatedScope* scopep, VerilatedVpioMemoryWord(const VerilatedVar* varp, const VerilatedScope* scopep,
vlsint32_t index, int offset) vlsint32_t index, int offset)
: VerilatedVpioVar(varp, scopep) { : VerilatedVpioVar{varp, scopep} {
m_index = index; m_index = index;
m_varDatap = (static_cast<vluint8_t*>(varp->datap())) + entSize() * offset; m_varDatap = (static_cast<vluint8_t*>(varp->datap())) + entSize() * offset;
} }
@ -295,12 +295,11 @@ public:
class VerilatedVpioVarIter : public VerilatedVpio { class VerilatedVpioVarIter : public VerilatedVpio {
const VerilatedScope* m_scopep; const VerilatedScope* m_scopep;
VerilatedVarNameMap::const_iterator m_it; VerilatedVarNameMap::const_iterator m_it;
bool m_started; bool m_started = false;
public: public:
explicit VerilatedVpioVarIter(const VerilatedScope* scopep) explicit VerilatedVpioVarIter(const VerilatedScope* scopep)
: m_scopep(scopep) : m_scopep{scopep} {}
, m_started(false) {}
virtual ~VerilatedVpioVarIter() override {} virtual ~VerilatedVpioVarIter() override {}
static inline VerilatedVpioVarIter* castp(vpiHandle h) { static inline VerilatedVpioVarIter* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioVarIter*>(reinterpret_cast<VerilatedVpio*>(h)); return dynamic_cast<VerilatedVpioVarIter*>(reinterpret_cast<VerilatedVpio*>(h));
@ -329,15 +328,14 @@ class VerilatedVpioMemoryWordIter : public VerilatedVpio {
const VerilatedVar* m_varp; const VerilatedVar* m_varp;
vlsint32_t m_iteration; vlsint32_t m_iteration;
vlsint32_t m_direction; vlsint32_t m_direction;
bool m_done; bool m_done = false;
public: public:
VerilatedVpioMemoryWordIter(const vpiHandle handle, const VerilatedVar* varp) VerilatedVpioMemoryWordIter(const vpiHandle handle, const VerilatedVar* varp)
: m_handle(handle) : m_handle{handle}
, m_varp(varp) , m_varp{varp}
, m_iteration(varp->unpacked().right()) , m_iteration{varp->unpacked().right()}
, m_direction(VL_LIKELY(varp->unpacked().left() > varp->unpacked().right()) ? 1 : -1) , m_direction{VL_LIKELY(varp->unpacked().left() > varp->unpacked().right()) ? 1 : -1} {}
, m_done(false) {}
virtual ~VerilatedVpioMemoryWordIter() override {} virtual ~VerilatedVpioMemoryWordIter() override {}
static inline VerilatedVpioMemoryWordIter* castp(vpiHandle h) { static inline VerilatedVpioMemoryWordIter* castp(vpiHandle h) {
return dynamic_cast<VerilatedVpioMemoryWordIter*>(reinterpret_cast<VerilatedVpio*>(h)); return dynamic_cast<VerilatedVpioMemoryWordIter*>(reinterpret_cast<VerilatedVpio*>(h));
@ -361,7 +359,7 @@ class VerilatedVpioModule : public VerilatedVpioScope {
public: public:
explicit VerilatedVpioModule(const VerilatedScope* modulep) explicit VerilatedVpioModule(const VerilatedScope* modulep)
: VerilatedVpioScope(modulep) { : VerilatedVpioScope{modulep} {
m_fullname = m_scopep->name(); m_fullname = m_scopep->name();
if (strncmp(m_fullname, "TOP.", 4) == 0) m_fullname += 4; if (strncmp(m_fullname, "TOP.", 4) == 0) m_fullname += 4;
m_name = m_scopep->identifier(); m_name = m_scopep->identifier();
@ -380,7 +378,7 @@ class VerilatedVpioModuleIter : public VerilatedVpio {
public: public:
explicit VerilatedVpioModuleIter(const std::vector<const VerilatedScope*>& vec) explicit VerilatedVpioModuleIter(const std::vector<const VerilatedScope*>& vec)
: m_vec(&vec) { : m_vec{&vec} {
m_it = m_vec->begin(); m_it = m_vec->begin();
} }
virtual ~VerilatedVpioModuleIter() override {} virtual ~VerilatedVpioModuleIter() override {}
@ -529,7 +527,7 @@ class VerilatedVpiError {
//// Container for vpi error info //// Container for vpi error info
t_vpi_error_info m_errorInfo; t_vpi_error_info m_errorInfo;
bool m_flag; bool m_flag = false;
char m_buff[VL_VPI_LINE_SIZE]; char m_buff[VL_VPI_LINE_SIZE];
void setError(PLI_BYTE8* message, PLI_BYTE8* code, PLI_BYTE8* file, PLI_INT32 line) { void setError(PLI_BYTE8* message, PLI_BYTE8* code, PLI_BYTE8* file, PLI_INT32 line) {
m_errorInfo.message = message; m_errorInfo.message = message;
@ -550,8 +548,7 @@ class VerilatedVpiError {
} }
public: public:
VerilatedVpiError() VerilatedVpiError() {
: m_flag(false) {
m_buff[0] = '\0'; m_buff[0] = '\0';
m_errorInfo.product = const_cast<PLI_BYTE8*>(Verilated::productName()); m_errorInfo.product = const_cast<PLI_BYTE8*>(Verilated::productName());
} }

View File

@ -202,8 +202,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
ActiveDlyVisitor(AstNode* nodep, CheckType check) ActiveDlyVisitor(AstNode* nodep, CheckType check)
: m_check(check) : m_check{check}
, m_alwaysp(nodep) { , m_alwaysp{nodep} {
iterate(nodep); iterate(nodep);
} }
virtual ~ActiveDlyVisitor() override {} virtual ~ActiveDlyVisitor() override {}

View File

@ -34,9 +34,9 @@ private:
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// STATE // STATE
AstNodeModule* m_modp; // Last module AstNodeModule* m_modp = nullptr; // Last module
AstBegin* m_beginp; // Last begin AstBegin* m_beginp = nullptr; // Last begin
unsigned m_modPastNum; // Module past numbering unsigned m_modPastNum = 0; // Module past numbering
VDouble0 m_statCover; // Statistic tracking VDouble0 m_statCover; // Statistic tracking
VDouble0 m_statAsNotImm; // Statistic tracking VDouble0 m_statAsNotImm; // Statistic tracking
VDouble0 m_statAsImm; // Statistic tracking VDouble0 m_statAsImm; // Statistic tracking
@ -385,13 +385,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit AssertVisitor(AstNetlist* nodep) { explicit AssertVisitor(AstNetlist* nodep) { iterate(nodep); }
m_beginp = nullptr;
m_modp = nullptr;
m_modPastNum = 0;
// Process
iterate(nodep);
}
virtual ~AssertVisitor() override { virtual ~AssertVisitor() override {
V3Stats::addStat("Assertions, assert non-immediate statements", m_statAsNotImm); V3Stats::addStat("Assertions, assert non-immediate statements", m_statAsNotImm);
V3Stats::addStat("Assertions, assert immediate statements", m_statAsImm); V3Stats::addStat("Assertions, assert immediate statements", m_statAsImm);

View File

@ -34,11 +34,11 @@ private:
// NODE STATE/TYPES // NODE STATE/TYPES
// STATE // STATE
// Reset each module: // Reset each module:
AstSenItem* m_seniDefaultp; // Default sensitivity (from AstDefClock) AstSenItem* m_seniDefaultp = nullptr; // Default sensitivity (from AstDefClock)
// Reset each assertion: // Reset each assertion:
AstSenItem* m_senip; // Last sensitivity AstSenItem* m_senip = nullptr; // Last sensitivity
// Reset each always: // Reset each always:
AstSenItem* m_seniAlwaysp; // Last sensitivity in always AstSenItem* m_seniAlwaysp = nullptr; // Last sensitivity in always
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -170,8 +170,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit AssertPreVisitor(AstNetlist* nodep) { explicit AssertPreVisitor(AstNetlist* nodep) {
m_seniDefaultp = nullptr;
m_seniAlwaysp = nullptr;
clearAssertInfo(); clearAssertInfo();
// Process // Process
iterate(nodep); iterate(nodep);

View File

@ -212,7 +212,7 @@ AstNodeBiop* AstEqWild::newTyped(FileLine* fl, AstNode* lhsp, AstNode* rhsp) {
} }
AstExecGraph::AstExecGraph(FileLine* fileline) AstExecGraph::AstExecGraph(FileLine* fileline)
: AstNode(AstType::atExecGraph, fileline) { : AstNode{AstType::atExecGraph, fileline} {
m_depGraphp = new V3Graph; m_depGraphp = new V3Graph;
} }
AstExecGraph::~AstExecGraph() { VL_DO_DANGLING(delete m_depGraphp, m_depGraphp); } AstExecGraph::~AstExecGraph() { VL_DO_DANGLING(delete m_depGraphp, m_depGraphp); }

View File

@ -250,7 +250,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
BeginVisitor(AstNetlist* nodep, BeginState* statep) BeginVisitor(AstNetlist* nodep, BeginState* statep)
: m_statep(statep) { : m_statep{statep} {
iterate(nodep); iterate(nodep);
} }
virtual ~BeginVisitor() override {} virtual ~BeginVisitor() override {}

View File

@ -67,7 +67,7 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CUseState(AstNodeModule* nodep) explicit CUseState(AstNodeModule* nodep)
: m_modInsertp(nodep) {} : m_modInsertp{nodep} {}
virtual ~CUseState() {} virtual ~CUseState() {}
VL_UNCOPYABLE(CUseState); VL_UNCOPYABLE(CUseState);
}; };
@ -107,7 +107,7 @@ class CUseDTypeVisitor : public AstNVisitor {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CUseDTypeVisitor(AstNodeModule* nodep, CUseState& stater) explicit CUseDTypeVisitor(AstNodeModule* nodep, CUseState& stater)
: m_stater(stater) { : m_stater{stater} {
iterate(nodep); iterate(nodep);
} }
virtual ~CUseDTypeVisitor() override {} virtual ~CUseDTypeVisitor() override {}
@ -208,7 +208,7 @@ class CUseVisitor : public AstNVisitor {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CUseVisitor(AstNodeModule* nodep) explicit CUseVisitor(AstNodeModule* nodep)
: m_state(nodep) { : m_state{nodep} {
iterate(nodep); iterate(nodep);
} }
virtual ~CUseVisitor() override {} virtual ~CUseVisitor() override {}

View File

@ -52,7 +52,8 @@
class CaseLintVisitor : public AstNVisitor { class CaseLintVisitor : public AstNVisitor {
private: private:
AstNodeCase* m_caseExprp; // Under a CASE value node, if so the relevant case statement AstNodeCase* m_caseExprp
= nullptr; // Under a CASE value node, if so the relevant case statement
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -109,10 +110,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CaseLintVisitor(AstNodeCase* nodep) { explicit CaseLintVisitor(AstNodeCase* nodep) { iterate(nodep); }
m_caseExprp = nullptr;
iterate(nodep);
}
virtual ~CaseLintVisitor() override {} virtual ~CaseLintVisitor() override {}
}; };
@ -131,9 +129,9 @@ private:
VDouble0 m_statCaseSlow; // Statistic tracking VDouble0 m_statCaseSlow; // Statistic tracking
// Per-CASE // Per-CASE
int m_caseWidth; // Width of valueItems int m_caseWidth = 0; // Width of valueItems
int m_caseItems; // Number of caseItem unique values int m_caseItems = 0; // Number of caseItem unique values
bool m_caseNoOverlapsAllCovered; // Proven to be synopsys parallel_case compliant bool m_caseNoOverlapsAllCovered = false; // Proven to be synopsys parallel_case compliant
// For each possible value, the case branch we need // For each possible value, the case branch we need
AstNode* m_valueItem[1 << CASE_OVERLAP_WIDTH]; AstNode* m_valueItem[1 << CASE_OVERLAP_WIDTH];
@ -488,9 +486,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CaseVisitor(AstNetlist* nodep) { explicit CaseVisitor(AstNetlist* nodep) {
m_caseWidth = 0;
m_caseItems = 0;
m_caseNoOverlapsAllCovered = false;
for (uint32_t i = 0; i < (1UL << CASE_OVERLAP_WIDTH); ++i) m_valueItem[i] = nullptr; for (uint32_t i = 0; i < (1UL << CASE_OVERLAP_WIDTH); ++i) m_valueItem[i] = nullptr;
iterate(nodep); iterate(nodep);
} }

View File

@ -60,12 +60,12 @@ class CdcEitherVertex : public V3GraphVertex {
public: public:
CdcEitherVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep) CdcEitherVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_scopep(scopep) , m_scopep{scopep}
, m_nodep(nodep) , m_nodep{nodep}
, m_srcDomainSet(false) , m_srcDomainSet{false}
, m_dstDomainSet(false) , m_dstDomainSet{false}
, m_asyncPath(false) {} , m_asyncPath{false} {}
virtual ~CdcEitherVertex() override {} virtual ~CdcEitherVertex() override {}
// ACCESSORS // ACCESSORS
virtual FileLine* fileline() const override { return nodep()->fileline(); } virtual FileLine* fileline() const override { return nodep()->fileline(); }
@ -90,8 +90,8 @@ class CdcVarVertex : public CdcEitherVertex {
public: public:
CdcVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) CdcVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: CdcEitherVertex(graphp, scopep, varScp) : CdcEitherVertex{graphp, scopep, varScp}
, m_varScp(varScp) {} , m_varScp{varScp} {}
virtual ~CdcVarVertex() override {} virtual ~CdcVarVertex() override {}
// ACCESSORS // ACCESSORS
AstVarScope* varScp() const { return m_varScp; } AstVarScope* varScp() const { return m_varScp; }
@ -111,9 +111,9 @@ class CdcLogicVertex : public CdcEitherVertex {
public: public:
CdcLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstSenTree* sensenodep) CdcLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstSenTree* sensenodep)
: CdcEitherVertex(graphp, scopep, nodep) : CdcEitherVertex{graphp, scopep, nodep}
, m_hazard(false) , m_hazard{false}
, m_isFlop(false) { , m_isFlop{false} {
srcDomainp(sensenodep); srcDomainp(sensenodep);
dstDomainp(sensenodep); dstDomainp(sensenodep);
} }
@ -166,8 +166,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
CdcDumpVisitor(AstNode* nodep, std::ofstream* ofp, const string& prefix) CdcDumpVisitor(AstNode* nodep, std::ofstream* ofp, const string& prefix)
: m_ofp(ofp) : m_ofp{ofp}
, m_prefix(prefix) { , m_prefix{prefix} {
iterate(nodep); iterate(nodep);
} }
virtual ~CdcDumpVisitor() override {} virtual ~CdcDumpVisitor() override {}
@ -177,8 +177,8 @@ public:
class CdcWidthVisitor : public CdcBaseVisitor { class CdcWidthVisitor : public CdcBaseVisitor {
private: private:
int m_maxLineno; int m_maxLineno = 0;
size_t m_maxFilenameLen; size_t m_maxFilenameLen = 0;
virtual void visit(AstNode* nodep) override { virtual void visit(AstNode* nodep) override {
iterateChildren(nodep); iterateChildren(nodep);
@ -193,11 +193,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CdcWidthVisitor(AstNode* nodep) { explicit CdcWidthVisitor(AstNode* nodep) { iterate(nodep); }
m_maxLineno = 0;
m_maxFilenameLen = 0;
iterate(nodep);
}
virtual ~CdcWidthVisitor() override {} virtual ~CdcWidthVisitor() override {}
// ACCESSORS // ACCESSORS
int maxWidth() { int maxWidth() {
@ -227,16 +223,16 @@ private:
// STATE // STATE
V3Graph m_graph; // Scoreboard of var usages/dependencies V3Graph m_graph; // Scoreboard of var usages/dependencies
CdcLogicVertex* m_logicVertexp; // Current statement being tracked, nullptr=ignored CdcLogicVertex* m_logicVertexp = nullptr; // Current statement being tracked, nullptr=ignored
AstScope* m_scopep; // Current scope being processed AstScope* m_scopep = nullptr; // Current scope being processed
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstSenTree* m_domainp; // Current sentree AstSenTree* m_domainp = nullptr; // Current sentree
bool m_inDly; // In delayed assign bool m_inDly = false; // In delayed assign
int m_inSenItem; // Number of senitems int m_inSenItem = 0; // Number of senitems
string m_ofFilename; // Output filename string m_ofFilename; // Output filename
std::ofstream* m_ofp; // Output file std::ofstream* m_ofp; // Output file
uint32_t m_userGeneration; // Generation count to avoid slow userClearVertices uint32_t m_userGeneration = 0; // Generation count to avoid slow userClearVertices
int m_filelineWidth; // Characters in longest fileline int m_filelineWidth = 0; // Characters in longest fileline
// METHODS // METHODS
void iterateNewStmt(AstNode* nodep) { void iterateNewStmt(AstNode* nodep) {
@ -735,15 +731,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CdcVisitor(AstNode* nodep) { explicit CdcVisitor(AstNode* nodep) {
m_logicVertexp = nullptr;
m_scopep = nullptr;
m_modp = nullptr;
m_domainp = nullptr;
m_inDly = false;
m_inSenItem = 0;
m_userGeneration = 0;
m_filelineWidth = 0;
// Make report of all signal names and what clock edges they have // Make report of all signal names and what clock edges they have
string filename = v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__cdc.txt"; string filename = v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__cdc.txt";
m_ofp = V3File::new_ofstream(filename); m_ofp = V3File::new_ofstream(filename);

View File

@ -278,7 +278,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
ChangedVisitor(AstNetlist* nodep, ChangedState* statep) ChangedVisitor(AstNetlist* nodep, ChangedState* statep)
: m_statep(statep) { : m_statep{statep} {
iterate(nodep); iterate(nodep);
} }
virtual ~ChangedVisitor() override {} virtual ~ChangedVisitor() override {}

View File

@ -50,7 +50,7 @@ private:
enum CleanState { CS_UNKNOWN, CS_CLEAN, CS_DIRTY }; enum CleanState { CS_UNKNOWN, CS_CLEAN, CS_DIRTY };
// STATE // STATE
AstNodeModule* m_modp; AstNodeModule* m_modp = nullptr;
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -300,10 +300,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CleanVisitor(AstNetlist* nodep) { explicit CleanVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modp = nullptr;
iterate(nodep);
}
virtual ~CleanVisitor() override {} virtual ~CleanVisitor() override {}
}; };

View File

@ -48,16 +48,16 @@ private:
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstTopScope* m_topScopep; // Current top scope AstTopScope* m_topScopep = nullptr; // Current top scope
AstScope* m_scopep; // Current scope AstScope* m_scopep = nullptr; // Current scope
AstCFunc* m_evalFuncp; // Top eval function we are creating AstCFunc* m_evalFuncp = nullptr; // Top eval function we are creating
AstCFunc* m_initFuncp; // Top initial function we are creating AstCFunc* m_initFuncp = nullptr; // Top initial function we are creating
AstCFunc* m_finalFuncp; // Top final function we are creating AstCFunc* m_finalFuncp = nullptr; // Top final function we are creating
AstCFunc* m_settleFuncp; // Top settlement function we are creating AstCFunc* m_settleFuncp = nullptr; // Top settlement function we are creating
AstSenTree* m_lastSenp; // Last sensitivity match, so we can detect duplicates. AstSenTree* m_lastSenp = nullptr; // Last sensitivity match, so we can detect duplicates.
AstIf* m_lastIfp; // Last sensitivity if active to add more under AstIf* m_lastIfp = nullptr; // Last sensitivity if active to add more under
AstMTaskBody* m_mtaskBodyp; // Current mtask body AstMTaskBody* m_mtaskBodyp = nullptr; // Current mtask body
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -402,17 +402,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ClockVisitor(AstNetlist* nodep) { explicit ClockVisitor(AstNetlist* nodep) {
m_modp = nullptr;
m_evalFuncp = nullptr;
m_initFuncp = nullptr;
m_finalFuncp = nullptr;
m_settleFuncp = nullptr;
m_topScopep = nullptr;
m_lastSenp = nullptr;
m_lastIfp = nullptr;
m_scopep = nullptr;
m_mtaskBodyp = nullptr;
//
iterate(nodep); iterate(nodep);
// Allow downstream modules to find _eval() // Allow downstream modules to find _eval()
// easily without iterating through the tree. // easily without iterating through the tree.

View File

@ -173,13 +173,15 @@ private:
// STATE // STATE
typedef enum { STATE_IDLE, STATE_HASH, STATE_DUP } CombineState; typedef enum { STATE_IDLE, STATE_HASH, STATE_DUP } CombineState;
VDouble0 m_statCombs; // Statistic tracking VDouble0 m_statCombs; // Statistic tracking
CombineState m_state; // Major state CombineState m_state = STATE_IDLE; // Major state
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstCFunc* m_funcp; // Current function AstCFunc* m_funcp = nullptr; // Current function
CombCallVisitor m_call; // Tracking of function call users CombCallVisitor m_call; // Tracking of function call users
int m_modNFuncs; // Number of functions made int m_modNFuncs = 0; // Number of functions made
AstNode* m_walkLast1p; // Final node that is the same in duplicate list #ifdef VL_COMBINE_STATEMENTS
AstNode* m_walkLast2p; // Final node that is the same in duplicate list AstNode* m_walkLast1p = nullptr; // Final node that is the same in duplicate list
#endif
AstNode* m_walkLast2p = nullptr; // Final node that is the same in duplicate list
V3Hashed m_hashed; // Hash for every node in module V3Hashed m_hashed; // Hash for every node in module
// METHODS // METHODS
@ -457,15 +459,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CombineVisitor(AstNetlist* nodep) { explicit CombineVisitor(AstNetlist* nodep) { iterate(nodep); }
m_state = STATE_IDLE;
m_modp = nullptr;
m_funcp = nullptr;
m_modNFuncs = 0;
m_walkLast1p = nullptr;
m_walkLast2p = nullptr;
iterate(nodep);
}
virtual ~CombineVisitor() override { // virtual ~CombineVisitor() override { //
V3Stats::addStat("Optimizations, Combined CFuncs", m_statCombs); V3Stats::addStat("Optimizations, Combined CFuncs", m_statCombs);
} }

View File

@ -87,8 +87,8 @@ public:
AstAttrType m_type; // Type of attribute AstAttrType m_type; // Type of attribute
AstSenTree* m_sentreep; // Sensitivity tree for public_flat_rw AstSenTree* m_sentreep; // Sensitivity tree for public_flat_rw
V3ConfigVarAttr(AstAttrType type, AstSenTree* sentreep) V3ConfigVarAttr(AstAttrType type, AstSenTree* sentreep)
: m_type(type) : m_type{type}
, m_sentreep(sentreep) {} , m_sentreep{sentreep} {}
}; };
// Overload vector with the required update function and to apply all entries // Overload vector with the required update function and to apply all entries
@ -234,9 +234,9 @@ public:
V3ErrorCode m_code; // Error code V3ErrorCode m_code; // Error code
bool m_on; // True to enable message bool m_on; // True to enable message
V3ConfigIgnoresLine(V3ErrorCode code, int lineno, bool on) V3ConfigIgnoresLine(V3ErrorCode code, int lineno, bool on)
: m_lineno(lineno) : m_lineno{lineno}
, m_code(code) , m_code{code}
, m_on(on) {} , m_on{on} {}
~V3ConfigIgnoresLine() {} ~V3ConfigIgnoresLine() {}
inline bool operator<(const V3ConfigIgnoresLine& rh) const { inline bool operator<(const V3ConfigIgnoresLine& rh) const {
if (m_lineno < rh.m_lineno) return true; if (m_lineno < rh.m_lineno) return true;

View File

@ -59,7 +59,7 @@ class ConstVarFindVisitor : public AstNVisitor {
// NODE STATE // NODE STATE
// AstVar::user4p -> bool, input from ConstVarMarkVisitor // AstVar::user4p -> bool, input from ConstVarMarkVisitor
// MEMBERS // MEMBERS
bool m_found; bool m_found = false;
private: private:
// VISITORS // VISITORS
@ -70,10 +70,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ConstVarFindVisitor(AstNode* nodep) { explicit ConstVarFindVisitor(AstNode* nodep) { iterateAndNextNull(nodep); }
m_found = false;
iterateAndNextNull(nodep);
}
virtual ~ConstVarFindVisitor() override {} virtual ~ConstVarFindVisitor() override {}
// METHODS // METHODS
bool found() const { return m_found; } bool found() const { return m_found; }
@ -92,20 +89,20 @@ private:
// AstEnum::user4 -> bool. Recursing. // AstEnum::user4 -> bool. Recursing.
// STATE // STATE
bool m_params; // If true, propagate parameterized and true numbers only bool m_params = false; // If true, propagate parameterized and true numbers only
bool m_required; // If true, must become a constant bool m_required = false; // If true, must become a constant
bool m_wremove; // Inside scope, no assignw removal bool m_wremove = true; // Inside scope, no assignw removal
bool m_warn; // Output warnings bool m_warn = false; // Output warnings
bool m_doExpensive; // Enable computationally expensive optimizations bool m_doExpensive = false; // Enable computationally expensive optimizations
bool m_doNConst; // Enable non-constant-child simplifications bool m_doNConst = false; // Enable non-constant-child simplifications
bool m_doShort; // Remove expressions that short circuit bool m_doShort = true; // Remove expressions that short circuit
bool m_doV; // Verilog, not C++ conversion bool m_doV = false; // Verilog, not C++ conversion
bool m_doGenerate; // Postpone width checking inside generate bool m_doGenerate = false; // Postpone width checking inside generate
bool m_hasJumpDelay; // JumpGo or Delay under this while bool m_hasJumpDelay = false; // JumpGo or Delay under this while
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstArraySel* m_selp; // Current select AstArraySel* m_selp = nullptr; // Current select
AstNode* m_scopep; // Current scope AstNode* m_scopep = nullptr; // Current scope
AstAttrOf* m_attrp; // Current attribute AstAttrOf* m_attrp = nullptr; // Current attribute
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -2549,21 +2546,6 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ConstVisitor(ProcMode pmode) { explicit ConstVisitor(ProcMode pmode) {
m_params = false;
m_required = false;
m_doExpensive = false;
m_doNConst = false;
m_doShort = true; // Presently always done
m_doV = false;
m_doGenerate = false; // Inside generate conditionals
m_hasJumpDelay = false;
m_warn = false;
m_wremove = true; // Overridden in visitors
m_modp = nullptr;
m_selp = nullptr;
m_scopep = nullptr;
m_attrp = nullptr;
//
// clang-format off // clang-format off
switch (pmode) { switch (pmode) {
case PROC_PARAMS: m_doV = true; m_doNConst = true; m_params = true; case PROC_PARAMS: m_doV = true; m_doNConst = true; m_params = true;

View File

@ -49,9 +49,9 @@ private:
AstNode* m_varRefp; // How to get to this element AstNode* m_varRefp; // How to get to this element
AstNode* m_chgRefp; // How to get to this element AstNode* m_chgRefp; // How to get to this element
ToggleEnt(const string& comment, AstNode* vp, AstNode* cp) ToggleEnt(const string& comment, AstNode* vp, AstNode* cp)
: m_comment(comment) : m_comment{comment}
, m_varRefp(vp) , m_varRefp{vp}
, m_chgRefp(cp) {} , m_chgRefp{cp} {}
~ToggleEnt() {} ~ToggleEnt() {}
void cleanup() { void cleanup() {
VL_DO_CLEAR(m_varRefp->deleteTree(), m_varRefp = nullptr); VL_DO_CLEAR(m_varRefp->deleteTree(), m_varRefp = nullptr);
@ -70,7 +70,7 @@ private:
&& v3Global.opt.coverageLine(); && v3Global.opt.coverageLine();
} }
}; };
int m_nextHandle; int m_nextHandle = 0;
// NODE STATE // NODE STATE
// Entire netlist: // Entire netlist:
@ -79,8 +79,8 @@ private:
// STATE // STATE
CheckState m_state; // State save-restored on each new coverage scope/block CheckState m_state; // State save-restored on each new coverage scope/block
AstNodeModule* m_modp; // Current module to add statement to AstNodeModule* m_modp = nullptr; // Current module to add statement to
bool m_inToggleOff; // In function/task etc bool m_inToggleOff = false; // In function/task etc
VarNameMap m_varnames; // Uniquification of inserted variable names VarNameMap m_varnames; // Uniquification of inserted variable names
string m_beginHier; // AstBegin hier name for user coverage points string m_beginHier; // AstBegin hier name for user coverage points
HandleLines m_handleLines; // All line numbers for a given m_stateHandle HandleLines m_handleLines; // All line numbers for a given m_stateHandle
@ -539,14 +539,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit CoverageVisitor(AstNetlist* rootp) { explicit CoverageVisitor(AstNetlist* rootp) { iterateChildren(rootp); }
// Operate on all modules
m_nextHandle = 0;
m_modp = nullptr;
m_beginHier = "";
m_inToggleOff = false;
iterateChildren(rootp);
}
virtual ~CoverageVisitor() override {} virtual ~CoverageVisitor() override {}
}; };

View File

@ -89,12 +89,12 @@ private:
enum VarUsage { VU_NONE = 0, VU_DLY = 1, VU_NONDLY = 2 }; enum VarUsage { VU_NONE = 0, VU_DLY = 1, VU_NONDLY = 2 };
// STATE // STATE
AstActive* m_activep; // Current activate AstActive* m_activep = nullptr; // Current activate
AstCFunc* m_cfuncp; // Current public C Function AstCFunc* m_cfuncp = nullptr; // Current public C Function
AstAssignDly* m_nextDlyp; // Next delayed assignment in a list of assignments AstAssignDly* m_nextDlyp = nullptr; // Next delayed assignment in a list of assignments
bool m_inDly; // True in delayed assignments bool m_inDly = false; // True in delayed assignments
bool m_inLoop; // True in for loops bool m_inLoop = false; // True in for loops
bool m_inInitial; // True in initial blocks bool m_inInitial = false; // True in initial blocks
typedef std::map<std::pair<AstNodeModule*, string>, AstVar*> VarMap; typedef std::map<std::pair<AstNodeModule*, string>, AstVar*> VarMap;
VarMap m_modVarMap; // Table of new var names created under module VarMap m_modVarMap; // Table of new var names created under module
VDouble0 m_statSharedSet; // Statistic tracking VDouble0 m_statSharedSet; // Statistic tracking
@ -476,16 +476,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit DelayedVisitor(AstNetlist* nodep) { explicit DelayedVisitor(AstNetlist* nodep) { iterate(nodep); }
m_inDly = false;
m_activep = nullptr;
m_cfuncp = nullptr;
m_nextDlyp = nullptr;
m_inLoop = false;
m_inInitial = false;
iterate(nodep);
}
virtual ~DelayedVisitor() override { virtual ~DelayedVisitor() override {
V3Stats::addStat("Optimizations, Delayed shared-sets", m_statSharedSet); V3Stats::addStat("Optimizations, Delayed shared-sets", m_statSharedSet);
} }

View File

@ -39,11 +39,11 @@ private:
// NODE STATE // NODE STATE
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstCFunc* m_funcp; // Current block AstCFunc* m_funcp = nullptr; // Current block
AstNode* m_stmtp; // Current statement AstNode* m_stmtp = nullptr; // Current statement
int m_depth; // How deep in an expression int m_depth = 0; // How deep in an expression
int m_maxdepth; // Maximum depth in an expression int m_maxdepth = 0; // Maximum depth in an expression
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -151,15 +151,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit DepthVisitor(AstNetlist* nodep) { explicit DepthVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modp = nullptr;
m_funcp = nullptr;
m_stmtp = nullptr;
m_depth = 0;
m_maxdepth = 0;
//
iterate(nodep);
}
virtual ~DepthVisitor() override {} virtual ~DepthVisitor() override {}
}; };

View File

@ -37,10 +37,10 @@ private:
// NODE STATE // NODE STATE
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstCFunc* m_funcp; // Current function AstCFunc* m_funcp = nullptr; // Current function
int m_depth; // How deep in an expression int m_depth = 0; // How deep in an expression
int m_deepNum; // How many functions made int m_deepNum = 0; // How many functions made
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -119,14 +119,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit DepthBlockVisitor(AstNetlist* nodep) { explicit DepthBlockVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modp = nullptr;
m_funcp = nullptr;
m_depth = 0;
m_deepNum = 0;
//
iterate(nodep);
}
virtual ~DepthBlockVisitor() override {} virtual ~DepthBlockVisitor() override {}
}; };

View File

@ -1253,8 +1253,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit EmitVarTspSorter(const MTaskIdSet& mtaskIds) explicit EmitVarTspSorter(const MTaskIdSet& mtaskIds)
: m_mtaskIds(mtaskIds) : m_mtaskIds{mtaskIds}
, m_serial(++m_serialNext) {} , m_serial{++m_serialNext} {}
virtual ~EmitVarTspSorter() {} virtual ~EmitVarTspSorter() {}
// METHODS // METHODS
virtual bool operator<(const TspStateBase& other) const override { virtual bool operator<(const TspStateBase& other) const override {
@ -3330,10 +3330,10 @@ class EmitCTrace : EmitCStmts {
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// MEMBERS // MEMBERS
AstCFunc* m_funcp; // Function we're in now AstCFunc* m_funcp = nullptr; // Function we're in now
bool m_slow; // Making slow file bool m_slow; // Making slow file
int m_enumNum; // Enumeration number (whole netlist) int m_enumNum = 0; // Enumeration number (whole netlist)
int m_baseCode; // Code of first AstTraceInc in this function int m_baseCode = -1; // Code of first AstTraceInc in this function
// METHODS // METHODS
void newOutCFile(int filenum) { void newOutCFile(int filenum) {
@ -3760,11 +3760,8 @@ class EmitCTrace : EmitCStmts {
virtual void visit(AstCoverInc* nodep) override {} virtual void visit(AstCoverInc* nodep) override {}
public: public:
explicit EmitCTrace(bool slow) { explicit EmitCTrace(bool slow)
m_funcp = nullptr; : m_slow{slow} {}
m_slow = slow;
m_enumNum = 0;
}
virtual ~EmitCTrace() override {} virtual ~EmitCTrace() override {}
void main() { void main() {
// Put out the file // Put out the file

View File

@ -116,7 +116,7 @@ public:
class EmitCBaseCounterVisitor : public AstNVisitor { class EmitCBaseCounterVisitor : public AstNVisitor {
private: private:
// MEMBERS // MEMBERS
int m_count; // Number of statements int m_count = 0; // Number of statements
// VISITORS // VISITORS
virtual void visit(AstNode* nodep) override { virtual void visit(AstNode* nodep) override {
m_count++; m_count++;
@ -125,10 +125,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit EmitCBaseCounterVisitor(AstNode* nodep) { explicit EmitCBaseCounterVisitor(AstNode* nodep) { iterate(nodep); }
m_count = 0;
iterate(nodep);
}
virtual ~EmitCBaseCounterVisitor() override {} virtual ~EmitCBaseCounterVisitor() override {}
int count() const { return m_count; } int count() const { return m_count; }
}; };

View File

@ -43,19 +43,19 @@ class EmitCSyms : EmitCBaseVisitor {
string m_type; string m_type;
ScopeData(const string& symName, const string& prettyName, int timeunit, ScopeData(const string& symName, const string& prettyName, int timeunit,
const string& type) const string& type)
: m_symName(symName) : m_symName{symName}
, m_prettyName(prettyName) , m_prettyName{prettyName}
, m_timeunit(timeunit) , m_timeunit{timeunit}
, m_type(type) {} , m_type{type} {}
}; };
struct ScopeFuncData { struct ScopeFuncData {
AstScopeName* m_scopep; AstScopeName* m_scopep;
AstCFunc* m_funcp; AstCFunc* m_funcp;
AstNodeModule* m_modp; AstNodeModule* m_modp;
ScopeFuncData(AstScopeName* scopep, AstCFunc* funcp, AstNodeModule* modp) ScopeFuncData(AstScopeName* scopep, AstCFunc* funcp, AstNodeModule* modp)
: m_scopep(scopep) : m_scopep{scopep}
, m_funcp(funcp) , m_funcp{funcp}
, m_modp(modp) {} , m_modp{modp} {}
}; };
struct ScopeVarData { struct ScopeVarData {
string m_scopeName; string m_scopeName;
@ -65,11 +65,11 @@ class EmitCSyms : EmitCBaseVisitor {
AstScope* m_scopep; AstScope* m_scopep;
ScopeVarData(const string& scopeName, const string& varBasePretty, AstVar* varp, ScopeVarData(const string& scopeName, const string& varBasePretty, AstVar* varp,
AstNodeModule* modp, AstScope* scopep) AstNodeModule* modp, AstScope* scopep)
: m_scopeName(scopeName) : m_scopeName{scopeName}
, m_varBasePretty(varBasePretty) , m_varBasePretty{varBasePretty}
, m_varp(varp) , m_varp{varp}
, m_modp(modp) , m_modp{modp}
, m_scopep(scopep) {} , m_scopep{scopep} {}
}; };
typedef std::map<string, ScopeFuncData> ScopeFuncs; typedef std::map<string, ScopeFuncData> ScopeFuncs;
typedef std::map<string, ScopeVarData> ScopeVars; typedef std::map<string, ScopeVarData> ScopeVars;
@ -94,8 +94,8 @@ class EmitCSyms : EmitCBaseVisitor {
}; };
// STATE // STATE
AstCFunc* m_funcp; // Current function AstCFunc* m_funcp = nullptr; // Current function
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
std::vector<ScopeModPair> m_scopes; // Every scope by module std::vector<ScopeModPair> m_scopes; // Every scope by module
std::vector<AstCFunc*> m_dpis; // DPI functions std::vector<AstCFunc*> m_dpis; // DPI functions
std::vector<ModVarPair> m_modVars; // Each public {mod,var} std::vector<ModVarPair> m_modVars; // Each public {mod,var}
@ -104,11 +104,11 @@ class EmitCSyms : EmitCBaseVisitor {
ScopeVars m_scopeVars; // Each {scope,public-var} ScopeVars m_scopeVars; // Each {scope,public-var}
ScopeNames m_vpiScopeCandidates; // All scopes for VPI ScopeNames m_vpiScopeCandidates; // All scopes for VPI
ScopeNameHierarchy m_vpiScopeHierarchy; // The actual hierarchy of scopes ScopeNameHierarchy m_vpiScopeHierarchy; // The actual hierarchy of scopes
int m_coverBins; // Coverage bin number int m_coverBins = 0; // Coverage bin number
bool m_dpiHdrOnly; // Only emit the DPI header bool m_dpiHdrOnly; // Only emit the DPI header
int m_numStmts; // Number of statements output int m_numStmts = 0; // Number of statements output
int m_funcNum; // CFunc split function number int m_funcNum = 0; // CFunc split function number
V3OutCFile* m_ofpBase; // Base (not split) C file V3OutCFile* m_ofpBase = nullptr; // Base (not split) C file
std::map<int, bool> m_usesVfinal; // Split method uses __Vfinal std::map<int, bool> m_usesVfinal; // Split method uses __Vfinal
// METHODS // METHODS
@ -354,13 +354,7 @@ class EmitCSyms : EmitCBaseVisitor {
public: public:
explicit EmitCSyms(AstNetlist* nodep, bool dpiHdrOnly) explicit EmitCSyms(AstNetlist* nodep, bool dpiHdrOnly)
: m_dpiHdrOnly(dpiHdrOnly) { : m_dpiHdrOnly{dpiHdrOnly} {
m_funcp = nullptr;
m_modp = nullptr;
m_coverBins = 0;
m_numStmts = 0;
m_funcNum = 0;
m_ofpBase = nullptr;
iterate(nodep); iterate(nodep);
} }
}; };

View File

@ -400,8 +400,8 @@ class EmitMkHierVerilation {
public: public:
explicit EmitMkHierVerilation(const V3HierBlockPlan* planp) explicit EmitMkHierVerilation(const V3HierBlockPlan* planp)
: m_planp(planp) : m_planp{planp}
, m_makefile(v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "_hier.mk") { , m_makefile{v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "_hier.mk"} {
V3OutMkFile of(m_makefile); V3OutMkFile of(m_makefile);
emit(of); emit(of);
} }

View File

@ -30,8 +30,8 @@
class EmitVBaseVisitor : public EmitCBaseVisitor { class EmitVBaseVisitor : public EmitCBaseVisitor {
// MEMBERS // MEMBERS
bool m_suppressSemi; bool m_suppressSemi = false;
AstSenTree* m_sensesp; AstSenTree* m_sensesp; // Domain for printing one a ALWAYS under a ACTIVE
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -658,13 +658,9 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
} }
public: public:
bool m_suppressVarSemi; // Suppress emitting semicolon for AstVars bool m_suppressVarSemi = false; // Suppress emitting semicolon for AstVars
explicit EmitVBaseVisitor(AstSenTree* domainp = nullptr) { explicit EmitVBaseVisitor(AstSenTree* domainp = nullptr)
// Domain for printing one a ALWAYS under a ACTIVE : m_sensesp{domainp} {}
m_suppressSemi = false;
m_suppressVarSemi = false;
m_sensesp = domainp;
}
virtual ~EmitVBaseVisitor() override {} virtual ~EmitVBaseVisitor() override {}
}; };
@ -708,7 +704,7 @@ class EmitVStreamVisitor : public EmitVBaseVisitor {
public: public:
EmitVStreamVisitor(AstNode* nodep, std::ostream& os) EmitVStreamVisitor(AstNode* nodep, std::ostream& os)
: m_os(os) { : m_os{os} {
iterate(nodep); iterate(nodep);
} }
virtual ~EmitVStreamVisitor() override {} virtual ~EmitVStreamVisitor() override {}
@ -746,10 +742,10 @@ public:
FileLine* prefixFl() const { return m_prefixFl; } FileLine* prefixFl() const { return m_prefixFl; }
int column() const { return m_column; } int column() const { return m_column; }
EmitVPrefixedFormatter(std::ostream& os, const string& prefix, int flWidth) EmitVPrefixedFormatter(std::ostream& os, const string& prefix, int flWidth)
: V3OutFormatter("__STREAM", V3OutFormatter::LA_VERILOG) : V3OutFormatter{"__STREAM", V3OutFormatter::LA_VERILOG}
, m_os(os) , m_os{os}
, m_prefix(prefix) , m_prefix{prefix}
, m_flWidth(flWidth) { , m_flWidth{flWidth} {
m_column = 0; m_column = 0;
m_prefixFl m_prefixFl
= v3Global.rootp() = v3Global.rootp()
@ -784,8 +780,8 @@ class EmitVPrefixedVisitor : public EmitVBaseVisitor {
public: public:
EmitVPrefixedVisitor(AstNode* nodep, std::ostream& os, const string& prefix, int flWidth, EmitVPrefixedVisitor(AstNode* nodep, std::ostream& os, const string& prefix, int flWidth,
AstSenTree* domainp, bool user3mark) AstSenTree* domainp, bool user3mark)
: EmitVBaseVisitor(domainp) : EmitVBaseVisitor{domainp}
, m_formatter(os, prefix, flWidth) { , m_formatter{os, prefix, flWidth} {
if (user3mark) { AstUser3InUse::check(); } if (user3mark) { AstUser3InUse::check(); }
iterate(nodep); iterate(nodep);
} }

View File

@ -246,7 +246,7 @@ class EmitXmlFileVisitor : public AstNVisitor {
public: public:
EmitXmlFileVisitor(AstNode* nodep, V3OutFile* ofp) EmitXmlFileVisitor(AstNode* nodep, V3OutFile* ofp)
: m_ofp(ofp) { : m_ofp{ofp} {
iterate(nodep); iterate(nodep);
} }
virtual ~EmitXmlFileVisitor() override {} virtual ~EmitXmlFileVisitor() override {}
@ -286,9 +286,9 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
ModuleFilesXmlVisitor(AstNetlist* nodep, std::ostream& os) ModuleFilesXmlVisitor(AstNetlist* nodep, std::ostream& os)
: m_os(os) : m_os{os}
, m_modulesCovered() , m_modulesCovered{}
, m_nodeModules() { , m_nodeModules{} {
// Operate on whole netlist // Operate on whole netlist
nodep->accept(*this); nodep->accept(*this);
// Xml output // Xml output
@ -361,7 +361,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
HierCellsXmlVisitor(AstNetlist* nodep, std::ostream& os) HierCellsXmlVisitor(AstNetlist* nodep, std::ostream& os)
: m_os(os) { : m_os{os} {
// Operate on whole netlist // Operate on whole netlist
nodep->accept(*this); nodep->accept(*this);
} }

View File

@ -44,7 +44,7 @@ private:
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// STATE // STATE
AstNode* m_stmtp; // Current statement AstNode* m_stmtp = nullptr; // Current statement
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -878,10 +878,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ExpandVisitor(AstNetlist* nodep) { explicit ExpandVisitor(AstNetlist* nodep) { iterate(nodep); }
m_stmtp = nullptr;
iterate(nodep);
}
virtual ~ExpandVisitor() override {} virtual ~ExpandVisitor() override {}
}; };

View File

@ -72,9 +72,9 @@ class V3FileDependImp {
struct stat m_stat; // Stat information struct stat m_stat; // Stat information
public: public:
DependFile(const string& filename, bool target) DependFile(const string& filename, bool target)
: m_target(target) : m_target{target}
, m_exists(true) , m_exists{true}
, m_filename(filename) { , m_filename{filename} {
m_stat.st_ctime = 0; m_stat.st_ctime = 0;
m_stat.st_mtime = 0; m_stat.st_mtime = 0;
} }
@ -338,16 +338,16 @@ class VInFilterImp {
typedef VInFilter::StrList StrList; typedef VInFilter::StrList StrList;
FileContentsMap m_contentsMap; // Cache of file contents FileContentsMap m_contentsMap; // Cache of file contents
bool m_readEof; // Received EOF on read bool m_readEof = false; // Received EOF on read
#ifdef INFILTER_PIPE #ifdef INFILTER_PIPE
pid_t m_pid; // fork() process id pid_t m_pid = 0; // fork() process id
#else #else
int m_pid; // fork() process id - always zero as disabled int m_pid = 0; // fork() process id - always zero as disabled
#endif #endif
bool m_pidExited; bool m_pidExited = false;
int m_pidStatus; int m_pidStatus = 0;
int m_writeFd; // File descriptor TO filter int m_writeFd = 0; // File descriptor TO filter
int m_readFd; // File descriptor FROM filter int m_readFd = 0; // File descriptor FROM filter
private: private:
// METHODS // METHODS
@ -601,15 +601,7 @@ protected:
return out; return out;
} }
// CONSTRUCTORS // CONSTRUCTORS
explicit VInFilterImp(const string& command) { explicit VInFilterImp(const string& command) { start(command); }
m_readEof = false;
m_pid = 0;
m_pidExited = false;
m_pidStatus = 0;
m_writeFd = 0;
m_readFd = 0;
start(command);
}
~VInFilterImp() { stop(); } ~VInFilterImp() { stop(); }
}; };
@ -631,14 +623,8 @@ bool VInFilter::readWholefile(const string& filename, VInFilter::StrList& outl)
// V3OutFormatter: A class for printing to a file, with automatic indentation of C++ code. // V3OutFormatter: A class for printing to a file, with automatic indentation of C++ code.
V3OutFormatter::V3OutFormatter(const string& filename, V3OutFormatter::Language lang) V3OutFormatter::V3OutFormatter(const string& filename, V3OutFormatter::Language lang)
: m_filename(filename) : m_filename{filename}
, m_lang(lang) , m_lang{lang} {
, m_lineno(1)
, m_column(0)
, m_nobreak(false)
, m_prependIndent(true)
, m_indentLevel(0)
, m_bracketLevel(0) {
m_blockIndent = v3Global.opt.decoration() ? 4 : 1; m_blockIndent = v3Global.opt.decoration() ? 4 : 1;
m_commaWidth = v3Global.opt.decoration() ? 50 : 150; m_commaWidth = v3Global.opt.decoration() ? 50 : 150;
} }
@ -941,7 +927,7 @@ void V3OutFormatter::printf(const char* fmt...) {
// V3OutFormatter: A class for printing to a file, with automatic indentation of C++ code. // V3OutFormatter: A class for printing to a file, with automatic indentation of C++ code.
V3OutFile::V3OutFile(const string& filename, V3OutFormatter::Language lang) V3OutFile::V3OutFile(const string& filename, V3OutFormatter::Language lang)
: V3OutFormatter(filename, lang) { : V3OutFormatter{filename, lang} {
if ((m_fp = V3File::new_fopen_w(filename)) == nullptr) { if ((m_fp = V3File::new_fopen_w(filename)) == nullptr) {
v3fatal("Cannot write " << filename); v3fatal("Cannot write " << filename);
} }

View File

@ -117,13 +117,13 @@ private:
Language m_lang; // Indenting Verilog code Language m_lang; // Indenting Verilog code
int m_blockIndent; // Characters per block indent int m_blockIndent; // Characters per block indent
int m_commaWidth; // Width after which to break at ,'s int m_commaWidth; // Width after which to break at ,'s
int m_lineno; int m_lineno = 1;
int m_column; int m_column = 0;
int m_nobreak; // Basic operator or begin paren, don't break next int m_nobreak = false; // Basic operator or begin paren, don't break next
bool m_prependIndent; bool m_prependIndent = true;
int m_indentLevel; // Current {} indentation int m_indentLevel = 0; // Current {} indentation
std::stack<int> m_parenVec; // Stack of columns where last ( was std::stack<int> m_parenVec; // Stack of columns where last ( was
int m_bracketLevel; // Intenting = { block, indicates number of {'s seen. int m_bracketLevel = 0; // Intenting = { block, indicates number of {'s seen.
int endLevels(const char* strg); int endLevels(const char* strg);
void putcNoTracking(char chr); void putcNoTracking(char chr);
@ -195,7 +195,7 @@ class V3OutCFile : public V3OutFile {
int m_private; // 1 = Most recently emitted private:, 2 = public: int m_private; // 1 = Most recently emitted private:, 2 = public:
public: public:
explicit V3OutCFile(const string& filename) explicit V3OutCFile(const string& filename)
: V3OutFile(filename, V3OutFormatter::LA_C) { : V3OutFile{filename, V3OutFormatter::LA_C} {
resetPrivate(); resetPrivate();
} }
virtual ~V3OutCFile() override {} virtual ~V3OutCFile() override {}
@ -221,7 +221,7 @@ public:
class V3OutScFile : public V3OutCFile { class V3OutScFile : public V3OutCFile {
public: public:
explicit V3OutScFile(const string& filename) explicit V3OutScFile(const string& filename)
: V3OutCFile(filename) {} : V3OutCFile{filename} {}
virtual ~V3OutScFile() override {} virtual ~V3OutScFile() override {}
virtual void putsHeader() override { puts("// Verilated -*- SystemC -*-\n"); } virtual void putsHeader() override { puts("// Verilated -*- SystemC -*-\n"); }
virtual void putsIntTopInclude() override { virtual void putsIntTopInclude() override {
@ -234,7 +234,7 @@ public:
class V3OutVFile : public V3OutFile { class V3OutVFile : public V3OutFile {
public: public:
explicit V3OutVFile(const string& filename) explicit V3OutVFile(const string& filename)
: V3OutFile(filename, V3OutFormatter::LA_VERILOG) {} : V3OutFile{filename, V3OutFormatter::LA_VERILOG} {}
virtual ~V3OutVFile() override {} virtual ~V3OutVFile() override {}
virtual void putsHeader() { puts("// Verilated -*- Verilog -*-\n"); } virtual void putsHeader() { puts("// Verilated -*- Verilog -*-\n"); }
}; };
@ -242,7 +242,7 @@ public:
class V3OutXmlFile : public V3OutFile { class V3OutXmlFile : public V3OutFile {
public: public:
explicit V3OutXmlFile(const string& filename) explicit V3OutXmlFile(const string& filename)
: V3OutFile(filename, V3OutFormatter::LA_XML) { : V3OutFile{filename, V3OutFormatter::LA_XML} {
blockIndent(2); blockIndent(2);
} }
virtual ~V3OutXmlFile() override {} virtual ~V3OutXmlFile() override {}
@ -252,7 +252,7 @@ public:
class V3OutMkFile : public V3OutFile { class V3OutMkFile : public V3OutFile {
public: public:
explicit V3OutMkFile(const string& filename) explicit V3OutMkFile(const string& filename)
: V3OutFile(filename, V3OutFormatter::LA_MK) {} : V3OutFile{filename, V3OutFormatter::LA_MK} {}
virtual ~V3OutMkFile() override {} virtual ~V3OutMkFile() override {}
virtual void putsHeader() { puts("# Verilated -*- Makefile -*-\n"); } virtual void putsHeader() { puts("# Verilated -*- Makefile -*-\n"); }
// No automatic indentation yet. // No automatic indentation yet.

View File

@ -142,16 +142,16 @@ std::ostream& operator<<(std::ostream& os, VFileContent* contentp) {
//###################################################################### //######################################################################
// FileLine class functions // FileLine class functions
FileLine::FileLine(FileLine::EmptySecret) { // Sort of a singleton
// Sort of a singleton FileLine::FileLine(FileLine::EmptySecret)
m_firstLineno = 0; : m_firstLineno{0}
m_lastLineno = 0; , m_firstColumn{0}
m_firstColumn = 0; , m_lastLineno{0}
m_lastColumn = 0; , m_lastColumn{0}
, m_contentLineno{0}
, m_contentp{nullptr}
, m_parent{nullptr} {
m_filenameno = singleton().nameToNumber(FileLine::builtInFilename()); m_filenameno = singleton().nameToNumber(FileLine::builtInFilename());
m_contentp = nullptr;
m_contentLineno = 0;
m_parent = nullptr;
m_warnOn = 0; m_warnOn = 0;
for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) { for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) {

View File

@ -126,27 +126,27 @@ private:
public: public:
explicit FileLine(const string& filename) explicit FileLine(const string& filename)
: m_firstLineno(0) : m_firstLineno{0}
, m_firstColumn(0) , m_firstColumn{0}
, m_lastLineno(0) , m_lastLineno{0}
, m_lastColumn(0) , m_lastColumn{0}
, m_filenameno(singleton().nameToNumber(filename)) , m_filenameno{singleton().nameToNumber(filename)}
, m_contentLineno(0) , m_contentLineno{0}
, m_contentp(nullptr) , m_contentp{nullptr}
, m_parent(nullptr) , m_parent{nullptr}
, m_warnOn(defaultFileLine().m_warnOn) , m_warnOn{defaultFileLine().m_warnOn}
, m_waive(false) {} , m_waive{false} {}
explicit FileLine(FileLine* fromp) explicit FileLine(FileLine* fromp)
: m_firstLineno(fromp->m_firstLineno) : m_firstLineno{fromp->m_firstLineno}
, m_firstColumn(fromp->m_firstColumn) , m_firstColumn{fromp->m_firstColumn}
, m_lastLineno(fromp->m_lastLineno) , m_lastLineno{fromp->m_lastLineno}
, m_lastColumn(fromp->m_lastColumn) , m_lastColumn{fromp->m_lastColumn}
, m_filenameno(fromp->m_filenameno) , m_filenameno{fromp->m_filenameno}
, m_contentLineno(fromp->m_contentLineno) , m_contentLineno{fromp->m_contentLineno}
, m_contentp(fromp->m_contentp) , m_contentp{fromp->m_contentp}
, m_parent(fromp->m_parent) , m_parent{fromp->m_parent}
, m_warnOn(fromp->m_warnOn) , m_warnOn{fromp->m_warnOn}
, m_waive(fromp->m_waive) {} , m_waive{fromp->m_waive} {}
struct EmptySecret {}; // Constructor selection struct EmptySecret {}; // Constructor selection
explicit FileLine(EmptySecret); explicit FileLine(EmptySecret);
FileLine* copyOrSameFileLine(); FileLine* copyOrSameFileLine();

View File

@ -56,7 +56,7 @@ class GateGraphBaseVisitor {
public: public:
V3Graph* m_graphp; // Graph this class is visiting V3Graph* m_graphp; // Graph this class is visiting
explicit GateGraphBaseVisitor(V3Graph* graphp) explicit GateGraphBaseVisitor(V3Graph* graphp)
: m_graphp(graphp) {} : m_graphp{graphp} {}
virtual ~GateGraphBaseVisitor() {} virtual ~GateGraphBaseVisitor() {}
virtual VNUser visit(GateLogicVertex* vertexp, VNUser vu = VNUser(0)) = 0; virtual VNUser visit(GateLogicVertex* vertexp, VNUser vu = VNUser(0)) = 0;
virtual VNUser visit(GateVarVertex* vertexp, VNUser vu = VNUser(0)) = 0; virtual VNUser visit(GateVarVertex* vertexp, VNUser vu = VNUser(0)) = 0;
@ -73,8 +73,8 @@ class GateEitherVertex : public V3GraphVertex {
bool m_consumed = false; // Output goes to something meaningful bool m_consumed = false; // Output goes to something meaningful
public: public:
GateEitherVertex(V3Graph* graphp, AstScope* scopep) GateEitherVertex(V3Graph* graphp, AstScope* scopep)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_scopep(scopep) {} , m_scopep{scopep} {}
virtual ~GateEitherVertex() override {} virtual ~GateEitherVertex() override {}
// ACCESSORS // ACCESSORS
virtual string dotStyle() const override { return m_consumed ? "" : "dotted"; } virtual string dotStyle() const override { return m_consumed ? "" : "dotted"; }
@ -131,8 +131,8 @@ class GateVarVertex : public GateEitherVertex {
AstNode* m_rstAsyncNodep = nullptr; // Used as reset and in SenItem, in clocked always AstNode* m_rstAsyncNodep = nullptr; // Used as reset and in SenItem, in clocked always
public: public:
GateVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) GateVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: GateEitherVertex(graphp, scopep) : GateEitherVertex{graphp, scopep}
, m_varScp(varScp) {} , m_varScp{varScp} {}
virtual ~GateVarVertex() override {} virtual ~GateVarVertex() override {}
// ACCESSORS // ACCESSORS
AstVarScope* varScp() const { return m_varScp; } AstVarScope* varScp() const { return m_varScp; }
@ -170,10 +170,10 @@ class GateLogicVertex : public GateEitherVertex {
public: public:
GateLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstActive* activep, GateLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstActive* activep,
bool slow) bool slow)
: GateEitherVertex(graphp, scopep) : GateEitherVertex{graphp, scopep}
, m_nodep(nodep) , m_nodep{nodep}
, m_activep(activep) , m_activep{activep}
, m_slow(slow) {} , m_slow{slow} {}
virtual ~GateLogicVertex() override {} virtual ~GateLogicVertex() override {}
// ACCESSORS // ACCESSORS
virtual string name() const override { virtual string name() const override {
@ -313,13 +313,13 @@ private:
// STATE // STATE
V3Graph m_graph; // Scoreboard of var usages/dependencies V3Graph m_graph; // Scoreboard of var usages/dependencies
GateLogicVertex* m_logicVertexp; // Current statement being tracked, nullptr=ignored GateLogicVertex* m_logicVertexp = nullptr; // Current statement being tracked, nullptr=ignored
AstScope* m_scopep; // Current scope being processed AstScope* m_scopep = nullptr; // Current scope being processed
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstActive* m_activep; // Current active AstActive* m_activep = nullptr; // Current active
bool m_activeReducible; // Is activation block reducible? bool m_activeReducible = true; // Is activation block reducible?
bool m_inSenItem; // Underneath AstSenItem; any varrefs are clocks bool m_inSenItem = false; // Underneath AstSenItem; any varrefs are clocks
bool m_inSlow; // Inside a slow structure bool m_inSlow = false; // Inside a slow structure
VDouble0 m_statSigs; // Statistic tracking VDouble0 m_statSigs; // Statistic tracking
VDouble0 m_statRefs; // Statistic tracking VDouble0 m_statRefs; // Statistic tracking
VDouble0 m_statDedupLogic; // Statistic tracking VDouble0 m_statDedupLogic; // Statistic tracking
@ -524,13 +524,6 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit GateVisitor(AstNode* nodep) { explicit GateVisitor(AstNode* nodep) {
AstNode::user1ClearTree(); AstNode::user1ClearTree();
m_logicVertexp = nullptr;
m_scopep = nullptr;
m_modp = nullptr;
m_activep = nullptr;
m_activeReducible = true;
m_inSenItem = false;
m_inSlow = false;
iterate(nodep); iterate(nodep);
} }
virtual ~GateVisitor() override { virtual ~GateVisitor() override {
@ -1219,7 +1212,7 @@ private:
public: public:
explicit GateDedupeGraphVisitor(V3Graph* graphp) explicit GateDedupeGraphVisitor(V3Graph* graphp)
: GateGraphBaseVisitor(graphp) {} : GateGraphBaseVisitor{graphp} {}
void dedupeTree(GateVarVertex* vvertexp) { vvertexp->accept(*this); } void dedupeTree(GateVarVertex* vvertexp) { vvertexp->accept(*this); }
VDouble0 numDeduped() { return m_numDeduped; } VDouble0 numDeduped() { return m_numDeduped; }
}; };
@ -1254,9 +1247,9 @@ void GateVisitor::dedupe() {
class GateMergeAssignsGraphVisitor : public GateGraphBaseVisitor { class GateMergeAssignsGraphVisitor : public GateGraphBaseVisitor {
private: private:
// NODE STATE // NODE STATE
AstNodeAssign* m_assignp; AstNodeAssign* m_assignp = nullptr;
AstActive* m_activep; AstActive* m_activep = nullptr;
GateLogicVertex* m_logicvp; GateLogicVertex* m_logicvp = nullptr;
VDouble0 m_numMergedAssigns; // Statistic tracking VDouble0 m_numMergedAssigns; // Statistic tracking
// assemble two Sel into one if possible // assemble two Sel into one if possible
@ -1358,12 +1351,8 @@ private:
public: public:
explicit GateMergeAssignsGraphVisitor(V3Graph* graphp) explicit GateMergeAssignsGraphVisitor(V3Graph* graphp)
: GateGraphBaseVisitor(graphp) { : GateGraphBaseVisitor{graphp} {
m_assignp = nullptr; m_graphp = graphp; // In base
m_activep = nullptr;
m_logicvp = nullptr;
m_numMergedAssigns = 0;
m_graphp = graphp;
} }
void mergeAssignsTree(GateVarVertex* vvertexp) { vvertexp->accept(*this); } void mergeAssignsTree(GateVarVertex* vvertexp) { vvertexp->accept(*this); }
VDouble0 numMergedAssigns() { return m_numMergedAssigns; } VDouble0 numMergedAssigns() { return m_numMergedAssigns; }
@ -1441,8 +1430,8 @@ public:
int m_offset; int m_offset;
AstVarScope* m_last_vsp; AstVarScope* m_last_vsp;
GateClkDecompState(int offset, AstVarScope* vsp) GateClkDecompState(int offset, AstVarScope* vsp)
: m_offset(offset) : m_offset{offset}
, m_last_vsp(vsp) {} , m_last_vsp{vsp} {}
virtual ~GateClkDecompState() {} virtual ~GateClkDecompState() {}
}; };
@ -1450,12 +1439,12 @@ class GateClkDecompGraphVisitor : public GateGraphBaseVisitor {
private: private:
// NODE STATE // NODE STATE
// AstVarScope::user2p -> bool: already visited // AstVarScope::user2p -> bool: already visited
int m_seen_clk_vectors; int m_seen_clk_vectors = 0;
AstVarScope* m_clk_vsp; AstVarScope* m_clk_vsp = nullptr;
GateVarVertex* m_clk_vvertexp; GateVarVertex* m_clk_vvertexp = nullptr;
GateConcatVisitor m_concat_visitor; GateConcatVisitor m_concat_visitor;
int m_total_seen_clk_vectors; int m_total_seen_clk_vectors = 0;
int m_total_decomposed_clk_vectors; int m_total_decomposed_clk_vectors = 0;
virtual VNUser visit(GateVarVertex* vvertexp, VNUser vu) override { virtual VNUser visit(GateVarVertex* vvertexp, VNUser vu) override {
// Check that we haven't been here before // Check that we haven't been here before
@ -1540,13 +1529,7 @@ private:
public: public:
explicit GateClkDecompGraphVisitor(V3Graph* graphp) explicit GateClkDecompGraphVisitor(V3Graph* graphp)
: GateGraphBaseVisitor(graphp) { : GateGraphBaseVisitor{graphp} {}
m_seen_clk_vectors = 0;
m_clk_vsp = nullptr;
m_clk_vvertexp = nullptr;
m_total_seen_clk_vectors = 0;
m_total_decomposed_clk_vectors = 0;
}
virtual ~GateClkDecompGraphVisitor() override { virtual ~GateClkDecompGraphVisitor() override {
V3Stats::addStat("Optimizations, Clocker seen vectors", m_total_seen_clk_vectors); V3Stats::addStat("Optimizations, Clocker seen vectors", m_total_seen_clk_vectors);
V3Stats::addStat("Optimizations, Clocker decomposed vectors", V3Stats::addStat("Optimizations, Clocker decomposed vectors",

View File

@ -119,7 +119,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
GenClkRenameVisitor(AstTopScope* nodep, AstNodeModule* topModp) GenClkRenameVisitor(AstTopScope* nodep, AstNodeModule* topModp)
: m_topModp(topModp) { : m_topModp{topModp} {
iterate(nodep); iterate(nodep);
} }
virtual ~GenClkRenameVisitor() override {} virtual ~GenClkRenameVisitor() override {}

View File

@ -92,9 +92,9 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
V3Global() V3Global()
: m_rootp(nullptr) // created by makeInitNetlist() so static constructors run first : m_rootp{nullptr} // created by makeInitNetlist(} so static constructors run first
, m_hierPlanp(nullptr) // Set via hierPlanp(V3HierBlockPlan*) when use hier_block , m_hierPlanp{nullptr} // Set via hierPlanp(V3HierBlockPlan*} when use hier_block
, m_widthMinUsage(VWidthMinUsage::LINT_WIDTH) {} , m_widthMinUsage{VWidthMinUsage::LINT_WIDTH} {}
AstNetlist* makeNetlist(); AstNetlist* makeNetlist();
void boot() { void boot() {
UASSERT(!m_rootp, "call once"); UASSERT(!m_rootp, "call once");

View File

@ -33,17 +33,17 @@ int V3Graph::debug() { return std::max(V3Error::debugDefault(), s_debug); }
// Vertices // Vertices
V3GraphVertex::V3GraphVertex(V3Graph* graphp, const V3GraphVertex& old) V3GraphVertex::V3GraphVertex(V3Graph* graphp, const V3GraphVertex& old)
: m_fanout(old.m_fanout) : m_fanout{old.m_fanout}
, m_color(old.m_color) , m_color{old.m_color}
, m_rank(old.m_rank) { , m_rank{old.m_rank} {
m_userp = nullptr; m_userp = nullptr;
verticesPushBack(graphp); verticesPushBack(graphp);
} }
V3GraphVertex::V3GraphVertex(V3Graph* graphp) V3GraphVertex::V3GraphVertex(V3Graph* graphp)
: m_fanout(0) : m_fanout{0}
, m_color(0) , m_color{0}
, m_rank(0) { , m_rank{0} {
m_userp = nullptr; m_userp = nullptr;
verticesPushBack(graphp); verticesPushBack(graphp);
} }

View File

@ -40,8 +40,8 @@ protected:
bool m_deleted = false; // True if deleted bool m_deleted = false; // True if deleted
public: public:
GraphAcycVertex(V3Graph* graphp, V3GraphVertex* origVertexp) GraphAcycVertex(V3Graph* graphp, V3GraphVertex* origVertexp)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_origVertexp(origVertexp) {} , m_origVertexp{origVertexp} {}
virtual ~GraphAcycVertex() override {} virtual ~GraphAcycVertex() override {}
V3GraphVertex* origVertexp() const { return m_origVertexp; } V3GraphVertex* origVertexp() const { return m_origVertexp; }
void setDelete() { m_deleted = true; } void setDelete() { m_deleted = true; }
@ -66,7 +66,7 @@ private:
public: public:
GraphAcycEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, GraphAcycEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight,
bool cutable = false) bool cutable = false)
: V3GraphEdge(graphp, fromp, top, weight, cutable) {} : V3GraphEdge{graphp, fromp, top, weight, cutable} {}
virtual ~GraphAcycEdge() override {} virtual ~GraphAcycEdge() override {}
// yellow=we might still cut it, else oldEdge: yellowGreen=made uncutable, red=uncutable // yellow=we might still cut it, else oldEdge: yellowGreen=made uncutable, red=uncutable
virtual string dotColor() const override { virtual string dotColor() const override {
@ -186,8 +186,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
GraphAcyc(V3Graph* origGraphp, V3EdgeFuncP edgeFuncp) GraphAcyc(V3Graph* origGraphp, V3EdgeFuncP edgeFuncp)
: m_origGraphp(origGraphp) : m_origGraphp{origGraphp}
, m_origEdgeFuncp(edgeFuncp) {} , m_origEdgeFuncp{edgeFuncp} {}
~GraphAcyc() { ~GraphAcyc() {
for (std::vector<OrigEdgeList*>::iterator it = m_origEdgeDelp.begin(); for (std::vector<OrigEdgeList*>::iterator it = m_origEdgeDelp.begin();
it != m_origEdgeDelp.end(); ++it) { it != m_origEdgeDelp.end(); ++it) {

View File

@ -119,8 +119,8 @@ private:
public: public:
GraphRemoveRedundant(V3Graph* graphp, V3EdgeFuncP edgeFuncp, bool sumWeights) GraphRemoveRedundant(V3Graph* graphp, V3EdgeFuncP edgeFuncp, bool sumWeights)
: GraphAlg<>(graphp, edgeFuncp) : GraphAlg<>{graphp, edgeFuncp}
, m_sumWeights(sumWeights) { , m_sumWeights{sumWeights} {
main(); main();
} }
~GraphRemoveRedundant() {} ~GraphRemoveRedundant() {}
@ -284,7 +284,7 @@ private:
public: public:
GraphAlgStrongly(V3Graph* graphp, V3EdgeFuncP edgeFuncp) GraphAlgStrongly(V3Graph* graphp, V3EdgeFuncP edgeFuncp)
: GraphAlg<>(graphp, edgeFuncp) { : GraphAlg<>{graphp, edgeFuncp} {
m_currentDfs = 0; m_currentDfs = 0;
main(); main();
} }
@ -336,7 +336,7 @@ private:
public: public:
GraphAlgRank(V3Graph* graphp, V3EdgeFuncP edgeFuncp) GraphAlgRank(V3Graph* graphp, V3EdgeFuncP edgeFuncp)
: GraphAlg<>(graphp, edgeFuncp) { : GraphAlg<>{graphp, edgeFuncp} {
main(); main();
} }
~GraphAlgRank() {} ~GraphAlgRank() {}
@ -389,7 +389,7 @@ private:
public: public:
GraphAlgRLoops(V3Graph* graphp, V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp) GraphAlgRLoops(V3Graph* graphp, V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp)
: GraphAlg<>(graphp, edgeFuncp) { : GraphAlg<>{graphp, edgeFuncp} {
m_done = false; m_done = false;
main(vertexp); main(vertexp);
} }
@ -433,8 +433,8 @@ private:
public: public:
GraphAlgSubtrees(V3Graph* graphp, V3Graph* loopGraphp, V3EdgeFuncP edgeFuncp, GraphAlgSubtrees(V3Graph* graphp, V3Graph* loopGraphp, V3EdgeFuncP edgeFuncp,
V3GraphVertex* vertexp) V3GraphVertex* vertexp)
: GraphAlg<>(graphp, edgeFuncp) : GraphAlg<>{graphp, edgeFuncp}
, m_loopGraphp(loopGraphp) { , m_loopGraphp{loopGraphp} {
// Vertex::m_userp - New vertex if we have seen this vertex already // Vertex::m_userp - New vertex if we have seen this vertex already
// Edge::m_userp - New edge if we have seen this edge already // Edge::m_userp - New edge if we have seen this edge already
m_graphp->userClearVertices(); m_graphp->userClearVertices();

View File

@ -34,8 +34,8 @@ protected:
V3EdgeFuncP m_edgeFuncp; // Function that says we follow this edge V3EdgeFuncP m_edgeFuncp; // Function that says we follow this edge
// CONSTRUCTORS // CONSTRUCTORS
GraphAlg(T_Graph* graphp, V3EdgeFuncP edgeFuncp) GraphAlg(T_Graph* graphp, V3EdgeFuncP edgeFuncp)
: m_graphp(graphp) : m_graphp{graphp}
, m_edgeFuncp(edgeFuncp) {} , m_edgeFuncp{edgeFuncp} {}
~GraphAlg() {} ~GraphAlg() {}
// METHODS // METHODS
inline bool followEdge(V3GraphEdge* edgep) { inline bool followEdge(V3GraphEdge* edgep) {

View File

@ -371,7 +371,7 @@ private:
public: public:
GraphNfaToDfa(V3Graph* graphp, V3EdgeFuncP edgeFuncp) GraphNfaToDfa(V3Graph* graphp, V3EdgeFuncP edgeFuncp)
: GraphAlg<>(graphp, edgeFuncp) { : GraphAlg<>{graphp, edgeFuncp} {
m_step = 0; m_step = 0;
main(); main();
} }
@ -500,7 +500,7 @@ private:
public: public:
DfaGraphReduce(V3Graph* graphp, V3EdgeFuncP edgeFuncp) DfaGraphReduce(V3Graph* graphp, V3EdgeFuncP edgeFuncp)
: GraphAlg<>(graphp, edgeFuncp) { : GraphAlg<>{graphp, edgeFuncp} {
if (debug() >= 6) m_graphp->dumpDotFilePrefixed("opt_in"); if (debug() >= 6) m_graphp->dumpDotFilePrefixed("opt_in");
optimize_accepting_out(); optimize_accepting_out();
if (debug() >= 6) m_graphp->dumpDotFilePrefixed("opt_acc"); if (debug() >= 6) m_graphp->dumpDotFilePrefixed("opt_acc");
@ -592,7 +592,7 @@ private:
public: public:
DfaGraphComplement(V3Graph* dfagraphp, V3EdgeFuncP edgeFuncp) DfaGraphComplement(V3Graph* dfagraphp, V3EdgeFuncP edgeFuncp)
: GraphAlg<>(dfagraphp, edgeFuncp) { : GraphAlg<>{dfagraphp, edgeFuncp} {
if (debug() >= 6) m_graphp->dumpDotFilePrefixed("comp_in"); if (debug() >= 6) m_graphp->dumpDotFilePrefixed("comp_in");
// Vertex::m_user begin: 1 indicates new edge, no more processing // Vertex::m_user begin: 1 indicates new edge, no more processing

View File

@ -86,9 +86,9 @@ class DfaVertex : public V3GraphVertex {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit DfaVertex(DfaGraph* graphp, bool start = false, bool accepting = false) explicit DfaVertex(DfaGraph* graphp, bool start = false, bool accepting = false)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_start(start) , m_start{start}
, m_accepting(accepting) {} , m_accepting{accepting} {}
using V3GraphVertex::clone; // We are overriding, not overloading clone(V3Graph*) using V3GraphVertex::clone; // We are overriding, not overloading clone(V3Graph*)
virtual DfaVertex* clone(DfaGraph* graphp) { virtual DfaVertex* clone(DfaGraph* graphp) {
return new DfaVertex(graphp, start(), accepting()); return new DfaVertex(graphp, start(), accepting());
@ -121,13 +121,13 @@ public:
static DfaInput NA() { return VNUser::fromInt(1); } // as in not-applicable static DfaInput NA() { return VNUser::fromInt(1); } // as in not-applicable
// CONSTRUCTORS // CONSTRUCTORS
DfaEdge(DfaGraph* graphp, DfaVertex* fromp, DfaVertex* top, const DfaInput& input) DfaEdge(DfaGraph* graphp, DfaVertex* fromp, DfaVertex* top, const DfaInput& input)
: V3GraphEdge(graphp, fromp, top, 1) : V3GraphEdge{graphp, fromp, top, 1}
, m_input(input) , m_input(input)
, m_complement(false) {} , m_complement(false) {}
DfaEdge(DfaGraph* graphp, DfaVertex* fromp, DfaVertex* top, const DfaEdge* copyfrom) DfaEdge(DfaGraph* graphp, DfaVertex* fromp, DfaVertex* top, const DfaEdge* copyfrom)
: V3GraphEdge(graphp, fromp, top, copyfrom->weight()) : V3GraphEdge{graphp, fromp, top, copyfrom->weight()}
, m_input(copyfrom->input()) , m_input{copyfrom->input()}
, m_complement(copyfrom->complement()) {} , m_complement{copyfrom->complement()} {}
virtual ~DfaEdge() override {} virtual ~DfaEdge() override {}
// METHODS // METHODS
virtual string dotColor() const override { virtual string dotColor() const override {

View File

@ -51,8 +51,8 @@ struct GraphPCNode {
// GraphPathChecker implementation // GraphPathChecker implementation
GraphPathChecker::GraphPathChecker(const V3Graph* graphp, V3EdgeFuncP edgeFuncp) GraphPathChecker::GraphPathChecker(const V3Graph* graphp, V3EdgeFuncP edgeFuncp)
: GraphAlg<const V3Graph>(graphp, edgeFuncp) : GraphAlg<const V3Graph>{graphp, edgeFuncp}
, m_generation(0) { , m_generation{0} {
for (V3GraphVertex* vxp = graphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) { for (V3GraphVertex* vxp = graphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) {
// Setup tracking structure for each node. If delete a vertex // Setup tracking structure for each node. If delete a vertex
// there would be a leak, but ok as accept only const V3Graph*'s. // there would be a leak, but ok as accept only const V3Graph*'s.

View File

@ -48,9 +48,9 @@ private:
uint32_t m_numBlockingEdges; // Number of blocking edges uint32_t m_numBlockingEdges; // Number of blocking edges
// CONSTRUCTORS // CONSTRUCTORS
VxHolder(const V3GraphVertex* vxp, uint32_t pos, uint32_t numBlockingEdges) VxHolder(const V3GraphVertex* vxp, uint32_t pos, uint32_t numBlockingEdges)
: m_vxp(vxp) : m_vxp{vxp}
, m_pos(pos) , m_pos{pos}
, m_numBlockingEdges(numBlockingEdges) {} , m_numBlockingEdges{numBlockingEdges} {}
// METHODS // METHODS
const V3GraphVertex* vertexp() const { return m_vxp; } const V3GraphVertex* vertexp() const { return m_vxp; }
// Decrement blocking edges count, return true if the vertex is // Decrement blocking edges count, return true if the vertex is
@ -68,7 +68,7 @@ private:
T_Compare m_lessThan; // Sorting functor T_Compare m_lessThan; // Sorting functor
// CONSTRUCTORS // CONSTRUCTORS
explicit VxHolderCmp(const T_Compare& lessThan) explicit VxHolderCmp(const T_Compare& lessThan)
: m_lessThan(lessThan) {} : m_lessThan{lessThan} {}
// METHODS // METHODS
bool operator()(const VxHolder& a, const VxHolder& b) const { bool operator()(const VxHolder& a, const VxHolder& b) const {
if (m_lessThan.operator()(a.vertexp(), b.vertexp())) return true; if (m_lessThan.operator()(a.vertexp(), b.vertexp())) return true;
@ -97,10 +97,10 @@ public:
// NOTE: Perhaps REVERSE way should also reverse the sense of the // NOTE: Perhaps REVERSE way should also reverse the sense of the
// lessThan function? For now the only usage of REVERSE is not // lessThan function? For now the only usage of REVERSE is not
// sensitive to its lessThan at all, so it doesn't matter. // sensitive to its lessThan at all, so it doesn't matter.
: m_vxHolderCmp(lessThan) : m_vxHolderCmp{lessThan}
, m_readyVertices(m_vxHolderCmp) , m_readyVertices{m_vxHolderCmp}
, m_last(m_readyVertices.end()) , m_last{m_readyVertices.end()}
, m_way(way) { , m_way{way} {
uint32_t pos = 0; uint32_t pos = 0;
for (const V3GraphVertex* vxp = graphp->verticesBeginp(); vxp; for (const V3GraphVertex* vxp = graphp->verticesBeginp(); vxp;
vxp = vxp->verticesNextp()) { vxp = vxp->verticesNextp()) {

View File

@ -55,8 +55,8 @@ class V3GraphTestVertex : public V3GraphVertex {
public: public:
V3GraphTestVertex(V3Graph* graphp, const string& name) V3GraphTestVertex(V3Graph* graphp, const string& name)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_name(name) {} , m_name{name} {}
virtual ~V3GraphTestVertex() override {} virtual ~V3GraphTestVertex() override {}
// ACCESSORS // ACCESSORS
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }
@ -65,7 +65,7 @@ public:
class V3GraphTestVarVertex : public V3GraphTestVertex { class V3GraphTestVarVertex : public V3GraphTestVertex {
public: public:
V3GraphTestVarVertex(V3Graph* graphp, const string& name) V3GraphTestVarVertex(V3Graph* graphp, const string& name)
: V3GraphTestVertex(graphp, name) {} : V3GraphTestVertex{graphp, name} {}
virtual ~V3GraphTestVarVertex() override {} virtual ~V3GraphTestVarVertex() override {}
// ACCESSORS // ACCESSORS
virtual string dotColor() const override { return "blue"; } virtual string dotColor() const override { return "blue"; }
@ -265,8 +265,8 @@ class DfaTestVertex : public DfaVertex {
public: public:
DfaTestVertex(DfaGraph* graphp, const string& name) DfaTestVertex(DfaGraph* graphp, const string& name)
: DfaVertex(graphp) : DfaVertex{graphp}
, m_name(name) {} , m_name{name} {}
virtual ~DfaTestVertex() override {} virtual ~DfaTestVertex() override {}
// ACCESSORS // ACCESSORS
virtual string name() const override { return m_name; } virtual string name() const override { return m_name; }

View File

@ -94,12 +94,12 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit HashedVisitor(AstNode* nodep) explicit HashedVisitor(AstNode* nodep)
: m_cacheInUser4(true) { : m_cacheInUser4{true} {
nodeHashIterate(nodep); nodeHashIterate(nodep);
// UINFO(9," stmthash "<<hex<<V3Hashed::nodeHash(nodep)<<" "<<nodep<<endl); // UINFO(9," stmthash "<<hex<<V3Hashed::nodeHash(nodep)<<" "<<nodep<<endl);
} }
explicit HashedVisitor(const AstNode* nodep) explicit HashedVisitor(const AstNode* nodep)
: m_cacheInUser4(false) { : m_cacheInUser4{false} {
nodeHashIterate(const_cast<AstNode*>(nodep)); nodeHashIterate(const_cast<AstNode*>(nodep));
} }
V3Hash finalHash() const { return m_lowerHash; } V3Hash finalHash() const { return m_lowerHash; }

View File

@ -293,7 +293,7 @@ class HierBlockUsageCollectVisitor : public AstNVisitor {
public: public:
HierBlockUsageCollectVisitor(V3HierBlockPlan* planp, AstNetlist* netlist) HierBlockUsageCollectVisitor(V3HierBlockPlan* planp, AstNetlist* netlist)
: m_planp(planp) { : m_planp{planp} {
iterateChildren(netlist); iterateChildren(netlist);
} }
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()

View File

@ -63,8 +63,8 @@ private:
public: public:
V3HierBlock(const AstNodeModule* modp, const GParams& gparams) V3HierBlock(const AstNodeModule* modp, const GParams& gparams)
: m_modp(modp) : m_modp{modp}
, m_gparams(gparams) {} , m_gparams{gparams} {}
~V3HierBlock(); ~V3HierBlock();
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()

View File

@ -66,7 +66,7 @@ private:
}; // Pragma suggests inlining }; // Pragma suggests inlining
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
VDouble0 m_statUnsup; // Statistic tracking VDouble0 m_statUnsup; // Statistic tracking
typedef std::vector<AstNodeModule*> ModVec; typedef std::vector<AstNodeModule*> ModVec;
@ -219,10 +219,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit InlineMarkVisitor(AstNode* nodep) { explicit InlineMarkVisitor(AstNode* nodep) { iterate(nodep); }
m_modp = nullptr;
iterate(nodep);
}
virtual ~InlineMarkVisitor() override { virtual ~InlineMarkVisitor() override {
V3Stats::addStat("Optimizations, Inline unsupported", m_statUnsup); V3Stats::addStat("Optimizations, Inline unsupported", m_statUnsup);
// Done with these, are not outputs // Done with these, are not outputs
@ -471,8 +468,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
InlineRelinkVisitor(AstNodeModule* cloneModp, AstNodeModule* oldModp, AstCell* cellp) InlineRelinkVisitor(AstNodeModule* cloneModp, AstNodeModule* oldModp, AstCell* cellp)
: m_modp(oldModp) : m_modp{oldModp}
, m_cellp(cellp) { , m_cellp{cellp} {
iterate(cloneModp); iterate(cloneModp);
} }
virtual ~InlineRelinkVisitor() override {} virtual ~InlineRelinkVisitor() override {}
@ -501,7 +498,7 @@ private:
AstUser5InUse m_inuser5; AstUser5InUse m_inuser5;
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
VDouble0 m_statCells; // Statistic tracking VDouble0 m_statCells; // Statistic tracking
// METHODS // METHODS
@ -614,10 +611,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit InlineVisitor(AstNode* nodep) { explicit InlineVisitor(AstNode* nodep) { iterate(nodep); }
m_modp = nullptr;
iterate(nodep);
}
virtual ~InlineVisitor() override { // virtual ~InlineVisitor() override { //
V3Stats::addStat("Optimizations, Inlined cells", m_statCells); V3Stats::addStat("Optimizations, Inlined cells", m_statCells);
} }

View File

@ -42,7 +42,7 @@ private:
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// STATE // STATE
AstCell* m_cellp; // Current cell AstCell* m_cellp = nullptr; // Current cell
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -131,11 +131,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit InstVisitor(AstNetlist* nodep) { explicit InstVisitor(AstNetlist* nodep) { iterate(nodep); }
m_cellp = nullptr;
//
iterate(nodep);
}
virtual ~InstVisitor() override {} virtual ~InstVisitor() override {}
}; };
@ -199,8 +195,9 @@ class InstDeVisitor : public AstNVisitor {
// Find all cells with arrays, and convert to non-arrayed // Find all cells with arrays, and convert to non-arrayed
private: private:
// STATE // STATE
AstRange* m_cellRangep; // Range for arrayed instantiations, nullptr for normal instantiations AstRange* m_cellRangep
int m_instSelNum; // Current instantiation count 0..N-1 = nullptr; // Range for arrayed instantiations, nullptr for normal instantiations
int m_instSelNum = 0; // Current instantiation count 0..N-1
InstDeModVarVisitor m_deModVars; // State of variables for current cell module InstDeModVarVisitor m_deModVars; // State of variables for current cell module
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -466,12 +463,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit InstDeVisitor(AstNetlist* nodep) { explicit InstDeVisitor(AstNetlist* nodep) { iterate(nodep); }
m_cellRangep = nullptr;
m_instSelNum = 0;
//
iterate(nodep);
}
virtual ~InstDeVisitor() override {} virtual ~InstDeVisitor() override {}
}; };

View File

@ -56,8 +56,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
VisitBase(InstrCountVisitor* visitor, AstNode* nodep) VisitBase(InstrCountVisitor* visitor, AstNode* nodep)
: m_nodep(nodep) : m_nodep{nodep}
, m_visitor(visitor) { , m_visitor{visitor} {
m_savedCount = m_visitor->startVisitBase(nodep); m_savedCount = m_visitor->startVisitBase(nodep);
} }
~VisitBase() { m_visitor->endVisitBase(m_savedCount, m_nodep); } ~VisitBase() { m_visitor->endVisitBase(m_savedCount, m_nodep); }
@ -69,9 +69,9 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
InstrCountVisitor(AstNode* nodep, bool assertNoDups, std::ostream* osp) InstrCountVisitor(AstNode* nodep, bool assertNoDups, std::ostream* osp)
: m_startNodep(nodep) : m_startNodep{nodep}
, m_assertNoDups(assertNoDups) , m_assertNoDups{assertNoDups}
, m_osp(osp) { , m_osp{osp} {
if (nodep) iterate(nodep); if (nodep) iterate(nodep);
} }
virtual ~InstrCountVisitor() override {} virtual ~InstrCountVisitor() override {}
@ -271,7 +271,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
InstrCountDumpVisitor(AstNode* nodep, std::ostream* osp) InstrCountDumpVisitor(AstNode* nodep, std::ostream* osp)
: m_osp(osp) { : m_osp{osp} {
// No check for nullptr output, so... // No check for nullptr output, so...
UASSERT_OBJ(osp, nodep, "Don't call if not dumping"); UASSERT_OBJ(osp, nodep, "Don't call if not dumping");
if (nodep) iterate(nodep); if (nodep) iterate(nodep);

View File

@ -484,7 +484,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LifeTopVisitor(AstNetlist* nodep, LifeState* statep) LifeTopVisitor(AstNetlist* nodep, LifeState* statep)
: m_statep(statep) { : m_statep{statep} {
iterate(nodep); iterate(nodep);
} }
virtual ~LifeTopVisitor() override {} virtual ~LifeTopVisitor() override {}

View File

@ -104,11 +104,11 @@ struct LifeLocation {
public: public:
LifeLocation() LifeLocation()
: mtaskp(nullptr) : mtaskp{nullptr}
, sequence(0) {} , sequence{0} {}
LifeLocation(const ExecMTask* mtaskp_, uint32_t sequence_) LifeLocation(const ExecMTask* mtaskp_, uint32_t sequence_)
: mtaskp(mtaskp_) : mtaskp{mtaskp_}
, sequence(sequence_) {} , sequence{sequence_} {}
bool operator<(const LifeLocation& b) const { bool operator<(const LifeLocation& b) const {
unsigned a_id = mtaskp ? mtaskp->id() : 0; unsigned a_id = mtaskp ? mtaskp->id() : 0;
unsigned b_id = b.mtaskp ? b.mtaskp->id() : 0; unsigned b_id = b.mtaskp ? b.mtaskp->id() : 0;
@ -122,10 +122,10 @@ struct LifePostLocation {
LifeLocation loc; LifeLocation loc;
AstAssignPost* nodep; AstAssignPost* nodep;
LifePostLocation() LifePostLocation()
: nodep(nullptr) {} : nodep{nullptr} {}
LifePostLocation(LifeLocation loc_, AstAssignPost* nodep_) LifePostLocation(LifeLocation loc_, AstAssignPost* nodep_)
: loc(loc_) : loc{loc_}
, nodep(nodep_) {} , nodep{nodep_} {}
}; };
//###################################################################### //######################################################################

View File

@ -53,8 +53,8 @@ class LinkCellsVertex : public V3GraphVertex {
public: public:
LinkCellsVertex(V3Graph* graphp, AstNodeModule* modp) LinkCellsVertex(V3Graph* graphp, AstNodeModule* modp)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_modp(modp) {} , m_modp{modp} {}
virtual ~LinkCellsVertex() override {} virtual ~LinkCellsVertex() override {}
AstNodeModule* modp() const { return m_modp; } AstNodeModule* modp() const { return m_modp; }
virtual string name() const override { return modp()->name(); } virtual string name() const override { return modp()->name(); }
@ -68,7 +68,7 @@ public:
class LibraryVertex : public V3GraphVertex { class LibraryVertex : public V3GraphVertex {
public: public:
explicit LibraryVertex(V3Graph* graphp) explicit LibraryVertex(V3Graph* graphp)
: V3GraphVertex(graphp) {} : V3GraphVertex{graphp} {}
virtual ~LibraryVertex() override {} virtual ~LibraryVertex() override {}
virtual string name() const override { return "*LIBRARY*"; } virtual string name() const override { return "*LIBRARY*"; }
}; };
@ -109,11 +109,11 @@ private:
V3ParseSym* m_parseSymp; // Parser symbol table V3ParseSym* m_parseSymp; // Parser symbol table
// Below state needs to be preserved between each module call. // Below state needs to be preserved between each module call.
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
VSymGraph m_mods; // Symbol table of all module names VSymGraph m_mods; // Symbol table of all module names
LinkCellsGraph m_graph; // Linked graph of all cell interconnects LinkCellsGraph m_graph; // Linked graph of all cell interconnects
LibraryVertex* m_libVertexp; // Vertex at root of all libraries LibraryVertex* m_libVertexp = nullptr; // Vertex at root of all libraries
V3GraphVertex* m_topVertexp; // Vertex of top module V3GraphVertex* m_topVertexp = nullptr; // Vertex of top module
std::unordered_set<string> m_declfnWarned; // Files we issued DECLFILENAME on std::unordered_set<string> m_declfnWarned; // Files we issued DECLFILENAME on
string m_origTopModuleName; // original name of the top module string m_origTopModuleName; // original name of the top module
@ -501,12 +501,9 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LinkCellsVisitor(AstNetlist* nodep, VInFilter* filterp, V3ParseSym* parseSymp) LinkCellsVisitor(AstNetlist* nodep, VInFilter* filterp, V3ParseSym* parseSymp)
: m_mods(nodep) { : m_mods{nodep} {
m_filterp = filterp; m_filterp = filterp;
m_parseSymp = parseSymp; m_parseSymp = parseSymp;
m_modp = nullptr;
m_libVertexp = nullptr;
m_topVertexp = nullptr;
if (v3Global.opt.hierChild()) { if (v3Global.opt.hierChild()) {
const V3HierBlockOptSet& hierBlocks = v3Global.opt.hierBlocks(); const V3HierBlockOptSet& hierBlocks = v3Global.opt.hierBlocks();
UASSERT(!v3Global.opt.topModule().empty(), UASSERT(!v3Global.opt.topModule().empty(),

View File

@ -198,7 +198,7 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
LinkDotState(AstNetlist* rootp, VLinkDotStep step) LinkDotState(AstNetlist* rootp, VLinkDotStep step)
: m_syms(rootp) { : m_syms{rootp} {
UINFO(4, __FUNCTION__ << ": " << endl); UINFO(4, __FUNCTION__ << ": " << endl);
m_forPrimary = (step == LDS_PRIMARY); m_forPrimary = (step == LDS_PRIMARY);
m_forPrearray = (step == LDS_PARAMED || step == LDS_PRIMARY); m_forPrearray = (step == LDS_PARAMED || step == LDS_PRIMARY);
@ -1253,7 +1253,7 @@ class LinkDotFindVisitor : public AstNVisitor {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LinkDotFindVisitor(AstNetlist* rootp, LinkDotState* statep) LinkDotFindVisitor(AstNetlist* rootp, LinkDotState* statep)
: m_statep(statep) { : m_statep{statep} {
UINFO(4, __FUNCTION__ << ": " << endl); UINFO(4, __FUNCTION__ << ": " << endl);
iterate(rootp); iterate(rootp);
@ -1419,7 +1419,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LinkDotParamVisitor(AstNetlist* rootp, LinkDotState* statep) LinkDotParamVisitor(AstNetlist* rootp, LinkDotState* statep)
: m_statep(statep) { : m_statep{statep} {
UINFO(4, __FUNCTION__ << ": " << endl); UINFO(4, __FUNCTION__ << ": " << endl);
iterate(rootp); iterate(rootp);
} }
@ -1572,7 +1572,7 @@ class LinkDotScopeVisitor : public AstNVisitor {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LinkDotScopeVisitor(AstNetlist* rootp, LinkDotState* statep) LinkDotScopeVisitor(AstNetlist* rootp, LinkDotState* statep)
: m_statep(statep) { : m_statep{statep} {
UINFO(4, __FUNCTION__ << ": " << endl); UINFO(4, __FUNCTION__ << ": " << endl);
iterate(rootp); iterate(rootp);
} }
@ -2799,7 +2799,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LinkDotResolveVisitor(AstNetlist* rootp, LinkDotState* statep) LinkDotResolveVisitor(AstNetlist* rootp, LinkDotState* statep)
: m_statep(statep) { : m_statep{statep} {
UINFO(4, __FUNCTION__ << ": " << endl); UINFO(4, __FUNCTION__ << ": " << endl);
iterate(rootp); iterate(rootp);
} }

View File

@ -57,10 +57,10 @@ private:
}; };
// STATE // STATE
int m_modIncrementsNum; // Var name counter int m_modIncrementsNum = 0; // Var name counter
InsertMode m_insMode; // How to insert InsertMode m_insMode = IM_BEFORE; // How to insert
AstNode* m_insStmtp; // Where to insert statement AstNode* m_insStmtp = nullptr; // Where to insert statement
bool m_unsupportedHere; // Used to detect where it's not supported yet bool m_unsupportedHere = false; // Used to detect where it's not supported yet
private: private:
void insertBeforeStmt(AstNode* nodep, AstNode* newp) { void insertBeforeStmt(AstNode* nodep, AstNode* newp) {
@ -234,13 +234,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit LinkIncVisitor(AstNetlist* nodep) { explicit LinkIncVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modIncrementsNum = 0;
m_insMode = IM_BEFORE;
m_insStmtp = nullptr;
m_unsupportedHere = false;
iterate(nodep);
}
virtual ~LinkIncVisitor() override {} virtual ~LinkIncVisitor() override {}
}; };

View File

@ -47,12 +47,12 @@ private:
typedef std::vector<AstNodeBlock*> BlockStack; typedef std::vector<AstNodeBlock*> BlockStack;
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstNodeFTask* m_ftaskp; // Current function/task AstNodeFTask* m_ftaskp = nullptr; // Current function/task
AstWhile* m_loopp; // Current loop AstWhile* m_loopp = nullptr; // Current loop
bool m_loopInc; // In loop increment bool m_loopInc = false; // In loop increment
bool m_inFork; // Under fork bool m_inFork = false; // Under fork
int m_modRepeatNum; // Repeat counter int m_modRepeatNum = 0; // Repeat counter
BlockStack m_blockStack; // All begin blocks above current node BlockStack m_blockStack; // All begin blocks above current node
// METHODS // METHODS
@ -285,15 +285,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit LinkJumpVisitor(AstNetlist* nodep) { explicit LinkJumpVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modp = nullptr;
m_ftaskp = nullptr;
m_inFork = false;
m_loopp = nullptr;
m_loopInc = false;
m_modRepeatNum = 0;
iterate(nodep);
}
virtual ~LinkJumpVisitor() override {} virtual ~LinkJumpVisitor() override {}
}; };

View File

@ -299,7 +299,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LinkLValueVisitor(AstNode* nodep, bool start) LinkLValueVisitor(AstNode* nodep, bool start)
: m_setRefLvalue(start) { : m_setRefLvalue{start} {
iterate(nodep); iterate(nodep);
} }
virtual ~LinkLValueVisitor() override {} virtual ~LinkLValueVisitor() override {}

View File

@ -48,14 +48,15 @@ private:
typedef std::set<FileLine*> FileLineSet; typedef std::set<FileLine*> FileLineSet;
// STATE // STATE
AstVar* m_varp; // Variable we're under AstVar* m_varp = nullptr; // Variable we're under
ImplTypedefMap m_implTypedef; // Created typedefs for each <container,name> ImplTypedefMap m_implTypedef; // Created typedefs for each <container,name>
FileLineSet m_filelines; // Filelines that have been seen FileLineSet m_filelines; // Filelines that have been seen
bool m_inAlways; // Inside an always bool m_inAlways = false; // Inside an always
AstNodeModule* m_valueModp; // If set, move AstVar->valuep() initial values to this module AstNodeModule* m_valueModp
AstNodeModule* m_modp; // Current module = nullptr; // If set, move AstVar->valuep() initial values to this module
AstNodeFTask* m_ftaskp; // Current task AstNodeModule* m_modp = nullptr; // Current module
AstNodeDType* m_dtypep; // Current data type AstNodeFTask* m_ftaskp = nullptr; // Current task
AstNodeDType* m_dtypep = nullptr; // Current data type
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -595,15 +596,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit LinkParseVisitor(AstNetlist* rootp) { explicit LinkParseVisitor(AstNetlist* rootp) { iterate(rootp); }
m_varp = nullptr;
m_modp = nullptr;
m_ftaskp = nullptr;
m_dtypep = nullptr;
m_inAlways = false;
m_valueModp = nullptr;
iterate(rootp);
}
virtual ~LinkParseVisitor() override {} virtual ~LinkParseVisitor() override {}
}; };

View File

@ -47,12 +47,12 @@ private:
// STATE // STATE
// Below state needs to be preserved between each module call. // Below state needs to be preserved between each module call.
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstClass* m_classp; // Class we're inside AstClass* m_classp = nullptr; // Class we're inside
AstNodeFTask* m_ftaskp; // Function or task we're inside AstNodeFTask* m_ftaskp = nullptr; // Function or task we're inside
AstNodeCoverOrAssert* m_assertp; // Current assertion AstNodeCoverOrAssert* m_assertp = nullptr; // Current assertion
VLifetime m_lifetime; // Propagating lifetime VLifetime m_lifetime = VLifetime::STATIC; // Propagating lifetime
int m_senitemCvtNum; // Temporary signal counter int m_senitemCvtNum = 0; // Temporary signal counter
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -521,15 +521,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit LinkResolveVisitor(AstNetlist* rootp) explicit LinkResolveVisitor(AstNetlist* rootp) { iterate(rootp); }
: m_lifetime(VLifetime::STATIC) { // Static outside a module/class
m_classp = nullptr;
m_ftaskp = nullptr;
m_modp = nullptr;
m_assertp = nullptr;
m_senitemCvtNum = 0;
iterate(rootp);
}
virtual ~LinkResolveVisitor() override {} virtual ~LinkResolveVisitor() override {}
}; };
@ -541,7 +533,7 @@ public:
class LinkBotupVisitor : public AstNVisitor { class LinkBotupVisitor : public AstNVisitor {
private: private:
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -569,11 +561,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit LinkBotupVisitor(AstNetlist* rootp) { explicit LinkBotupVisitor(AstNetlist* rootp) { iterate(rootp); }
m_modp = nullptr;
//
iterate(rootp);
}
virtual ~LinkBotupVisitor() override {} virtual ~LinkBotupVisitor() override {}
}; };

View File

@ -101,7 +101,7 @@ private:
// STATE // STATE
VDouble0 m_statLocVars; // Statistic tracking VDouble0 m_statLocVars; // Statistic tracking
AstCFunc* m_cfuncp; // Current active function AstCFunc* m_cfuncp = nullptr; // Current active function
std::vector<AstVar*> m_varps; // List of variables to consider for deletion std::vector<AstVar*> m_varps; // List of variables to consider for deletion
// METHODS // METHODS
@ -221,10 +221,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit LocalizeVisitor(AstNetlist* nodep) { explicit LocalizeVisitor(AstNetlist* nodep) { iterate(nodep); }
m_cfuncp = nullptr;
iterate(nodep);
}
virtual ~LocalizeVisitor() override { virtual ~LocalizeVisitor() override {
V3Stats::addStat("Optimizations, Vars localized", m_statLocVars); V3Stats::addStat("Optimizations, Vars localized", m_statLocVars);
} }

View File

@ -126,11 +126,11 @@ private:
VDouble0 m_statMergedItems; // Statistic tracking VDouble0 m_statMergedItems; // Statistic tracking
VDouble0 m_statLongestList; // Statistic tracking VDouble0 m_statLongestList; // Statistic tracking
AstNode* m_mgFirstp; // First node in merged sequence AstNode* m_mgFirstp = nullptr; // First node in merged sequence
AstNode* m_mgCondp; // The condition of the first node AstNode* m_mgCondp = nullptr; // The condition of the first node
AstNode* m_mgLastp; // Last node in merged sequence AstNode* m_mgLastp = nullptr; // Last node in merged sequence
const AstNode* m_mgNextp; // Next node in list being examined const AstNode* m_mgNextp = nullptr; // Next node in list being examined
uint32_t m_listLenght; // Length of current list uint32_t m_listLenght = 0; // Length of current list
CheckMergeableVisitor m_checkMergeable; // Sub visitor for encapsulation & speed CheckMergeableVisitor m_checkMergeable; // Sub visitor for encapsulation & speed
MarkVarsVisitor m_markVars; // Sub visitor for encapsulation & speed MarkVarsVisitor m_markVars; // Sub visitor for encapsulation & speed
@ -321,11 +321,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit MergeCondVisitor(AstNetlist* nodep) { explicit MergeCondVisitor(AstNetlist* nodep) {
m_mgFirstp = nullptr;
m_mgCondp = nullptr;
m_mgLastp = nullptr;
m_mgNextp = nullptr;
m_listLenght = 0;
m_markVars.clear(); m_markVars.clear();
iterate(nodep); iterate(nodep);
} }

View File

@ -40,7 +40,7 @@ private:
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// STATE // STATE
AstNodeModule* m_modp; AstNodeModule* m_modp = nullptr;
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -136,10 +136,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit NameVisitor(AstNetlist* nodep) { explicit NameVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modp = nullptr;
iterate(nodep);
}
virtual ~NameVisitor() override {} virtual ~NameVisitor() override {}
}; };

View File

@ -122,7 +122,7 @@ V3LangCode::V3LangCode(const char* textp) {
// VTimescale class functions // VTimescale class functions
VTimescale::VTimescale(const string& value, bool& badr) VTimescale::VTimescale(const string& value, bool& badr)
: m_e(VTimescale::NONE) { : m_e{VTimescale::NONE} {
badr = true; badr = true;
string spaceless = VString::removeWhitespace(value); string spaceless = VString::removeWhitespace(value);
for (int i = TS_100S; i < _ENUM_END; ++i) { for (int i = TS_100S; i < _ENUM_END; ++i) {
@ -1786,108 +1786,9 @@ void V3Options::showVersion(bool verbose) {
V3Options::V3Options() { V3Options::V3Options() {
m_impp = new V3OptionsImp; m_impp = new V3OptionsImp;
m_assert = false;
m_autoflush = false;
m_bboxSys = false;
m_bboxUnsup = false;
m_build = false;
m_cdc = false;
m_cmake = false;
m_context = true;
m_coverageLine = false;
m_coverageToggle = false;
m_coverageUnderscore = false;
m_coverageUser = false;
m_debugCheck = false;
m_debugCollision = false;
m_debugExitParse = false;
m_debugLeak = true;
m_debugNondeterminism = false;
m_debugPartition = false;
m_debugProtect = false;
m_debugSelfTest = false;
m_decoration = true;
m_dpiHdrOnly = false;
m_dumpDefines = false;
m_exe = false;
m_flatten = false;
m_gmake = false;
m_hierarchical = false;
m_hierChild = false;
m_ignc = false;
m_inhibitSim = false;
m_lintOnly = false;
m_makePhony = false;
m_main = false;
m_orderClockDly = true;
m_outFormatOk = false;
m_pedantic = false;
m_pinsBv = 65;
m_pinsScUint = false;
m_pinsScBigUint = false;
m_pinsUint8 = false;
m_ppComments = false;
m_profCFuncs = false;
m_profThreads = false;
m_protectIds = false;
m_preprocOnly = false;
m_preprocNoLine = false;
m_public = false;
m_publicFlatRW = false;
m_quietExit = false;
m_relativeCFuncs = true;
m_relativeIncludes = false;
m_reportUnoptflat = false;
m_savable = false;
m_stats = false;
m_statsVars = false;
m_structsPacked = true;
m_systemC = false;
m_threads = 0;
m_threadsDpiPure = true;
m_threadsDpiUnpure = false;
m_threadsCoarsen = true;
m_threadsMaxMTasks = 0;
m_trace = false;
m_traceCoverage = false;
m_traceFormat = TraceFormat::VCD; m_traceFormat = TraceFormat::VCD;
m_traceParams = true;
m_traceStructs = false;
m_traceUnderscore = false;
m_traceThreads = 0;
m_underlineZero = false;
m_verilate = true;
m_vpi = false;
m_xInitialEdge = false;
m_xmlOnly = false;
m_buildJobs = 1;
m_convergeLimit = 100;
m_dumpTree = 0;
m_dumpTreeAddrids = false;
m_gateStmts = 100;
m_ifDepth = 0;
m_inlineMult = 2000;
m_maxNumWidth = 65536;
m_moduleRecursion = 100;
m_outputSplit = 20000;
m_outputSplitCFuncs = -1;
m_outputSplitCTrace = -1;
m_traceDepth = 0;
m_traceMaxArray = 32;
m_traceMaxWidth = 256;
m_unrollCount = 64;
m_unrollStmts = 30000;
m_compLimitBlocks = 0;
m_compLimitMembers = 64;
m_compLimitParens = 0;
m_makeDir = "obj_dir"; m_makeDir = "obj_dir";
m_bin = "";
m_flags = "";
m_waiverOutput = "";
m_l2Name = "";
m_unusedRegexp = "*unused*"; m_unusedRegexp = "*unused*";
m_xAssign = "fast"; m_xAssign = "fast";

View File

@ -248,108 +248,108 @@ private:
std::map<string,string> m_parameters; // Parameters std::map<string,string> m_parameters; // Parameters
std::map<string, V3HierarchicalBlockOption> m_hierBlocks; // main switch: --hierarchical-block std::map<string, V3HierarchicalBlockOption> m_hierBlocks; // main switch: --hierarchical-block
bool m_preprocOnly; // main switch: -E bool m_preprocOnly = false; // main switch: -E
bool m_makePhony; // main switch: -MP bool m_makePhony = false; // main switch: -MP
bool m_preprocNoLine;// main switch: -P bool m_preprocNoLine = false; // main switch: -P
bool m_assert; // main switch: --assert bool m_assert = false; // main switch: --assert
bool m_autoflush; // main switch: --autoflush bool m_autoflush = false; // main switch: --autoflush
bool m_bboxSys; // main switch: --bbox-sys bool m_bboxSys = false; // main switch: --bbox-sys
bool m_bboxUnsup; // main switch: --bbox-unsup bool m_bboxUnsup = false; // main switch: --bbox-unsup
bool m_build; // main switch: --build bool m_build = false; // main switch: --build
bool m_cdc; // main switch: --cdc bool m_cdc = false; // main switch: --cdc
bool m_cmake; // main switch: --make cmake bool m_cmake = false; // main switch: --make cmake
bool m_context; // main switch: --Wcontext bool m_context = true; // main switch: --Wcontext
bool m_coverageLine; // main switch: --coverage-block bool m_coverageLine = false; // main switch: --coverage-block
bool m_coverageToggle;// main switch: --coverage-toggle bool m_coverageToggle = false; // main switch: --coverage-toggle
bool m_coverageUnderscore;// main switch: --coverage-underscore bool m_coverageUnderscore = false; // main switch: --coverage-underscore
bool m_coverageUser; // main switch: --coverage-func bool m_coverageUser = false; // main switch: --coverage-func
bool m_debugCheck; // main switch: --debug-check bool m_debugCheck = false; // main switch: --debug-check
bool m_debugCollision; // main switch: --debug-collision bool m_debugCollision = false; // main switch: --debug-collision
bool m_debugExitParse; // main switch: --debug-exit-parse bool m_debugExitParse = false; // main switch: --debug-exit-parse
bool m_debugLeak; // main switch: --debug-leak bool m_debugLeak = true; // main switch: --debug-leak
bool m_debugNondeterminism; // main switch: --debug-nondeterminism bool m_debugNondeterminism = false; // main switch: --debug-nondeterminism
bool m_debugPartition; // main switch: --debug-partition bool m_debugPartition = false; // main switch: --debug-partition
bool m_debugProtect; // main switch: --debug-protect bool m_debugProtect = false; // main switch: --debug-protect
bool m_debugSelfTest; // main switch: --debug-self-test bool m_debugSelfTest = false; // main switch: --debug-self-test
bool m_decoration; // main switch: --decoration bool m_decoration = true; // main switch: --decoration
bool m_dpiHdrOnly; // main switch: --dpi-hdr-only bool m_dpiHdrOnly = false; // main switch: --dpi-hdr-only
bool m_dumpDefines; // main switch: --dump-defines bool m_dumpDefines = false; // main switch: --dump-defines
bool m_exe; // main switch: --exe bool m_dumpTreeAddrids = false; // main switch: --dump-tree-addrids
bool m_flatten; // main switch: --flatten bool m_exe = false; // main switch: --exe
bool m_ignc; // main switch: --ignc bool m_flatten = false; // main switch: --flatten
bool m_inhibitSim; // main switch: --inhibit-sim bool m_hierarchical = false; // main switch: --hierarchical
bool m_lintOnly; // main switch: --lint-only bool m_hierChild = false; // main switch: --hierarchical-child
bool m_gmake; // main switch: --make gmake bool m_ignc = false; // main switch: --ignc
bool m_main; // main swithc: --main bool m_inhibitSim = false; // main switch: --inhibit-sim
bool m_orderClockDly;// main switch: --order-clock-delay bool m_lintOnly = false; // main switch: --lint-only
bool m_outFormatOk; // main switch: --cc, --sc or --sp was specified bool m_gmake = false; // main switch: --make gmake
bool m_pedantic; // main switch: --Wpedantic bool m_main = false; // main swithc: --main
bool m_pinsScUint; // main switch: --pins-sc-uint bool m_orderClockDly = true; // main switch: --order-clock-delay
bool m_pinsScBigUint;// main switch: --pins-sc-biguint bool m_outFormatOk = false; // main switch: --cc, --sc or --sp was specified
bool m_pinsUint8; // main switch: --pins-uint8 bool m_pedantic = false; // main switch: --Wpedantic
bool m_ppComments; // main switch: --pp-comments bool m_pinsScUint = false; // main switch: --pins-sc-uint
bool m_profCFuncs; // main switch: --prof-cfuncs bool m_pinsScBigUint = false; // main switch: --pins-sc-biguint
bool m_profThreads; // main switch: --prof-threads bool m_pinsUint8 = false; // main switch: --pins-uint8
bool m_protectIds; // main switch: --protect-ids bool m_ppComments = false; // main switch: --pp-comments
bool m_public; // main switch: --public bool m_profCFuncs = false; // main switch: --prof-cfuncs
bool m_publicFlatRW; // main switch: --public-flat-rw bool m_profThreads = false; // main switch: --prof-threads
bool m_quietExit; // main switch: --quiet-exit bool m_protectIds = false; // main switch: --protect-ids
bool m_relativeCFuncs; // main switch: --relative-cfuncs bool m_public = false; // main switch: --public
bool m_relativeIncludes; // main switch: --relative-includes bool m_publicFlatRW = false; // main switch: --public-flat-rw
bool m_reportUnoptflat; // main switch: --report-unoptflat bool m_quietExit = false; // main switch: --quiet-exit
bool m_savable; // main switch: --savable bool m_relativeCFuncs = true; // main switch: --relative-cfuncs
bool m_structsPacked; // main switch: --structs-packed bool m_relativeIncludes = false; // main switch: --relative-includes
bool m_systemC; // main switch: --sc: System C instead of simple C++ bool m_reportUnoptflat = false; // main switch: --report-unoptflat
bool m_stats; // main switch: --stats bool m_savable = false; // main switch: --savable
bool m_statsVars; // main switch: --stats-vars bool m_structsPacked = true; // main switch: --structs-packed
bool m_threadsCoarsen; // main switch: --threads-coarsen bool m_systemC = false; // main switch: --sc: System C instead of simple C++
bool m_threadsDpiPure; // main switch: --threads-dpi all/pure bool m_stats = false; // main switch: --stats
bool m_threadsDpiUnpure; // main switch: --threads-dpi all bool m_statsVars = false; // main switch: --stats-vars
bool m_trace; // main switch: --trace bool m_threadsCoarsen = true; // main switch: --threads-coarsen
bool m_traceCoverage; // main switch: --trace-coverage bool m_threadsDpiPure = true; // main switch: --threads-dpi all/pure
bool m_traceParams; // main switch: --trace-params bool m_threadsDpiUnpure = false; // main switch: --threads-dpi all
bool m_traceStructs; // main switch: --trace-structs bool m_trace = false; // main switch: --trace
bool m_traceUnderscore;// main switch: --trace-underscore bool m_traceCoverage = false; // main switch: --trace-coverage
bool m_underlineZero;// main switch: --underline-zero; undocumented old Verilator 2 bool m_traceParams = true; // main switch: --trace-params
bool m_verilate; // main swith: --verilate bool m_traceStructs = false; // main switch: --trace-structs
bool m_vpi; // main switch: --vpi bool m_traceUnderscore = false; // main switch: --trace-underscore
bool m_xInitialEdge; // main switch: --x-initial-edge bool m_underlineZero = false; // main switch: --underline-zero; undocumented old Verilator 2
bool m_xmlOnly; // main switch: --xml-only bool m_verilate = true; // main swith: --verilate
bool m_vpi = false; // main switch: --vpi
bool m_xInitialEdge = false; // main switch: --x-initial-edge
bool m_xmlOnly = false; // main switch: --xml-only
int m_buildJobs; // main switch: -j int m_buildJobs = 1; // main switch: -j
int m_convergeLimit;// main switch: --converge-limit int m_convergeLimit = 100; // main switch: --converge-limit
int m_dumpTree; // main switch: --dump-tree int m_dumpTree = 0; // main switch: --dump-tree
bool m_dumpTreeAddrids;// main switch: --dump-tree-addrids int m_gateStmts = 100; // main switch: --gate-stmts
int m_gateStmts; // main switch: --gate-stmts int m_ifDepth = 0; // main switch: --if-depth
bool m_hierarchical; // main switch: --hierarchical int m_inlineMult = 2000; // main switch: --inline-mult
bool m_hierChild; // main switch: --hierarchical-child
int m_ifDepth; // main switch: --if-depth
int m_inlineMult; // main switch: --inline-mult
VOptionBool m_makeDepend; // main switch: -MMD VOptionBool m_makeDepend; // main switch: -MMD
int m_maxNumWidth; // main switch: --max-num-width int m_maxNumWidth = 65536; // main switch: --max-num-width
int m_moduleRecursion;// main switch: --module-recursion-depth int m_moduleRecursion = 100; // main switch: --module-recursion-depth
int m_outputSplit; // main switch: --output-split int m_outputSplit = 20000; // main switch: --output-split
int m_outputSplitCFuncs;// main switch: --output-split-cfuncs int m_outputSplitCFuncs = -1; // main switch: --output-split-cfuncs
int m_outputSplitCTrace;// main switch: --output-split-ctrace int m_outputSplitCTrace = -1; // main switch: --output-split-ctrace
int m_pinsBv; // main switch: --pins-bv int m_pinsBv = 65; // main switch: --pins-bv
VOptionBool m_skipIdentical; // main switch: --skip-identical VOptionBool m_skipIdentical; // main switch: --skip-identical
int m_threads; // main switch: --threads (0 == --no-threads) int m_threads = 0; // main switch: --threads (0 == --no-threads)
int m_threadsMaxMTasks; // main switch: --threads-max-mtasks int m_threadsMaxMTasks = 0; // main switch: --threads-max-mtasks
VTimescale m_timeDefaultPrec; // main switch: --timescale VTimescale m_timeDefaultPrec; // main switch: --timescale
VTimescale m_timeDefaultUnit; // main switch: --timescale VTimescale m_timeDefaultUnit; // main switch: --timescale
VTimescale m_timeOverridePrec; // main switch: --timescale-override VTimescale m_timeOverridePrec; // main switch: --timescale-override
VTimescale m_timeOverrideUnit; // main switch: --timescale-override VTimescale m_timeOverrideUnit; // main switch: --timescale-override
int m_traceDepth; // main switch: --trace-depth int m_traceDepth = 0; // main switch: --trace-depth
TraceFormat m_traceFormat; // main switch: --trace or --trace-fst TraceFormat m_traceFormat; // main switch: --trace or --trace-fst
int m_traceMaxArray;// main switch: --trace-max-array int m_traceMaxArray = 32; // main switch: --trace-max-array
int m_traceMaxWidth;// main switch: --trace-max-width int m_traceMaxWidth = 256; // main switch: --trace-max-width
int m_traceThreads; // main switch: --trace-threads int m_traceThreads = 0; // main switch: --trace-threads
int m_unrollCount; // main switch: --unroll-count int m_unrollCount = 64; // main switch: --unroll-count
int m_unrollStmts; // main switch: --unroll-stmts int m_unrollStmts = 30000; // main switch: --unroll-stmts
int m_compLimitBlocks; // compiler selection; number of nested blocks int m_compLimitBlocks = 0; // compiler selection; number of nested blocks
int m_compLimitMembers; // compiler selection; number of members in struct before make anon array int m_compLimitMembers = 64; // compiler selection; number of members in struct before make anon array
int m_compLimitParens; // compiler selection; number of nested parens int m_compLimitParens = 0; // compiler selection; number of nested parens
string m_bin; // main switch: --bin {binary} string m_bin; // main switch: --bin {binary}
string m_exeName; // main switch: -o {name} string m_exeName; // main switch: -o {name}

View File

@ -138,8 +138,8 @@ private:
public: public:
OrderMoveDomScope(const AstSenTree* domainp, const AstScope* scopep) OrderMoveDomScope(const AstSenTree* domainp, const AstScope* scopep)
: m_domainp(domainp) : m_domainp{domainp}
, m_scopep(scopep) {} , m_scopep{scopep} {}
OrderMoveDomScope* readyDomScopeNextp() const { return m_readyDomScopeE.nextp(); } OrderMoveDomScope* readyDomScopeNextp() const { return m_readyDomScopeE.nextp(); }
const AstSenTree* domainp() const { return m_domainp; } const AstSenTree* domainp() const { return m_domainp; }
const AstScope* scopep() const { return m_scopep; } const AstScope* scopep() const { return m_scopep; }
@ -253,12 +253,12 @@ struct OrderVarFanoutCmp {
// //
class OrderClkMarkVisitor : public AstNVisitor { class OrderClkMarkVisitor : public AstNVisitor {
private: private:
bool m_hasClk; // flag indicating whether there is clock signal on rhs bool m_hasClk = false; // flag indicating whether there is clock signal on rhs
bool m_inClocked; // Currently inside a sequential block bool m_inClocked = false; // Currently inside a sequential block
bool m_newClkMarked; // Flag for deciding whether a new run is needed bool m_newClkMarked; // Flag for deciding whether a new run is needed
bool m_inAss; // Currently inside of a assignment bool m_inAss = false; // Currently inside of a assignment
int m_childClkWidth; // If in hasClk, width of clock signal in child int m_childClkWidth = 0; // If in hasClk, width of clock signal in child
int m_rightClkWidth; // Clk width on the RHS int m_rightClkWidth = 0; // Clk width on the RHS
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -360,11 +360,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit OrderClkMarkVisitor(AstNode* nodep) { explicit OrderClkMarkVisitor(AstNode* nodep) {
m_hasClk = false;
m_inClocked = false;
m_inAss = false;
m_childClkWidth = 0;
m_rightClkWidth = 0;
do { do {
m_newClkMarked = false; m_newClkMarked = false;
iterate(nodep); iterate(nodep);
@ -378,7 +373,7 @@ public:
class OrderClkAssVisitor : public AstNVisitor { class OrderClkAssVisitor : public AstNVisitor {
private: private:
bool m_clkAss; // There is signals marked as clocker in the assignment bool m_clkAss = false; // There is signals marked as clocker in the assignment
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
virtual void visit(AstNodeAssign* nodep) override { virtual void visit(AstNodeAssign* nodep) override {
@ -400,10 +395,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit OrderClkAssVisitor(AstNode* nodep) { explicit OrderClkAssVisitor(AstNode* nodep) { iterate(nodep); }
m_clkAss = false;
iterate(nodep);
}
virtual ~OrderClkAssVisitor() override {} virtual ~OrderClkAssVisitor() override {}
// METHODS // METHODS
bool isClkAss() { return m_clkAss; } bool isClkAss() { return m_clkAss; }
@ -461,9 +453,9 @@ public:
ProcessMoveBuildGraph(const V3Graph* logicGraphp, // Input graph of OrderLogicVertex etc. ProcessMoveBuildGraph(const V3Graph* logicGraphp, // Input graph of OrderLogicVertex etc.
V3Graph* outGraphp, // Output graph of T_MoveVertex's V3Graph* outGraphp, // Output graph of T_MoveVertex's
MoveVertexMaker* vxMakerp) MoveVertexMaker* vxMakerp)
: m_graphp(logicGraphp) : m_graphp{logicGraphp}
, m_outGraphp(outGraphp) , m_outGraphp{outGraphp}
, m_vxMakerp(vxMakerp) {} , m_vxMakerp{vxMakerp} {}
virtual ~ProcessMoveBuildGraph() {} virtual ~ProcessMoveBuildGraph() {}
// METHODS // METHODS
@ -566,8 +558,8 @@ class OrderMoveVertexMaker : public ProcessMoveBuildGraph<OrderMoveVertex>::Move
public: public:
// CONSTRUCTORS // CONSTRUCTORS
OrderMoveVertexMaker(V3Graph* pomGraphp, V3List<OrderMoveVertex*>* pomWaitingp) OrderMoveVertexMaker(V3Graph* pomGraphp, V3List<OrderMoveVertex*>* pomWaitingp)
: m_pomGraphp(pomGraphp) : m_pomGraphp{pomGraphp}
, m_pomWaitingp(pomWaitingp) {} , m_pomWaitingp{pomWaitingp} {}
// METHODS // METHODS
OrderMoveVertex* makeVertexp(OrderLogicVertex* lvertexp, const OrderEitherVertex*, OrderMoveVertex* makeVertexp(OrderLogicVertex* lvertexp, const OrderEitherVertex*,
const AstScope* scopep, const AstSenTree* domainp) { const AstScope* scopep, const AstSenTree* domainp) {
@ -590,7 +582,7 @@ class OrderMTaskMoveVertexMaker : public ProcessMoveBuildGraph<MTaskMoveVertex>:
public: public:
explicit OrderMTaskMoveVertexMaker(V3Graph* pomGraphp) explicit OrderMTaskMoveVertexMaker(V3Graph* pomGraphp)
: m_pomGraphp(pomGraphp) {} : m_pomGraphp{pomGraphp} {}
MTaskMoveVertex* makeVertexp(OrderLogicVertex* lvertexp, const OrderEitherVertex* varVertexp, MTaskMoveVertex* makeVertexp(OrderLogicVertex* lvertexp, const OrderEitherVertex* varVertexp,
const AstScope* scopep, const AstSenTree* domainp) { const AstScope* scopep, const AstSenTree* domainp) {
// Exclude initial/settle logic from the mtasks graph. // Exclude initial/settle logic from the mtasks graph.

View File

@ -127,17 +127,17 @@ class OrderEitherVertex : public V3GraphVertex {
bool m_isFromInput; // From input, or derived therefrom (conservatively false) bool m_isFromInput; // From input, or derived therefrom (conservatively false)
protected: protected:
OrderEitherVertex(V3Graph* graphp, const OrderEitherVertex& old) OrderEitherVertex(V3Graph* graphp, const OrderEitherVertex& old)
: V3GraphVertex(graphp, old) : V3GraphVertex{graphp, old}
, m_scopep(old.m_scopep) , m_scopep{old.m_scopep}
, m_domainp(old.m_domainp) , m_domainp{old.m_domainp}
, m_isFromInput(old.m_isFromInput) {} , m_isFromInput{old.m_isFromInput} {}
public: public:
OrderEitherVertex(V3Graph* graphp, AstScope* scopep, AstSenTree* domainp) OrderEitherVertex(V3Graph* graphp, AstScope* scopep, AstSenTree* domainp)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_scopep(scopep) , m_scopep{scopep}
, m_domainp(domainp) , m_domainp{domainp}
, m_isFromInput(false) {} , m_isFromInput{false} {}
virtual ~OrderEitherVertex() override {} virtual ~OrderEitherVertex() override {}
virtual OrderEitherVertex* clone(V3Graph* graphp) const override = 0; virtual OrderEitherVertex* clone(V3Graph* graphp) const override = 0;
// Methods // Methods
@ -154,11 +154,11 @@ public:
class OrderInputsVertex : public OrderEitherVertex { class OrderInputsVertex : public OrderEitherVertex {
OrderInputsVertex(V3Graph* graphp, const OrderInputsVertex& old) OrderInputsVertex(V3Graph* graphp, const OrderInputsVertex& old)
: OrderEitherVertex(graphp, old) {} : OrderEitherVertex{graphp, old} {}
public: public:
OrderInputsVertex(V3Graph* graphp, AstSenTree* domainp) OrderInputsVertex(V3Graph* graphp, AstSenTree* domainp)
: OrderEitherVertex(graphp, nullptr, domainp) { : OrderEitherVertex{graphp, nullptr, domainp} {
isFromInput(true); // By definition isFromInput(true); // By definition
} }
virtual ~OrderInputsVertex() override {} virtual ~OrderInputsVertex() override {}
@ -177,13 +177,13 @@ class OrderLogicVertex : public OrderEitherVertex {
protected: protected:
OrderLogicVertex(V3Graph* graphp, const OrderLogicVertex& old) OrderLogicVertex(V3Graph* graphp, const OrderLogicVertex& old)
: OrderEitherVertex(graphp, old) : OrderEitherVertex{graphp, old}
, m_nodep(old.m_nodep) {} , m_nodep{old.m_nodep} {}
public: public:
OrderLogicVertex(V3Graph* graphp, AstScope* scopep, AstSenTree* domainp, AstNode* nodep) OrderLogicVertex(V3Graph* graphp, AstScope* scopep, AstSenTree* domainp, AstNode* nodep)
: OrderEitherVertex(graphp, scopep, domainp) : OrderEitherVertex{graphp, scopep, domainp}
, m_nodep(nodep) {} , m_nodep{nodep} {}
virtual ~OrderLogicVertex() override {} virtual ~OrderLogicVertex() override {}
virtual OrderLogicVertex* clone(V3Graph* graphp) const override { virtual OrderLogicVertex* clone(V3Graph* graphp) const override {
return new OrderLogicVertex(graphp, *this); return new OrderLogicVertex(graphp, *this);
@ -204,17 +204,17 @@ class OrderVarVertex : public OrderEitherVertex {
bool m_isDelayed; // Set in a delayed assignment bool m_isDelayed; // Set in a delayed assignment
protected: protected:
OrderVarVertex(V3Graph* graphp, const OrderVarVertex& old) OrderVarVertex(V3Graph* graphp, const OrderVarVertex& old)
: OrderEitherVertex(graphp, old) : OrderEitherVertex{graphp, old}
, m_varScp(old.m_varScp) , m_varScp{old.m_varScp}
, m_isClock(old.m_isClock) , m_isClock{old.m_isClock}
, m_isDelayed(old.m_isDelayed) {} , m_isDelayed{old.m_isDelayed} {}
public: public:
OrderVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) OrderVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: OrderEitherVertex(graphp, scopep, nullptr) : OrderEitherVertex{graphp, scopep, nullptr}
, m_varScp(varScp) , m_varScp{varScp}
, m_isClock(false) , m_isClock{false}
, m_isDelayed(false) {} , m_isDelayed{false} {}
virtual ~OrderVarVertex() override {} virtual ~OrderVarVertex() override {}
virtual OrderVarVertex* clone(V3Graph* graphp) const override = 0; virtual OrderVarVertex* clone(V3Graph* graphp) const override = 0;
virtual OrderVEdgeType type() const override = 0; virtual OrderVEdgeType type() const override = 0;
@ -229,11 +229,11 @@ public:
class OrderVarStdVertex : public OrderVarVertex { class OrderVarStdVertex : public OrderVarVertex {
OrderVarStdVertex(V3Graph* graphp, const OrderVarStdVertex& old) OrderVarStdVertex(V3Graph* graphp, const OrderVarStdVertex& old)
: OrderVarVertex(graphp, old) {} : OrderVarVertex{graphp, old} {}
public: public:
OrderVarStdVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) OrderVarStdVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: OrderVarVertex(graphp, scopep, varScp) {} : OrderVarVertex{graphp, scopep, varScp} {}
virtual ~OrderVarStdVertex() override {} virtual ~OrderVarStdVertex() override {}
virtual OrderVarStdVertex* clone(V3Graph* graphp) const override { virtual OrderVarStdVertex* clone(V3Graph* graphp) const override {
return new OrderVarStdVertex(graphp, *this); return new OrderVarStdVertex(graphp, *this);
@ -247,11 +247,11 @@ public:
}; };
class OrderVarPreVertex : public OrderVarVertex { class OrderVarPreVertex : public OrderVarVertex {
OrderVarPreVertex(V3Graph* graphp, const OrderVarPreVertex& old) OrderVarPreVertex(V3Graph* graphp, const OrderVarPreVertex& old)
: OrderVarVertex(graphp, old) {} : OrderVarVertex{graphp, old} {}
public: public:
OrderVarPreVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) OrderVarPreVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: OrderVarVertex(graphp, scopep, varScp) {} : OrderVarVertex{graphp, scopep, varScp} {}
virtual ~OrderVarPreVertex() override {} virtual ~OrderVarPreVertex() override {}
virtual OrderVarPreVertex* clone(V3Graph* graphp) const override { virtual OrderVarPreVertex* clone(V3Graph* graphp) const override {
return new OrderVarPreVertex(graphp, *this); return new OrderVarPreVertex(graphp, *this);
@ -265,11 +265,11 @@ public:
}; };
class OrderVarPostVertex : public OrderVarVertex { class OrderVarPostVertex : public OrderVarVertex {
OrderVarPostVertex(V3Graph* graphp, const OrderVarPostVertex& old) OrderVarPostVertex(V3Graph* graphp, const OrderVarPostVertex& old)
: OrderVarVertex(graphp, old) {} : OrderVarVertex{graphp, old} {}
public: public:
OrderVarPostVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) OrderVarPostVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: OrderVarVertex(graphp, scopep, varScp) {} : OrderVarVertex{graphp, scopep, varScp} {}
virtual OrderVarPostVertex* clone(V3Graph* graphp) const override { virtual OrderVarPostVertex* clone(V3Graph* graphp) const override {
return new OrderVarPostVertex(graphp, *this); return new OrderVarPostVertex(graphp, *this);
} }
@ -283,11 +283,11 @@ public:
}; };
class OrderVarPordVertex : public OrderVarVertex { class OrderVarPordVertex : public OrderVarVertex {
OrderVarPordVertex(V3Graph* graphp, const OrderVarPordVertex& old) OrderVarPordVertex(V3Graph* graphp, const OrderVarPordVertex& old)
: OrderVarVertex(graphp, old) {} : OrderVarVertex{graphp, old} {}
public: public:
OrderVarPordVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) OrderVarPordVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: OrderVarVertex(graphp, scopep, varScp) {} : OrderVarVertex{graphp, scopep, varScp} {}
virtual ~OrderVarPordVertex() override {} virtual ~OrderVarPordVertex() override {}
virtual OrderVarPordVertex* clone(V3Graph* graphp) const override { virtual OrderVarPordVertex* clone(V3Graph* graphp) const override {
return new OrderVarPordVertex(graphp, *this); return new OrderVarPordVertex(graphp, *this);
@ -301,11 +301,11 @@ public:
}; };
class OrderVarSettleVertex : public OrderVarVertex { class OrderVarSettleVertex : public OrderVarVertex {
OrderVarSettleVertex(V3Graph* graphp, const OrderVarSettleVertex& old) OrderVarSettleVertex(V3Graph* graphp, const OrderVarSettleVertex& old)
: OrderVarVertex(graphp, old) {} : OrderVarVertex{graphp, old} {}
public: public:
OrderVarSettleVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp) OrderVarSettleVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
: OrderVarVertex(graphp, scopep, varScp) {} : OrderVarVertex{graphp, scopep, varScp} {}
virtual ~OrderVarSettleVertex() override {} virtual ~OrderVarSettleVertex() override {}
virtual OrderVarSettleVertex* clone(V3Graph* graphp) const override { virtual OrderVarSettleVertex* clone(V3Graph* graphp) const override {
return new OrderVarSettleVertex(graphp, *this); return new OrderVarSettleVertex(graphp, *this);
@ -338,10 +338,10 @@ protected:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
OrderMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp) OrderMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_logicp(logicp) , m_logicp{logicp}
, m_state(POM_WAIT) , m_state{POM_WAIT}
, m_domScopep(nullptr) {} , m_domScopep{nullptr} {}
virtual ~OrderMoveVertex() override {} virtual ~OrderMoveVertex() override {}
virtual OrderMoveVertex* clone(V3Graph* graphp) const override { virtual OrderMoveVertex* clone(V3Graph* graphp) const override {
v3fatalSrc("Unsupported"); v3fatalSrc("Unsupported");
@ -405,11 +405,11 @@ protected:
public: public:
MTaskMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp, const OrderEitherVertex* varp, MTaskMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp, const OrderEitherVertex* varp,
const AstScope* scopep, const AstSenTree* domainp) const AstScope* scopep, const AstSenTree* domainp)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_logicp(logicp) , m_logicp{logicp}
, m_varp(varp) , m_varp{varp}
, m_scopep(scopep) , m_scopep{scopep}
, m_domainp(domainp) { , m_domainp{domainp} {
UASSERT(!(logicp && varp), "MTaskMoveVertex: logicp and varp may not both be set!\n"); UASSERT(!(logicp && varp), "MTaskMoveVertex: logicp and varp may not both be set!\n");
} }
virtual ~MTaskMoveVertex() override {} virtual ~MTaskMoveVertex() override {}
@ -451,12 +451,12 @@ public:
class OrderEdge : public V3GraphEdge { class OrderEdge : public V3GraphEdge {
protected: protected:
OrderEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, const OrderEdge& old) OrderEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, const OrderEdge& old)
: V3GraphEdge(graphp, fromp, top, old) {} : V3GraphEdge{graphp, fromp, top, old} {}
public: public:
OrderEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, OrderEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight,
bool cutable = false) bool cutable = false)
: V3GraphEdge(graphp, fromp, top, weight, cutable) {} : V3GraphEdge{graphp, fromp, top, weight, cutable} {}
virtual ~OrderEdge() override {} virtual ~OrderEdge() override {}
virtual OrderVEdgeType type() const { return OrderVEdgeType::EDGE_STD; } virtual OrderVEdgeType type() const { return OrderVEdgeType::EDGE_STD; }
virtual OrderEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, virtual OrderEdge* clone(V3Graph* graphp, V3GraphVertex* fromp,
@ -479,11 +479,11 @@ class OrderComboCutEdge : public OrderEdge {
// in which case we'll need a change detect loop around this var. // in which case we'll need a change detect loop around this var.
OrderComboCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, OrderComboCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top,
const OrderComboCutEdge& old) const OrderComboCutEdge& old)
: OrderEdge(graphp, fromp, top, old) {} : OrderEdge{graphp, fromp, top, old} {}
public: public:
OrderComboCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) OrderComboCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: OrderEdge(graphp, fromp, top, WEIGHT_COMBO, CUTABLE) {} : OrderEdge{graphp, fromp, top, WEIGHT_COMBO, CUTABLE} {}
virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_COMBOCUT; } virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_COMBOCUT; }
virtual ~OrderComboCutEdge() override {} virtual ~OrderComboCutEdge() override {}
virtual OrderComboCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, virtual OrderComboCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp,
@ -500,11 +500,11 @@ class OrderPostCutEdge : public OrderEdge {
// in which case we'll need a change detect loop around this var. // in which case we'll need a change detect loop around this var.
OrderPostCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, OrderPostCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top,
const OrderPostCutEdge& old) const OrderPostCutEdge& old)
: OrderEdge(graphp, fromp, top, old) {} : OrderEdge{graphp, fromp, top, old} {}
public: public:
OrderPostCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) OrderPostCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: OrderEdge(graphp, fromp, top, WEIGHT_COMBO, CUTABLE) {} : OrderEdge{graphp, fromp, top, WEIGHT_COMBO, CUTABLE} {}
virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_POSTCUT; } virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_POSTCUT; }
virtual ~OrderPostCutEdge() override {} virtual ~OrderPostCutEdge() override {}
virtual OrderPostCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, virtual OrderPostCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp,
@ -521,11 +521,11 @@ class OrderPreCutEdge : public OrderEdge {
// in which case we can't optimize away the pre/post delayed assignments // in which case we can't optimize away the pre/post delayed assignments
OrderPreCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, OrderPreCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top,
const OrderPreCutEdge& old) const OrderPreCutEdge& old)
: OrderEdge(graphp, fromp, top, old) {} : OrderEdge{graphp, fromp, top, old} {}
public: public:
OrderPreCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) OrderPreCutEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: OrderEdge(graphp, fromp, top, WEIGHT_PRE, CUTABLE) {} : OrderEdge{graphp, fromp, top, WEIGHT_PRE, CUTABLE} {}
virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_PRECUT; } virtual OrderVEdgeType type() const override { return OrderVEdgeType::EDGE_PRECUT; }
virtual OrderPreCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp, virtual OrderPreCutEdge* clone(V3Graph* graphp, V3GraphVertex* fromp,
V3GraphVertex* top) const override { V3GraphVertex* top) const override {

View File

@ -222,14 +222,15 @@ private:
struct ModInfo { struct ModInfo {
AstNodeModule* m_modp; // Module with specified name AstNodeModule* m_modp; // Module with specified name
CloneMap m_cloneMap; // Map of old-varp -> new cloned varp CloneMap m_cloneMap; // Map of old-varp -> new cloned varp
explicit ModInfo(AstNodeModule* modp) { m_modp = modp; } explicit ModInfo(AstNodeModule* modp)
: m_modp{modp} {}
}; };
typedef std::map<string, ModInfo> ModNameMap; typedef std::map<string, ModInfo> ModNameMap;
ModNameMap m_modNameMap; // Hash of created module flavors by name ModNameMap m_modNameMap; // Hash of created module flavors by name
typedef std::map<string, string> LongMap; typedef std::map<string, string> LongMap;
LongMap m_longMap; // Hash of very long names to unique identity number LongMap m_longMap; // Hash of very long names to unique identity number
int m_longId; int m_longId = 0;
// All module names that are loaded from source code // All module names that are loaded from source code
// Generated modules by this visitor is not included // Generated modules by this visitor is not included
@ -238,7 +239,7 @@ private:
typedef std::pair<int, string> ValueMapValue; typedef std::pair<int, string> ValueMapValue;
typedef std::map<V3Hash, ValueMapValue> ValueMap; typedef std::map<V3Hash, ValueMapValue> ValueMap;
ValueMap m_valueMap; // Hash of node hash to (param value, name) ValueMap m_valueMap; // Hash of node hash to (param value, name)
int m_nextValue; // Next value to use in m_valueMap int m_nextValue = 1; // Next value to use in m_valueMap
typedef std::multimap<int, AstNodeModule*> LevelModMap; typedef std::multimap<int, AstNodeModule*> LevelModMap;
LevelModMap m_todoModps; // Modules left to process LevelModMap m_todoModps; // Modules left to process
@ -246,14 +247,10 @@ private:
typedef std::deque<AstCell*> CellList; typedef std::deque<AstCell*> CellList;
CellList m_cellps; // Cells left to process (in this module) CellList m_cellps; // Cells left to process (in this module)
AstNodeFTask* m_ftaskp; // Function/task reference AstNodeFTask* m_ftaskp = nullptr; // Function/task reference
AstNodeModule* m_modp = nullptr; // Current module being processed
AstNodeModule* m_modp; // Current module being processed
string m_unlinkedTxt; // Text for AstUnlinkedRef string m_unlinkedTxt; // Text for AstUnlinkedRef
UnrollStateful m_unroller; // Loop unroller UnrollStateful m_unroller; // Loop unroller
string m_generateHierName; // Generate portion of hierarchy name string m_generateHierName; // Generate portion of hierarchy name
// Database to get protect-lib wrapper that matches parameters in hierarchical Verilation // Database to get protect-lib wrapper that matches parameters in hierarchical Verilation
@ -784,11 +781,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ParamVisitor(AstNetlist* nodep) explicit ParamVisitor(AstNetlist* nodep)
: m_hierBlocks(v3Global.opt.hierBlocks(), nodep) { : m_hierBlocks{v3Global.opt.hierBlocks(), nodep} {
m_longId = 0;
m_ftaskp = nullptr;
m_modp = nullptr;
m_nextValue = 1;
for (AstNodeModule* modp = nodep->modulesp(); modp; for (AstNodeModule* modp = nodep->modulesp(); modp;
modp = VN_CAST(modp->nextp(), NodeModule)) { modp = VN_CAST(modp->nextp(), NodeModule)) {
m_allModuleNames.insert(modp->name()); m_allModuleNames.insert(modp->name());

View File

@ -301,9 +301,9 @@ public:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
V3ParseImp(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* parserSymp) V3ParseImp(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* parserSymp)
: m_rootp(rootp) : m_rootp{rootp}
, m_filterp(filterp) , m_filterp{filterp}
, m_symp(parserSymp) { , m_symp{parserSymp} {
m_lexFileline = nullptr; m_lexFileline = nullptr;
m_lexerp = nullptr; m_lexerp = nullptr;
m_inLibrary = false; m_inLibrary = false;

View File

@ -36,7 +36,7 @@ class V3Lexer : public V3LexerBase {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
V3Lexer() V3Lexer()
: V3LexerBase(nullptr) {} : V3LexerBase{nullptr} {}
~V3Lexer() {} ~V3Lexer() {}
// METHODS // METHODS
void unputString(const char* textp, size_t length) { void unputString(const char* textp, size_t length) {

View File

@ -38,17 +38,16 @@ private:
// MEMBERS // MEMBERS
static int s_anonNum; // Number of next anonymous object (parser use only) static int s_anonNum; // Number of next anonymous object (parser use only)
VSymGraph m_syms; // Graph of symbol tree VSymGraph m_syms; // Graph of symbol tree
VSymEnt* m_symTableNextId; // Symbol table for next lexer lookup (parser use only) VSymEnt* m_symTableNextId = nullptr; // Symbol table for next lexer lookup (parser use only)
VSymEnt* m_symCurrentp; // Active symbol table for additions/lookups VSymEnt* m_symCurrentp; // Active symbol table for additions/lookups
SymStack m_sympStack; // Stack of upper nodes with pending symbol tables SymStack m_sympStack; // Stack of upper nodes with pending symbol tables
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit V3ParseSym(AstNetlist* rootp) explicit V3ParseSym(AstNetlist* rootp)
: m_syms(rootp) { : m_syms{rootp} {
s_anonNum = 0; // Number of next anonymous object s_anonNum = 0; // Number of next anonymous object
pushScope(findNewTable(rootp)); pushScope(findNewTable(rootp));
m_symTableNextId = nullptr;
m_symCurrentp = symCurrentp(); m_symCurrentp = symCurrentp();
} }
~V3ParseSym() {} ~V3ParseSym() {}

View File

@ -195,10 +195,10 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
PartPropagateCp(V3Graph* graphp, GraphWay way, T_CostAccessor* accessp, bool slowAsserts, PartPropagateCp(V3Graph* graphp, GraphWay way, T_CostAccessor* accessp, bool slowAsserts,
V3EdgeFuncP edgeFuncp = &V3GraphEdge::followAlwaysTrue) V3EdgeFuncP edgeFuncp = &V3GraphEdge::followAlwaysTrue)
: GraphAlg<>(graphp, edgeFuncp) : GraphAlg<>{graphp, edgeFuncp}
, m_way(way) , m_way{way}
, m_accessp(accessp) , m_accessp{accessp}
, m_slowAsserts(slowAsserts) {} , m_slowAsserts{slowAsserts} {}
// METHODS // METHODS
void cpHasIncreased(V3GraphVertex* vxp, uint32_t newInclusiveCp) { void cpHasIncreased(V3GraphVertex* vxp, uint32_t newInclusiveCp) {
@ -472,7 +472,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
LogicMTask(V3Graph* graphp, MTaskMoveVertex* mtmvVxp) LogicMTask(V3Graph* graphp, MTaskMoveVertex* mtmvVxp)
: AbstractLogicMTask(graphp) { : AbstractLogicMTask{graphp} {
for (int i = 0; i < GraphWay::NUM_WAYS; ++i) m_critPathCost[i] = 0; for (int i = 0; i < GraphWay::NUM_WAYS; ++i) m_critPathCost[i] = 0;
if (mtmvVxp) { // Else null for test if (mtmvVxp) { // Else null for test
m_vertices.push_back(mtmvVxp); m_vertices.push_back(mtmvVxp);
@ -784,7 +784,7 @@ class MTaskEdge : public V3GraphEdge, public MergeCandidate {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
MTaskEdge(V3Graph* graphp, LogicMTask* fromp, LogicMTask* top, int weight) MTaskEdge(V3Graph* graphp, LogicMTask* fromp, LogicMTask* top, int weight)
: V3GraphEdge(graphp, fromp, top, weight) { : V3GraphEdge{graphp, fromp, top, weight} {
fromp->addRelative(GraphWay::FORWARD, top); fromp->addRelative(GraphWay::FORWARD, top);
top->addRelative(GraphWay::REVERSE, fromp); top->addRelative(GraphWay::REVERSE, fromp);
} }
@ -860,7 +860,7 @@ class PartParallelismEst {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit PartParallelismEst(const V3Graph* graphp) explicit PartParallelismEst(const V3Graph* graphp)
: m_graphp(graphp) {} : m_graphp{graphp} {}
// METHODS // METHODS
uint32_t totalGraphCost() const { return m_totalGraphCost; } uint32_t totalGraphCost() const { return m_totalGraphCost; }
@ -1084,10 +1084,10 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
PartContraction(V3Graph* mtasksp, uint32_t scoreLimit, bool slowAsserts) PartContraction(V3Graph* mtasksp, uint32_t scoreLimit, bool slowAsserts)
: m_mtasksp(mtasksp) : m_mtasksp{mtasksp}
, m_scoreLimit(scoreLimit) , m_scoreLimit{scoreLimit}
, m_slowAsserts(slowAsserts) , m_slowAsserts{slowAsserts}
, m_sb(&mergeCandidateScore, slowAsserts) {} , m_sb{&mergeCandidateScore, slowAsserts} {}
// METHODS // METHODS
void go() { void go() {
@ -1789,12 +1789,11 @@ private:
// MEMBERS // MEMBERS
V3Graph* m_mtasksp; // Mtask graph V3Graph* m_mtasksp; // Mtask graph
Olv2MTaskMap m_olv2mtask; // Map OrderLogicVertex to LogicMTask who wraps it Olv2MTaskMap m_olv2mtask; // Map OrderLogicVertex to LogicMTask who wraps it
unsigned m_mergesDone; // Number of MTasks merged. For stats only. unsigned m_mergesDone = 0; // Number of MTasks merged. For stats only.
public: public:
// CONSTRUCTORs // CONSTRUCTORs
explicit PartFixDataHazards(V3Graph* mtasksp) explicit PartFixDataHazards(V3Graph* mtasksp)
: m_mtasksp(mtasksp) : m_mtasksp{mtasksp} {}
, m_mergesDone(0) {}
// METHODS // METHODS
private: private:
void findAdjacentTasks(OvvSet::iterator ovvIt, TasksByRank* tasksByRankp) { void findAdjacentTasks(OvvSet::iterator ovvIt, TasksByRank* tasksByRankp) {
@ -2073,11 +2072,11 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit PartPackMTasks(V3Graph* mtasksp, uint32_t nThreads = v3Global.opt.threads(), explicit PartPackMTasks(V3Graph* mtasksp, uint32_t nThreads = v3Global.opt.threads(),
unsigned sandbagNumerator = 30, unsigned sandbagDenom = 100) unsigned sandbagNumerator = 30, unsigned sandbagDenom = 100)
: m_mtasksp(mtasksp) : m_mtasksp{mtasksp}
, m_nThreads(nThreads) , m_nThreads{nThreads}
, m_sandbagNumerator(sandbagNumerator) , m_sandbagNumerator{sandbagNumerator}
, m_sandbagDenom(sandbagDenom) , m_sandbagDenom{sandbagDenom}
, m_ready(m_mtaskCmp) {} , m_ready{m_mtaskCmp} {}
~PartPackMTasks() {} ~PartPackMTasks() {}
// METHODS // METHODS

View File

@ -40,7 +40,7 @@ class V3Partition {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit V3Partition(V3Graph* fineDepsGraphp) explicit V3Partition(V3Graph* fineDepsGraphp)
: m_fineDepsGraphp(fineDepsGraphp) {} : m_fineDepsGraphp{fineDepsGraphp} {}
~V3Partition() {} ~V3Partition() {}
// METHODS // METHODS

View File

@ -31,7 +31,7 @@
class AbstractMTask : public V3GraphVertex { class AbstractMTask : public V3GraphVertex {
public: public:
AbstractMTask(V3Graph* graphp) AbstractMTask(V3Graph* graphp)
: V3GraphVertex(graphp) {} : V3GraphVertex{graphp} {}
virtual ~AbstractMTask() override {} virtual ~AbstractMTask() override {}
virtual uint32_t id() const = 0; virtual uint32_t id() const = 0;
virtual uint32_t cost() const = 0; virtual uint32_t cost() const = 0;
@ -43,7 +43,7 @@ public:
typedef std::list<MTaskMoveVertex*> VxList; typedef std::list<MTaskMoveVertex*> VxList;
// CONSTRUCTORS // CONSTRUCTORS
AbstractLogicMTask(V3Graph* graphp) AbstractLogicMTask(V3Graph* graphp)
: AbstractMTask(graphp) {} : AbstractMTask{graphp} {}
virtual ~AbstractLogicMTask() override {} virtual ~AbstractLogicMTask() override {}
// METHODS // METHODS
// Set of logic vertices in this mtask. Order is not significant. // Set of logic vertices in this mtask. Order is not significant.
@ -69,9 +69,9 @@ private:
public: public:
ExecMTask(V3Graph* graphp, AstMTaskBody* bodyp, uint32_t id) ExecMTask(V3Graph* graphp, AstMTaskBody* bodyp, uint32_t id)
: AbstractMTask(graphp) : AbstractMTask{graphp}
, m_bodyp(bodyp) , m_bodyp{bodyp}
, m_id(id) {} , m_id{id} {}
AstMTaskBody* bodyp() const { return m_bodyp; } AstMTaskBody* bodyp() const { return m_bodyp; }
virtual uint32_t id() const override { return m_id; } virtual uint32_t id() const override { return m_id; }
uint32_t priority() const { return m_priority; } uint32_t priority() const { return m_priority; }

View File

@ -136,8 +136,8 @@ public:
bool m_file = false; // Buffer is start of new file bool m_file = false; // Buffer is start of new file
int m_termState = 0; // Termination fsm int m_termState = 0; // Termination fsm
VPreStream(FileLine* fl, V3PreLex* lexp) VPreStream(FileLine* fl, V3PreLex* lexp)
: m_curFilelinep(fl) : m_curFilelinep{fl}
, m_lexp(lexp) { , m_lexp{lexp} {
lexStreamDepthAdd(1); lexStreamDepthAdd(1);
} }
~VPreStream() { lexStreamDepthAdd(-1); } ~VPreStream() { lexStreamDepthAdd(-1); }
@ -173,8 +173,8 @@ public: // Used only by V3PreLex.cpp and V3PreProc.cpp
// CONSTRUCTORS // CONSTRUCTORS
V3PreLex(V3PreProcImp* preimpp, FileLine* filelinep) V3PreLex(V3PreProcImp* preimpp, FileLine* filelinep)
: m_preimpp(preimpp) : m_preimpp{preimpp}
, m_tokFilelinep(filelinep) { , m_tokFilelinep{filelinep} {
initFirstBuffer(filelinep); initFirstBuffer(filelinep);
} }
~V3PreLex() { ~V3PreLex() {

View File

@ -51,10 +51,10 @@ class VDefine {
bool m_cmdline; // Set on command line, don't `undefineall bool m_cmdline; // Set on command line, don't `undefineall
public: public:
VDefine(FileLine* fl, const string& value, const string& params, bool cmdline) VDefine(FileLine* fl, const string& value, const string& params, bool cmdline)
: m_fileline(fl) : m_fileline{fl}
, m_value(value) , m_value{value}
, m_params(params) , m_params{params}
, m_cmdline(cmdline) {} , m_cmdline{cmdline} {}
FileLine* fileline() const { return m_fileline; } FileLine* fileline() const { return m_fileline; }
string value() const { return m_value; } string value() const { return m_value; }
string params() const { return m_params; } string params() const { return m_params; }
@ -80,8 +80,8 @@ public:
void parenLevel(int value) { m_parenLevel = value; } void parenLevel(int value) { m_parenLevel = value; }
std::vector<string>& args() { return m_args; } std::vector<string>& args() { return m_args; }
VDefineRef(const string& name, const string& params) VDefineRef(const string& name, const string& params)
: m_name(name) : m_name{name}
, m_params(params) {} , m_params{params} {}
~VDefineRef() {} ~VDefineRef() {}
}; };
@ -96,8 +96,8 @@ public:
bool on() const { return m_on; } bool on() const { return m_on; }
bool everOn() const { return m_everOn; } bool everOn() const { return m_everOn; }
VPreIfEntry(bool on, bool everOn) VPreIfEntry(bool on, bool everOn)
: m_on(on) : m_on{on}
, m_everOn(everOn || on) {} // Note everOn includes new state , m_everOn{everOn || on} {} // Note everOn includes new state
~VPreIfEntry() {} ~VPreIfEntry() {}
}; };

View File

@ -43,7 +43,7 @@ private:
AstUser4InUse m_inuser4; AstUser4InUse m_inuser4;
// STATE // STATE
bool m_noopt; // Disable optimization of variables in this block bool m_noopt = false; // Disable optimization of variables in this block
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -73,7 +73,6 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit PremitAssignVisitor(AstNodeAssign* nodep) { explicit PremitAssignVisitor(AstNodeAssign* nodep) {
UINFO(4, " PremitAssignVisitor on " << nodep << endl); UINFO(4, " PremitAssignVisitor on " << nodep << endl);
m_noopt = false;
iterate(nodep); iterate(nodep);
} }
virtual ~PremitAssignVisitor() override {} virtual ~PremitAssignVisitor() override {}
@ -94,12 +93,12 @@ private:
AstUser2InUse m_inuser2; AstUser2InUse m_inuser2;
// STATE // STATE
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstCFunc* m_funcp; // Current block AstCFunc* m_funcp = nullptr; // Current block
AstNode* m_stmtp; // Current statement AstNode* m_stmtp = nullptr; // Current statement
AstWhile* m_inWhilep; // Inside while loop, special statement additions AstWhile* m_inWhilep = nullptr; // Inside while loop, special statement additions
AstTraceInc* m_inTracep; // Inside while loop, special statement additions AstTraceInc* m_inTracep = nullptr; // Inside while loop, special statement additions
bool m_assignLhs; // Inside assignment lhs, don't breakup extracts bool m_assignLhs = false; // Inside assignment lhs, don't breakup extracts
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -399,15 +398,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit PremitVisitor(AstNetlist* nodep) { explicit PremitVisitor(AstNetlist* nodep) { iterate(nodep); }
m_modp = nullptr;
m_funcp = nullptr;
m_stmtp = nullptr;
m_inWhilep = nullptr;
m_inTracep = nullptr;
m_assignLhs = false;
iterate(nodep);
}
virtual ~PremitVisitor() override {} virtual ~PremitVisitor() override {}
}; };

View File

@ -486,8 +486,8 @@ private:
public: public:
explicit ProtectVisitor(AstNode* nodep) explicit ProtectVisitor(AstNode* nodep)
: m_libName(v3Global.opt.protectLib()) : m_libName{v3Global.opt.protectLib()}
, m_topName(v3Global.opt.prefix()) { , m_topName{v3Global.opt.prefix()} {
iterate(nodep); iterate(nodep);
} }
}; };

View File

@ -55,18 +55,18 @@ private:
// STATE // STATE
VDouble0 m_statReloops; // Statistic tracking VDouble0 m_statReloops; // Statistic tracking
VDouble0 m_statReItems; // Statistic tracking VDouble0 m_statReItems; // Statistic tracking
AstCFunc* m_cfuncp; // Current block AstCFunc* m_cfuncp = nullptr; // Current block
AssVec m_mgAssignps; // List of assignments merging AssVec m_mgAssignps; // List of assignments merging
AstCFunc* m_mgCfuncp; // Parent C function AstCFunc* m_mgCfuncp = nullptr; // Parent C function
AstNode* m_mgNextp; // Next node AstNode* m_mgNextp = nullptr; // Next node
AstNodeSel* m_mgSelLp; // Parent select, nullptr = idle AstNodeSel* m_mgSelLp = nullptr; // Parent select, nullptr = idle
AstNodeSel* m_mgSelRp; // Parent select, nullptr = constant AstNodeSel* m_mgSelRp = nullptr; // Parent select, nullptr = constant
AstNodeVarRef* m_mgVarrefLp; // Parent varref AstNodeVarRef* m_mgVarrefLp = nullptr; // Parent varref
AstNodeVarRef* m_mgVarrefRp; // Parent varref, nullptr = constant AstNodeVarRef* m_mgVarrefRp = nullptr; // Parent varref, nullptr = constant
AstConst* m_mgConstRp; // Parent RHS constant, nullptr = sel AstConst* m_mgConstRp = nullptr; // Parent RHS constant, nullptr = sel
uint32_t m_mgIndexLo; // Merge range uint32_t m_mgIndexLo = 0; // Merge range
uint32_t m_mgIndexHi; // Merge range uint32_t m_mgIndexHi = 0; // Merge range
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -238,19 +238,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ReloopVisitor(AstNetlist* nodep) { explicit ReloopVisitor(AstNetlist* nodep) { iterate(nodep); }
m_cfuncp = nullptr;
m_mgCfuncp = nullptr;
m_mgNextp = nullptr;
m_mgSelLp = nullptr;
m_mgSelRp = nullptr;
m_mgVarrefLp = nullptr;
m_mgVarrefRp = nullptr;
m_mgConstRp = nullptr;
m_mgIndexLo = 0;
m_mgIndexHi = 0;
iterate(nodep);
}
virtual ~ReloopVisitor() override { virtual ~ReloopVisitor() override {
V3Stats::addStat("Optimizations, Reloops", m_statReloops); V3Stats::addStat("Optimizations, Reloops", m_statReloops);
V3Stats::addStat("Optimizations, Reloop iterations", m_statReItems); V3Stats::addStat("Optimizations, Reloop iterations", m_statReItems);

View File

@ -51,11 +51,11 @@ private:
typedef std::set<std::pair<AstVarRef*, AstScope*>> VarRefScopeSet; typedef std::set<std::pair<AstVarRef*, AstScope*>> VarRefScopeSet;
// STATE, inside processing a single module // STATE, inside processing a single module
AstNodeModule* m_modp; // Current module AstNodeModule* m_modp = nullptr; // Current module
AstScope* m_scopep; // Current scope we are building AstScope* m_scopep = nullptr; // Current scope we are building
// STATE, for passing down one level of hierarchy (may need save/restore) // STATE, for passing down one level of hierarchy (may need save/restore)
AstCell* m_aboveCellp; // Cell that instantiates this module AstCell* m_aboveCellp = nullptr; // Cell that instantiates this module
AstScope* m_aboveScopep; // Scope that instantiates this scope AstScope* m_aboveScopep = nullptr; // Scope that instantiates this scope
PackageScopeMap m_packageScopes; // Scopes for each package PackageScopeMap m_packageScopes; // Scopes for each package
VarScopeMap m_varScopes; // Varscopes created for each scope and var VarScopeMap m_varScopes; // Varscopes created for each scope and var
@ -320,14 +320,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ScopeVisitor(AstNetlist* nodep) { explicit ScopeVisitor(AstNetlist* nodep) { iterate(nodep); }
m_aboveCellp = nullptr;
m_aboveScopep = nullptr;
m_modp = nullptr;
m_scopep = nullptr;
//
iterate(nodep);
}
virtual ~ScopeVisitor() override {} virtual ~ScopeVisitor() override {}
}; };
@ -337,7 +330,7 @@ public:
class ScopeCleanupVisitor : public AstNVisitor { class ScopeCleanupVisitor : public AstNVisitor {
private: private:
// STATE // STATE
AstScope* m_scopep; // Current scope we are building AstScope* m_scopep = nullptr; // Current scope we are building
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -402,10 +395,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit ScopeCleanupVisitor(AstNetlist* nodep) { explicit ScopeCleanupVisitor(AstNetlist* nodep) { iterate(nodep); }
m_scopep = nullptr;
iterate(nodep);
}
virtual ~ScopeCleanupVisitor() override {} virtual ~ScopeCleanupVisitor() override {}
}; };

View File

@ -26,7 +26,7 @@ public:
uint32_t m_id; uint32_t m_id;
// CONSTRUCTORS // CONSTRUCTORS
explicit ScoreboardTestElem(uint32_t score) explicit ScoreboardTestElem(uint32_t score)
: m_score(score) { : m_score{score} {
static uint32_t s_serial = 0; static uint32_t s_serial = 0;
m_id = ++s_serial; m_id = ++s_serial;
} }

View File

@ -72,18 +72,17 @@ public:
typename KeySet::iterator m_keyIt; typename KeySet::iterator m_keyIt;
typename Val2Keys::iterator m_valIt; typename Val2Keys::iterator m_valIt;
SortByValueMap* m_sbvmp; SortByValueMap* m_sbvmp;
bool m_end; // At the end() bool m_end = true; // At the end()
// CONSTRUCTORS // CONSTRUCTORS
explicit const_iterator(SortByValueMap* sbmvp) // for end() explicit const_iterator(SortByValueMap* sbmvp) // for end()
: m_sbvmp(sbmvp) : m_sbvmp{sbmvp} {}
, m_end(true) {}
const_iterator(typename Val2Keys::iterator valIt, typename KeySet::iterator keyIt, const_iterator(typename Val2Keys::iterator valIt, typename KeySet::iterator keyIt,
SortByValueMap* sbvmp) SortByValueMap* sbvmp)
: m_keyIt(keyIt) : m_keyIt{keyIt}
, m_valIt(valIt) , m_valIt{valIt}
, m_sbvmp(sbvmp) , m_sbvmp{sbvmp}
, m_end(false) {} , m_end{false} {}
// METHODS // METHODS
void advanceUntilValid() { void advanceUntilValid() {
@ -204,10 +203,10 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit iterator(SortByValueMap* sbvmp) explicit iterator(SortByValueMap* sbvmp)
: const_iterator(sbvmp) {} : const_iterator{sbvmp} {}
iterator(typename Val2Keys::iterator valIt, typename KeySet::iterator keyIt, iterator(typename Val2Keys::iterator valIt, typename KeySet::iterator keyIt,
SortByValueMap* sbvmp) SortByValueMap* sbvmp)
: const_iterator(valIt, keyIt, sbvmp) {} : const_iterator{valIt, keyIt, sbvmp} {}
// METHODS // METHODS
iterator& operator++() { iterator& operator++() {
@ -374,8 +373,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit V3Scoreboard(UserScoreFnp scoreFnp, bool slowAsserts) explicit V3Scoreboard(UserScoreFnp scoreFnp, bool slowAsserts)
: m_scoreFnp(scoreFnp) : m_scoreFnp{scoreFnp}
, m_slowAsserts(slowAsserts) {} , m_slowAsserts{slowAsserts} {}
~V3Scoreboard() {} ~V3Scoreboard() {}
// METHODS // METHODS

View File

@ -55,8 +55,8 @@ public:
V3TaskConnects* m_tconnects; V3TaskConnects* m_tconnects;
// CONSTRUCTORS // CONSTRUCTORS
SimStackNode(AstFuncRef* funcp, V3TaskConnects* tconnects) SimStackNode(AstFuncRef* funcp, V3TaskConnects* tconnects)
: m_funcp(funcp) : m_funcp{funcp}
, m_tconnects(tconnects) {} , m_tconnects{tconnects} {}
~SimStackNode() {} ~SimStackNode() {}
}; };

View File

@ -53,8 +53,8 @@ class SliceVisitor : public AstNVisitor {
AstUser1InUse m_inuser1; AstUser1InUse m_inuser1;
// STATE // STATE
AstNode* m_assignp; // Assignment we are under AstNode* m_assignp = nullptr; // Assignment we are under
bool m_assignError; // True if the current assign already has an error bool m_assignError = false; // True if the current assign already has an error
// METHODS // METHODS
VL_DEBUG_FUNC; // Declare debug() VL_DEBUG_FUNC; // Declare debug()
@ -224,11 +224,7 @@ class SliceVisitor : public AstNVisitor {
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit SliceVisitor(AstNetlist* nodep) { explicit SliceVisitor(AstNetlist* nodep) { iterate(nodep); }
m_assignp = nullptr;
m_assignError = false;
iterate(nodep);
}
virtual ~SliceVisitor() override {} virtual ~SliceVisitor() override {}
}; };

View File

@ -100,8 +100,8 @@ class SplitNodeVertex : public V3GraphVertex {
protected: protected:
SplitNodeVertex(V3Graph* graphp, AstNode* nodep) SplitNodeVertex(V3Graph* graphp, AstNode* nodep)
: V3GraphVertex(graphp) : V3GraphVertex{graphp}
, m_nodep(nodep) {} , m_nodep{nodep} {}
virtual ~SplitNodeVertex() override {} virtual ~SplitNodeVertex() override {}
// ACCESSORS // ACCESSORS
// Do not make accessor for nodep(), It may change due to // Do not make accessor for nodep(), It may change due to
@ -118,7 +118,7 @@ public:
class SplitPliVertex : public SplitNodeVertex { class SplitPliVertex : public SplitNodeVertex {
public: public:
explicit SplitPliVertex(V3Graph* graphp, AstNode* nodep) explicit SplitPliVertex(V3Graph* graphp, AstNode* nodep)
: SplitNodeVertex(graphp, nodep) {} : SplitNodeVertex{graphp, nodep} {}
virtual ~SplitPliVertex() override {} virtual ~SplitPliVertex() override {}
virtual string name() const override { return "*PLI*"; } virtual string name() const override { return "*PLI*"; }
virtual string dotColor() const override { return "green"; } virtual string dotColor() const override { return "green"; }
@ -127,7 +127,7 @@ public:
class SplitLogicVertex : public SplitNodeVertex { class SplitLogicVertex : public SplitNodeVertex {
public: public:
SplitLogicVertex(V3Graph* graphp, AstNode* nodep) SplitLogicVertex(V3Graph* graphp, AstNode* nodep)
: SplitNodeVertex(graphp, nodep) {} : SplitNodeVertex{graphp, nodep} {}
virtual ~SplitLogicVertex() override {} virtual ~SplitLogicVertex() override {}
virtual string dotColor() const override { return "yellow"; } virtual string dotColor() const override { return "yellow"; }
}; };
@ -135,7 +135,7 @@ public:
class SplitVarStdVertex : public SplitNodeVertex { class SplitVarStdVertex : public SplitNodeVertex {
public: public:
SplitVarStdVertex(V3Graph* graphp, AstNode* nodep) SplitVarStdVertex(V3Graph* graphp, AstNode* nodep)
: SplitNodeVertex(graphp, nodep) {} : SplitNodeVertex{graphp, nodep} {}
virtual ~SplitVarStdVertex() override {} virtual ~SplitVarStdVertex() override {}
virtual string dotColor() const override { return "skyblue"; } virtual string dotColor() const override { return "skyblue"; }
}; };
@ -143,7 +143,7 @@ public:
class SplitVarPostVertex : public SplitNodeVertex { class SplitVarPostVertex : public SplitNodeVertex {
public: public:
SplitVarPostVertex(V3Graph* graphp, AstNode* nodep) SplitVarPostVertex(V3Graph* graphp, AstNode* nodep)
: SplitNodeVertex(graphp, nodep) {} : SplitNodeVertex{graphp, nodep} {}
virtual ~SplitVarPostVertex() override {} virtual ~SplitVarPostVertex() override {}
virtual string name() const override { return string("POST ") + SplitNodeVertex::name(); } virtual string name() const override { return string("POST ") + SplitNodeVertex::name(); }
virtual string dotColor() const override { return "CadetBlue"; } virtual string dotColor() const override { return "CadetBlue"; }
@ -159,7 +159,7 @@ protected:
enum { WEIGHT_NORMAL = 10 }; enum { WEIGHT_NORMAL = 10 };
SplitEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, SplitEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight,
bool cutable = CUTABLE) bool cutable = CUTABLE)
: V3GraphEdge(graphp, fromp, top, weight, cutable) {} : V3GraphEdge{graphp, fromp, top, weight, cutable} {}
virtual ~SplitEdge() override {} virtual ~SplitEdge() override {}
public: public:
@ -188,7 +188,7 @@ uint32_t SplitEdge::s_stepNum = 0;
class SplitPostEdge : public SplitEdge { class SplitPostEdge : public SplitEdge {
public: public:
SplitPostEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) SplitPostEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {}
virtual ~SplitPostEdge() override {} virtual ~SplitPostEdge() override {}
virtual bool followScoreboard() const override { return false; } virtual bool followScoreboard() const override { return false; }
virtual string dotColor() const override { return "khaki"; } virtual string dotColor() const override { return "khaki"; }
@ -197,7 +197,7 @@ public:
class SplitLVEdge : public SplitEdge { class SplitLVEdge : public SplitEdge {
public: public:
SplitLVEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) SplitLVEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {}
virtual ~SplitLVEdge() override {} virtual ~SplitLVEdge() override {}
virtual bool followScoreboard() const override { return true; } virtual bool followScoreboard() const override { return true; }
virtual string dotColor() const override { return "yellowGreen"; } virtual string dotColor() const override { return "yellowGreen"; }
@ -206,7 +206,7 @@ public:
class SplitRVEdge : public SplitEdge { class SplitRVEdge : public SplitEdge {
public: public:
SplitRVEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) SplitRVEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {}
virtual ~SplitRVEdge() override {} virtual ~SplitRVEdge() override {}
virtual bool followScoreboard() const override { return true; } virtual bool followScoreboard() const override { return true; }
virtual string dotColor() const override { return "green"; } virtual string dotColor() const override { return "green"; }
@ -215,7 +215,7 @@ public:
struct SplitScorebdEdge : public SplitEdge { struct SplitScorebdEdge : public SplitEdge {
public: public:
SplitScorebdEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) SplitScorebdEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: SplitEdge(graphp, fromp, top, WEIGHT_NORMAL) {} : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL} {}
virtual ~SplitScorebdEdge() override {} virtual ~SplitScorebdEdge() override {}
virtual bool followScoreboard() const override { return true; } virtual bool followScoreboard() const override { return true; }
virtual string dotColor() const override { return "blue"; } virtual string dotColor() const override { return "blue"; }
@ -226,7 +226,7 @@ struct SplitStrictEdge : public SplitEdge {
// The only non-cutable edge type // The only non-cutable edge type
public: public:
SplitStrictEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top) SplitStrictEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top)
: SplitEdge(graphp, fromp, top, WEIGHT_NORMAL, NOT_CUTABLE) {} : SplitEdge{graphp, fromp, top, WEIGHT_NORMAL, NOT_CUTABLE} {}
virtual ~SplitStrictEdge() override {} virtual ~SplitStrictEdge() override {}
virtual bool followScoreboard() const override { return true; } virtual bool followScoreboard() const override { return true; }
virtual string dotColor() const override { return "blue"; } virtual string dotColor() const override { return "blue"; }
@ -701,9 +701,9 @@ public:
// and generates its split blocks, writing the split blocks // and generates its split blocks, writing the split blocks
// into *newBlocksp. // into *newBlocksp.
EmitSplitVisitor(AstAlways* nodep, const IfColorVisitor* ifColorp, AlwaysVec* newBlocksp) EmitSplitVisitor(AstAlways* nodep, const IfColorVisitor* ifColorp, AlwaysVec* newBlocksp)
: m_origAlwaysp(nodep) : m_origAlwaysp{nodep}
, m_ifColorp(ifColorp) , m_ifColorp{ifColorp}
, m_newBlocksp(newBlocksp) { , m_newBlocksp{newBlocksp} {
UINFO(6, " splitting always " << nodep << endl); UINFO(6, " splitting always " << nodep << endl);
} }
@ -830,12 +830,11 @@ private:
ReplaceMap m_replaceBlocks; ReplaceMap m_replaceBlocks;
// AstNodeIf* whose condition we're currently visiting // AstNodeIf* whose condition we're currently visiting
AstNode* m_curIfConditional; AstNode* m_curIfConditional = nullptr;
// CONSTRUCTORS // CONSTRUCTORS
public: public:
explicit SplitVisitor(AstNetlist* nodep) explicit SplitVisitor(AstNetlist* nodep) {
: m_curIfConditional(nullptr) {
iterate(nodep); iterate(nodep);
// Splice newly-split blocks into the tree. Remove placeholders // Splice newly-split blocks into the tree. Remove placeholders

View File

@ -45,7 +45,7 @@ public:
class SplitAsFindVisitor : public SplitAsBaseVisitor { class SplitAsFindVisitor : public SplitAsBaseVisitor {
private: private:
// STATE // STATE
AstVarScope* m_splitVscp; // Variable we want to split AstVarScope* m_splitVscp = nullptr; // Variable we want to split
// METHODS // METHODS
virtual void visit(AstVarRef* nodep) override { virtual void visit(AstVarRef* nodep) override {
@ -57,10 +57,7 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit SplitAsFindVisitor(AstAlways* nodep) { explicit SplitAsFindVisitor(AstAlways* nodep) { iterate(nodep); }
m_splitVscp = nullptr;
iterate(nodep);
}
virtual ~SplitAsFindVisitor() override {} virtual ~SplitAsFindVisitor() override {}
// METHODS // METHODS
AstVarScope* splitVscp() const { return m_splitVscp; } AstVarScope* splitVscp() const { return m_splitVscp; }
@ -117,8 +114,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
SplitAsCleanVisitor(AstAlways* nodep, AstVarScope* vscp, bool modeMatch) SplitAsCleanVisitor(AstAlways* nodep, AstVarScope* vscp, bool modeMatch)
: m_splitVscp(vscp) : m_splitVscp{vscp}
, m_modeMatch(modeMatch) { , m_modeMatch{modeMatch} {
iterate(nodep); iterate(nodep);
} }
virtual ~SplitAsCleanVisitor() override {} virtual ~SplitAsCleanVisitor() override {}
@ -135,7 +132,7 @@ private:
// STATE // STATE
VDouble0 m_statSplits; // Statistic tracking VDouble0 m_statSplits; // Statistic tracking
AstVarScope* m_splitVscp; // Variable we want to split AstVarScope* m_splitVscp = nullptr; // Variable we want to split
// METHODS // METHODS
void splitAlways(AstAlways* nodep) { void splitAlways(AstAlways* nodep) {
@ -187,7 +184,6 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
explicit SplitAsVisitor(AstNetlist* nodep) { explicit SplitAsVisitor(AstNetlist* nodep) {
m_splitVscp = nullptr;
AstNode::user1ClearTree(); // user1p() used on entire tree AstNode::user1ClearTree(); // user1p() used on entire tree
iterate(nodep); iterate(nodep);
} }

View File

@ -243,29 +243,29 @@ class UnpackRef {
bool m_ftask; // true if the reference is in function/task. false if in module. bool m_ftask; // true if the reference is in function/task. false if in module.
public: public:
UnpackRef(AstNode* stmtp, AstVarRef* nodep, bool ftask) UnpackRef(AstNode* stmtp, AstVarRef* nodep, bool ftask)
: m_contextp(stmtp) : m_contextp{stmtp}
, m_nodep(nodep) , m_nodep{nodep}
, m_index(-1) , m_index{-1}
, m_msb(0) , m_msb{0}
, m_lsb(1) , m_lsb{1}
, m_lvalue(nodep->lvalue()) , m_lvalue{nodep->lvalue()}
, m_ftask(ftask) {} , m_ftask{ftask} {}
UnpackRef(AstNode* stmtp, AstArraySel* nodep, int idx, bool lvalue, bool ftask) UnpackRef(AstNode* stmtp, AstArraySel* nodep, int idx, bool lvalue, bool ftask)
: m_contextp(stmtp) : m_contextp{stmtp}
, m_nodep(nodep) , m_nodep{nodep}
, m_index(idx) , m_index{idx}
, m_msb(0) , m_msb{0}
, m_lsb(1) , m_lsb{1}
, m_lvalue(lvalue) , m_lvalue{lvalue}
, m_ftask(ftask) {} , m_ftask{ftask} {}
UnpackRef(AstNode* stmtp, AstSliceSel* nodep, int msb, int lsb, bool lvalue, bool ftask) UnpackRef(AstNode* stmtp, AstSliceSel* nodep, int msb, int lsb, bool lvalue, bool ftask)
: m_contextp(stmtp) : m_contextp{stmtp}
, m_nodep(nodep) , m_nodep{nodep}
, m_index(msb == lsb ? msb : -1) // Equivalent to ArraySel , m_index{msb == lsb ? msb : -1} // Equivalent to ArraySel
, m_msb(msb) , m_msb{msb}
, m_lsb(lsb) , m_lsb{lsb}
, m_lvalue(lvalue) , m_lvalue{lvalue}
, m_ftask(ftask) {} , m_ftask{ftask} {}
AstNode* nodep() const { return m_nodep; } AstNode* nodep() const { return m_nodep; }
bool isSingleRef() const { bool isSingleRef() const {
return VN_IS(m_nodep, ArraySel) || (m_msb == m_lsb && m_lsb == m_index); return VN_IS(m_nodep, ArraySel) || (m_msb == m_lsb && m_lsb == m_index);
@ -359,7 +359,7 @@ public:
iterateChildren(nodep); iterateChildren(nodep);
} }
explicit Visitor(RefsInModule& p) explicit Visitor(RefsInModule& p)
: m_parent(p) {} : m_parent{p} {}
} v(*this); } v(*this);
v.iterate(nodep); v.iterate(nodep);
} }
@ -766,7 +766,7 @@ class SplitUnpackedVarVisitor : public AstNVisitor, public SplitVarImpl {
public: public:
explicit SplitUnpackedVarVisitor(AstNetlist* nodep) explicit SplitUnpackedVarVisitor(AstNetlist* nodep)
: m_refs() { : m_refs{} {
iterate(nodep); iterate(nodep);
} }
~SplitUnpackedVarVisitor() { ~SplitUnpackedVarVisitor() {
@ -808,9 +808,9 @@ class SplitNewVar {
AstVar* m_varp; // The LSB of this variable is always 0, not m_lsb AstVar* m_varp; // The LSB of this variable is always 0, not m_lsb
public: public:
SplitNewVar(int lsb, int bitwidth, AstVar* varp = nullptr) SplitNewVar(int lsb, int bitwidth, AstVar* varp = nullptr)
: m_lsb(lsb) : m_lsb{lsb}
, m_bitwidth(bitwidth) , m_bitwidth{bitwidth}
, m_varp(varp) {} , m_varp{varp} {}
int lsb() const { return m_lsb; } int lsb() const { return m_lsb; }
int msb() const { return m_lsb + m_bitwidth - 1; } int msb() const { return m_lsb + m_bitwidth - 1; }
int bitwidth() const { return m_bitwidth; } int bitwidth() const { return m_bitwidth; }
@ -835,13 +835,13 @@ class PackedVarRefEntry {
public: public:
PackedVarRefEntry(AstSel* selp, int lsb, int bitwidth) PackedVarRefEntry(AstSel* selp, int lsb, int bitwidth)
: m_nodep(selp) : m_nodep{selp}
, m_lsb(lsb) , m_lsb{lsb}
, m_bitwidth(bitwidth) {} , m_bitwidth{bitwidth} {}
PackedVarRefEntry(AstVarRef* refp, int lsb, int bitwidth) PackedVarRefEntry(AstVarRef* refp, int lsb, int bitwidth)
: m_nodep(refp) : m_nodep{refp}
, m_lsb(lsb) , m_lsb{lsb}
, m_bitwidth(bitwidth) {} , m_bitwidth{bitwidth} {}
AstNode* nodep() const { return m_nodep; } AstNode* nodep() const { return m_nodep; }
int lsb() const { return m_lsb; } int lsb() const { return m_lsb; }
int msb() const { return m_lsb + m_bitwidth - 1; } int msb() const { return m_lsb + m_bitwidth - 1; }
@ -897,7 +897,7 @@ public:
return m_rhs; return m_rhs;
} }
explicit PackedVarRef(AstVar* varp) explicit PackedVarRef(AstVar* varp)
: m_basicp(varp->dtypep()->basicp()) {} : m_basicp{varp->dtypep()->basicp()} {}
void append(const PackedVarRefEntry& e, bool lvalue) { void append(const PackedVarRefEntry& e, bool lvalue) {
UASSERT(!m_dedupDone, "cannot add after dedup()"); UASSERT(!m_dedupDone, "cannot add after dedup()");
if (lvalue) if (lvalue)
@ -1205,9 +1205,9 @@ class SplitPackedVarVisitor : public AstNVisitor, public SplitVarImpl {
public: public:
// When reusing the information from SplitUnpackedVarVisitor // When reusing the information from SplitUnpackedVarVisitor
SplitPackedVarVisitor(AstNetlist* nodep, SplitVarRefsMap& refs) SplitPackedVarVisitor(AstNetlist* nodep, SplitVarRefsMap& refs)
: m_netp(nodep) : m_netp{nodep}
, m_modp(nullptr) , m_modp{nullptr}
, m_numSplit(0) { , m_numSplit{0} {
// If you want ignore refs and walk the tne entire AST, // If you want ignore refs and walk the tne entire AST,
// just call iterateChildren(m_modp) and split() for each module // just call iterateChildren(m_modp) and split() for each module
for (SplitVarRefsMap::iterator it = refs.begin(), it_end = refs.end(); it != it_end; for (SplitVarRefsMap::iterator it = refs.begin(), it_end = refs.end(); it != it_end;

View File

@ -208,8 +208,8 @@ private:
public: public:
// CONSTRUCTORS // CONSTRUCTORS
StatsVisitor(AstNetlist* nodep, const string& stage, bool fast) StatsVisitor(AstNetlist* nodep, const string& stage, bool fast)
: m_stage(stage) : m_stage{stage}
, m_fast(fast) { , m_fast{fast} {
UINFO(9, "Starting stats, fast=" << fast << endl); UINFO(9, "Starting stats, fast=" << fast << endl);
m_cfuncp = nullptr; m_cfuncp = nullptr;
m_counting = !m_fast; m_counting = !m_fast;

View File

@ -32,12 +32,12 @@ class VDouble0 {
public: public:
// METHODS // METHODS
VDouble0() VDouble0()
: m_d(0) {} : m_d{0.0} {}
~VDouble0() {} ~VDouble0() {}
// Implicit conversion operators: // Implicit conversion operators:
explicit VDouble0(const vluint64_t v) explicit VDouble0(const vluint64_t v)
: m_d(v) {} : m_d{static_cast<double>(v)} {}
operator double() const { return m_d; } operator double() const { return m_d; }
// Explicit operators: // Explicit operators:
@ -90,12 +90,12 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
V3Statistic(const string& stage, const string& name, double count, bool sumit = false, V3Statistic(const string& stage, const string& name, double count, bool sumit = false,
bool perf = false) bool perf = false)
: m_name(name) : m_name{name}
, m_count(count) , m_count{count}
, m_stage(stage) , m_stage{stage}
, m_sumit(sumit) , m_sumit{sumit}
, m_perf(perf) , m_perf{perf}
, m_printit(true) {} , m_printit{true} {}
virtual ~V3Statistic() {} virtual ~V3Statistic() {}
}; };

View File

@ -182,7 +182,7 @@ public:
// CONSTRUCTORS // CONSTRUCTORS
explicit StatsReport(std::ofstream* aofp) explicit StatsReport(std::ofstream* aofp)
: os(*aofp) { : os{*aofp} {
header(); header();
sumit(); sumit();
stars(); stars();

Some files were not shown because too many files have changed in this diff Show More