C++11: Use nullptr. No functional change.
This commit is contained in:
parent
7c54a451a9
commit
c0127599df
|
@ -31,7 +31,7 @@ int main(int argc, char** argv, char** env) {
|
|||
|
||||
#if VM_TRACE
|
||||
// When tracing, the contents of the secret module will not be seen
|
||||
VerilatedVcdC* tfp = NULL;
|
||||
VerilatedVcdC* tfp = nullptr;
|
||||
const char* flag = Verilated::commandArgsPlusMatch("trace");
|
||||
if (flag && 0 == strcmp(flag, "+trace")) {
|
||||
Verilated::traceEverOn(true);
|
||||
|
@ -62,13 +62,13 @@ int main(int argc, char** argv, char** env) {
|
|||
#if VM_TRACE
|
||||
if (tfp) {
|
||||
tfp->close();
|
||||
tfp = NULL;
|
||||
tfp = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Destroy model
|
||||
delete top;
|
||||
top = NULL;
|
||||
top = nullptr;
|
||||
|
||||
// Fin
|
||||
exit(0);
|
||||
|
|
|
@ -99,7 +99,7 @@ int main(int argc, char** argv, char** env) {
|
|||
|
||||
// Destroy model
|
||||
delete top;
|
||||
top = NULL;
|
||||
top = nullptr;
|
||||
|
||||
// Fin
|
||||
exit(0);
|
||||
|
|
|
@ -98,7 +98,7 @@ int sc_main(int argc, char* argv[]) {
|
|||
#if VM_TRACE
|
||||
// If verilator was invoked with --trace argument,
|
||||
// and if at run time passed the +trace argument, turn on tracing
|
||||
VerilatedVcdSc* tfp = NULL;
|
||||
VerilatedVcdSc* tfp = nullptr;
|
||||
const char* flag = Verilated::commandArgsPlusMatch("trace");
|
||||
if (flag && 0 == strcmp(flag, "+trace")) {
|
||||
cout << "Enabling waves into logs/vlt_dump.vcd...\n";
|
||||
|
@ -139,7 +139,7 @@ int sc_main(int argc, char* argv[]) {
|
|||
#if VM_TRACE
|
||||
if (tfp) {
|
||||
tfp->close();
|
||||
tfp = NULL;
|
||||
tfp = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -151,7 +151,7 @@ int sc_main(int argc, char* argv[]) {
|
|||
|
||||
// Destroy model
|
||||
delete top;
|
||||
top = NULL;
|
||||
top = nullptr;
|
||||
|
||||
// Fin
|
||||
return 0;
|
||||
|
|
|
@ -176,7 +176,7 @@ void VL_FATAL_MT(const char* filename, int linenum, const char* hier, const char
|
|||
std::string _vl_string_vprintf(const char* formatp, va_list ap) VL_MT_SAFE {
|
||||
va_list aq;
|
||||
va_copy(aq, ap);
|
||||
int len = VL_VSNPRINTF(NULL, 0, formatp, aq);
|
||||
int len = VL_VSNPRINTF(nullptr, 0, formatp, aq);
|
||||
va_end(aq);
|
||||
if (VL_UNLIKELY(len < 1)) return "";
|
||||
|
||||
|
@ -262,7 +262,7 @@ Verilated::NonSerialized::NonSerialized() {
|
|||
Verilated::NonSerialized::~NonSerialized() {
|
||||
if (s_profThreadsFilenamep) {
|
||||
VL_DO_CLEAR(free(const_cast<char*>(s_profThreadsFilenamep)),
|
||||
s_profThreadsFilenamep = NULL);
|
||||
s_profThreadsFilenamep = nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -687,7 +687,7 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||
// Note also assumes variables < 64 are not wide, this assumption is
|
||||
// sometimes not true in low-level routines written here in verilated.cpp
|
||||
static VL_THREAD_LOCAL char tmp[VL_VALUE_STRING_MAX_WIDTH];
|
||||
const char* pctp = NULL; // Most recent %##.##g format
|
||||
const char* pctp = nullptr; // Most recent %##.##g format
|
||||
bool inPct = false;
|
||||
bool widthSet = false;
|
||||
bool left = false;
|
||||
|
@ -777,7 +777,7 @@ void _vl_vsformat(std::string& output, const char* formatp, va_list ap) VL_MT_SA
|
|||
const int lbits = va_arg(ap, int);
|
||||
QData ld = 0;
|
||||
WData qlwp[VL_WQ_WORDS_E];
|
||||
WDataInP lwp = NULL;
|
||||
WDataInP lwp = nullptr;
|
||||
if (lbits <= VL_QUADSIZE) {
|
||||
ld = _VL_VA_ARG_Q(ap, lbits);
|
||||
VL_SET_WQ(qlwp, ld);
|
||||
|
@ -947,7 +947,7 @@ static inline int _vl_vsss_peek(FILE* fp, int& floc, WDataInP fromp,
|
|||
} else {
|
||||
if (floc < 0) return EOF;
|
||||
floc = floc & ~7; // Align to closest character
|
||||
if (fromp == NULL) {
|
||||
if (fromp == nullptr) {
|
||||
return fstr[fstr.length() - 1 - (floc >> 3)];
|
||||
} else {
|
||||
return VL_BITRSHIFT_W(fromp, floc) & 0xff;
|
||||
|
@ -969,7 +969,7 @@ static inline void _vl_vsss_read_str(FILE* fp, int& floc, WDataInP fromp, const
|
|||
while (true) {
|
||||
int c = _vl_vsss_peek(fp, floc, fromp, fstr);
|
||||
if (c == EOF || isspace(c)) break;
|
||||
if (acceptp && NULL == strchr(acceptp, c)) break; // String - allow anything
|
||||
if (acceptp && nullptr == strchr(acceptp, c)) break; // String - allow anything
|
||||
if (acceptp) c = tolower(c); // Non-strings we'll simplify
|
||||
*cp++ = c;
|
||||
_vl_vsss_advance(fp, floc);
|
||||
|
@ -984,7 +984,7 @@ static inline char* _vl_vsss_read_bin(FILE* fp, int& floc, WDataInP fromp, const
|
|||
// whitespace). In the fp case, except descriptor to have been opened in binary mode.
|
||||
while (n-- > 0) {
|
||||
const int c = _vl_vsss_peek(fp, floc, fromp, fstr);
|
||||
if (c == EOF) return NULL;
|
||||
if (c == EOF) return nullptr;
|
||||
if (!inhibit) *beginp++ = c;
|
||||
_vl_vsss_advance(fp, floc);
|
||||
}
|
||||
|
@ -1088,7 +1088,7 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
|
|||
}
|
||||
case 's': {
|
||||
_vl_vsss_skipspace(fp, floc, fromp, fstr);
|
||||
_vl_vsss_read_str(fp, floc, fromp, fstr, tmp, NULL);
|
||||
_vl_vsss_read_str(fp, floc, fromp, fstr, tmp, nullptr);
|
||||
if (!tmp[0]) goto done;
|
||||
int lpos = (static_cast<int>(strlen(tmp))) - 1;
|
||||
int lsb = 0;
|
||||
|
@ -1118,7 +1118,7 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
|
|||
double r;
|
||||
vlsint64_t ld;
|
||||
} u;
|
||||
u.r = strtod(tmp, NULL);
|
||||
u.r = strtod(tmp, nullptr);
|
||||
VL_SET_WQ(owp, u.ld);
|
||||
break;
|
||||
}
|
||||
|
@ -1409,7 +1409,7 @@ IData VL_FSCANF_IX(IData fpi, const char* formatp, ...) VL_MT_SAFE {
|
|||
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
IData got = _vl_vsscanf(fp, 0, NULL, "", formatp, ap);
|
||||
IData got = _vl_vsscanf(fp, 0, nullptr, "", formatp, ap);
|
||||
va_end(ap);
|
||||
return got;
|
||||
}
|
||||
|
@ -1420,7 +1420,7 @@ IData VL_SSCANF_IIX(int lbits, IData ld, const char* formatp, ...) VL_MT_SAFE {
|
|||
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
IData got = _vl_vsscanf(NULL, lbits, fnw, "", formatp, ap);
|
||||
IData got = _vl_vsscanf(nullptr, lbits, fnw, "", formatp, ap);
|
||||
va_end(ap);
|
||||
return got;
|
||||
}
|
||||
|
@ -1430,21 +1430,21 @@ IData VL_SSCANF_IQX(int lbits, QData ld, const char* formatp, ...) VL_MT_SAFE {
|
|||
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
IData got = _vl_vsscanf(NULL, lbits, fnw, "", formatp, ap);
|
||||
IData got = _vl_vsscanf(nullptr, lbits, fnw, "", formatp, ap);
|
||||
va_end(ap);
|
||||
return got;
|
||||
}
|
||||
IData VL_SSCANF_IWX(int lbits, WDataInP lwp, const char* formatp, ...) VL_MT_SAFE {
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
IData got = _vl_vsscanf(NULL, lbits, lwp, "", formatp, ap);
|
||||
IData got = _vl_vsscanf(nullptr, lbits, lwp, "", formatp, ap);
|
||||
va_end(ap);
|
||||
return got;
|
||||
}
|
||||
IData VL_SSCANF_INX(int, const std::string& ld, const char* formatp, ...) VL_MT_SAFE {
|
||||
va_list ap;
|
||||
va_start(ap, formatp);
|
||||
IData got = _vl_vsscanf(NULL, ld.length() * 8, NULL, ld, formatp, ap);
|
||||
IData got = _vl_vsscanf(nullptr, ld.length() * 8, nullptr, ld, formatp, ap);
|
||||
va_end(ap);
|
||||
return got;
|
||||
}
|
||||
|
@ -1621,7 +1621,7 @@ IData VL_VALUEPLUSARGS_INN(int, const std::string& ld, std::string& rdr) VL_MT_S
|
|||
const char* vl_mc_scan_plusargs(const char* prefixp) VL_MT_SAFE {
|
||||
const std::string& match = VerilatedImp::argPlusMatch(prefixp);
|
||||
static VL_THREAD_LOCAL char outstr[VL_VALUE_STRING_MAX_WIDTH];
|
||||
if (match.empty()) return NULL;
|
||||
if (match.empty()) return nullptr;
|
||||
outstr[0] = '\0';
|
||||
strncat(outstr, match.c_str() + strlen(prefixp) + 1, // +1 to skip the "+"
|
||||
VL_VALUE_STRING_MAX_WIDTH - 1);
|
||||
|
@ -1701,7 +1701,7 @@ IData VL_ATOI_N(const std::string& str, int base) VL_PURE {
|
|||
str_mod.erase(std::remove(str_mod.begin(), str_mod.end(), '_'), str_mod.end());
|
||||
|
||||
errno = 0;
|
||||
long v = std::strtol(str_mod.c_str(), NULL, base);
|
||||
long v = std::strtol(str_mod.c_str(), nullptr, base);
|
||||
if (errno != 0) v = 0;
|
||||
return static_cast<IData>(v);
|
||||
}
|
||||
|
@ -1769,14 +1769,14 @@ VlReadMem::VlReadMem(bool hex, int bits, const std::string& filename, QData star
|
|||
if (VL_UNLIKELY(!m_fp)) {
|
||||
// We don't report the Verilog source filename as it slow to have to pass it down
|
||||
VL_FATAL_MT(filename.c_str(), 0, "", "$readmem file not found");
|
||||
// cppcheck-suppress resourceLeak // m_fp is NULL - bug in cppcheck
|
||||
// cppcheck-suppress resourceLeak // m_fp is nullptr - bug in cppcheck
|
||||
return;
|
||||
}
|
||||
}
|
||||
VlReadMem::~VlReadMem() {
|
||||
if (m_fp) {
|
||||
fclose(m_fp);
|
||||
m_fp = NULL;
|
||||
m_fp = nullptr;
|
||||
}
|
||||
}
|
||||
bool VlReadMem::get(QData& addrr, std::string& valuer) {
|
||||
|
@ -1906,14 +1906,14 @@ VlWriteMem::VlWriteMem(bool hex, int bits, const std::string& filename, QData st
|
|||
m_fp = fopen(filename.c_str(), "w");
|
||||
if (VL_UNLIKELY(!m_fp)) {
|
||||
VL_FATAL_MT(filename.c_str(), 0, "", "$writemem file not found");
|
||||
// cppcheck-suppress resourceLeak // m_fp is NULL - bug in cppcheck
|
||||
// cppcheck-suppress resourceLeak // m_fp is nullptr - bug in cppcheck
|
||||
return;
|
||||
}
|
||||
}
|
||||
VlWriteMem::~VlWriteMem() {
|
||||
if (m_fp) {
|
||||
fclose(m_fp);
|
||||
m_fp = NULL;
|
||||
m_fp = nullptr;
|
||||
}
|
||||
}
|
||||
void VlWriteMem::print(QData addr, bool addrstamp, const void* valuep) {
|
||||
|
@ -2181,7 +2181,7 @@ Verilated::ThreadLocal::ThreadLocal()
|
|||
, t_endOfEvalReqd(0)
|
||||
,
|
||||
#endif
|
||||
t_dpiScopep(NULL)
|
||||
t_dpiScopep(nullptr)
|
||||
, t_dpiFilename(0)
|
||||
, t_dpiLineno(0) {
|
||||
}
|
||||
|
@ -2291,7 +2291,7 @@ void Verilated::profThreadsFilenamep(const char* flagp) VL_MT_SAFE {
|
|||
const char* Verilated::catName(const char* n1, const char* n2, const char* delimiter) VL_MT_SAFE {
|
||||
// Returns new'ed data
|
||||
// Used by symbol table creation to make module names
|
||||
static VL_THREAD_LOCAL char* strp = NULL;
|
||||
static VL_THREAD_LOCAL char* strp = nullptr;
|
||||
static VL_THREAD_LOCAL size_t len = 0;
|
||||
size_t newlen = strlen(n1) + strlen(n2) + strlen(delimiter) + 1;
|
||||
if (!strp || newlen > len) {
|
||||
|
@ -2559,7 +2559,7 @@ VerilatedModule::VerilatedModule(const char* namep)
|
|||
VerilatedModule::~VerilatedModule() {
|
||||
// Memory cleanup - not called during normal operation
|
||||
// NOLINTNEXTLINE(google-readability-casting)
|
||||
if (m_namep) VL_DO_CLEAR(free((void*)(m_namep)), m_namep = NULL);
|
||||
if (m_namep) VL_DO_CLEAR(free((void*)(m_namep)), m_namep = nullptr);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -2587,8 +2587,8 @@ size_t VerilatedVarProps::totalSize() const {
|
|||
}
|
||||
|
||||
void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const {
|
||||
if (VL_UNLIKELY(dim <= 0 || dim > udims())) return NULL;
|
||||
if (VL_UNLIKELY(indx < low(dim) || indx > high(dim))) return NULL;
|
||||
if (VL_UNLIKELY(dim <= 0 || dim > udims())) return nullptr;
|
||||
if (VL_UNLIKELY(indx < low(dim) || indx > high(dim))) return nullptr;
|
||||
int indxAdj = indx - low(dim);
|
||||
vluint8_t* bytep = reinterpret_cast<vluint8_t*>(datap);
|
||||
// If on index 1 of a 2 index array, then each index 1 is index2sz*entsz
|
||||
|
@ -2602,12 +2602,12 @@ void* VerilatedVarProps::datapAdjustIndex(void* datap, int dim, int indx) const
|
|||
// VerilatedScope:: Methods
|
||||
|
||||
VerilatedScope::VerilatedScope() {
|
||||
m_callbacksp = NULL;
|
||||
m_namep = NULL;
|
||||
m_identifierp = NULL;
|
||||
m_callbacksp = nullptr;
|
||||
m_namep = nullptr;
|
||||
m_identifierp = nullptr;
|
||||
m_funcnumMax = 0;
|
||||
m_symsp = NULL;
|
||||
m_varsp = NULL;
|
||||
m_symsp = nullptr;
|
||||
m_varsp = nullptr;
|
||||
m_timeunit = 0;
|
||||
m_type = SCOPE_OTHER;
|
||||
}
|
||||
|
@ -2615,9 +2615,9 @@ VerilatedScope::VerilatedScope() {
|
|||
VerilatedScope::~VerilatedScope() {
|
||||
// Memory cleanup - not called during normal operation
|
||||
VerilatedImp::scopeErase(this);
|
||||
if (m_namep) VL_DO_CLEAR(delete[] m_namep, m_namep = NULL);
|
||||
if (m_callbacksp) VL_DO_CLEAR(delete[] m_callbacksp, m_callbacksp = NULL);
|
||||
if (m_varsp) VL_DO_CLEAR(delete m_varsp, m_varsp = NULL);
|
||||
if (m_namep) VL_DO_CLEAR(delete[] m_namep, m_namep = nullptr);
|
||||
if (m_callbacksp) VL_DO_CLEAR(delete[] m_callbacksp, m_callbacksp = nullptr);
|
||||
if (m_varsp) VL_DO_CLEAR(delete m_varsp, m_varsp = nullptr);
|
||||
m_funcnumMax = 0; // Force callback table to empty
|
||||
}
|
||||
|
||||
|
@ -2699,7 +2699,7 @@ VerilatedVar* VerilatedScope::varFind(const char* namep) const VL_MT_SAFE_POSTIN
|
|||
VerilatedVarNameMap::iterator it = m_varsp->find(namep);
|
||||
if (VL_LIKELY(it != m_varsp->end())) return &(it->second);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
|
||||
|
@ -2708,7 +2708,7 @@ void* VerilatedScope::exportFindNullError(int funcnum) VL_MT_SAFE {
|
|||
+ "' but scope wasn't set, perhaps due to dpi import call without "
|
||||
+ "'context', or missing svSetScope. See IEEE 1800-2017 35.5.3.");
|
||||
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* VerilatedScope::exportFindError(int funcnum) const {
|
||||
|
@ -2717,7 +2717,7 @@ void* VerilatedScope::exportFindError(int funcnum) const {
|
|||
+ "' but this DPI export function exists only in other scopes, not scope '"
|
||||
+ name() + "'");
|
||||
VL_FATAL_MT("unknown", 0, "", msg.c_str());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void VerilatedScope::scopeDump() const {
|
||||
|
|
|
@ -409,7 +409,7 @@ class Verilated {
|
|||
const char** argv;
|
||||
CommandArgValues()
|
||||
: argc(0)
|
||||
, argv(NULL) {}
|
||||
, argv(nullptr) {}
|
||||
~CommandArgValues() {}
|
||||
} s_args;
|
||||
|
||||
|
@ -561,8 +561,8 @@ public:
|
|||
t_s.t_dpiFilename = filenamep;
|
||||
t_s.t_dpiLineno = lineno;
|
||||
}
|
||||
static void dpiClearContext() VL_MT_SAFE { t_s.t_dpiScopep = NULL; }
|
||||
static bool dpiInContext() VL_MT_SAFE { return t_s.t_dpiScopep != NULL; }
|
||||
static void dpiClearContext() VL_MT_SAFE { t_s.t_dpiScopep = nullptr; }
|
||||
static bool dpiInContext() VL_MT_SAFE { return t_s.t_dpiScopep != nullptr; }
|
||||
static const char* dpiFilenamep() VL_MT_SAFE { return t_s.t_dpiFilename; }
|
||||
static int dpiLineno() VL_MT_SAFE { return t_s.t_dpiLineno; }
|
||||
static int exportFuncNum(const char* namep) VL_MT_SAFE;
|
||||
|
|
|
@ -106,8 +106,8 @@ private:
|
|||
|
||||
// CONSTRUCTORS
|
||||
VerilatedCovImp() {
|
||||
m_insertp = NULL;
|
||||
m_insertFilenamep = NULL;
|
||||
m_insertp = nullptr;
|
||||
m_insertFilenamep = nullptr;
|
||||
m_insertLineno = 0;
|
||||
}
|
||||
VL_UNCOPYABLE(VerilatedCovImp);
|
||||
|
@ -340,7 +340,7 @@ public:
|
|||
}
|
||||
m_items.push_back(m_insertp);
|
||||
// Prepare for next
|
||||
m_insertp = NULL;
|
||||
m_insertp = nullptr;
|
||||
}
|
||||
|
||||
void write(const char* filename) VL_EXCLUDES(m_mutex) {
|
||||
|
@ -445,15 +445,15 @@ void VerilatedCov::_insertp(A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8)
|
|||
A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28),
|
||||
A(29)) VL_MT_SAFE {
|
||||
const char* keyps[VerilatedCovImpBase::MAX_KEYS]
|
||||
= {NULL, NULL, NULL, // filename,lineno,page
|
||||
key0, key1, key2, key3, key4, key5, key6, key7, key8, key9,
|
||||
key10, key11, key12, key13, key14, key15, key16, key17, key18, key19,
|
||||
key20, key21, key22, key23, key24, key25, key26, key27, key28, key29};
|
||||
= {nullptr, nullptr, nullptr, // filename,lineno,page
|
||||
key0, key1, key2, key3, key4, key5, key6, key7, key8, key9,
|
||||
key10, key11, key12, key13, key14, key15, key16, key17, key18, key19,
|
||||
key20, key21, key22, key23, key24, key25, key26, key27, key28, key29};
|
||||
const char* valps[VerilatedCovImpBase::MAX_KEYS]
|
||||
= {NULL, NULL, NULL, // filename,lineno,page
|
||||
valp0, valp1, valp2, valp3, valp4, valp5, valp6, valp7, valp8, valp9,
|
||||
valp10, valp11, valp12, valp13, valp14, valp15, valp16, valp17, valp18, valp19,
|
||||
valp20, valp21, valp22, valp23, valp24, valp25, valp26, valp27, valp28, valp29};
|
||||
= {nullptr, nullptr, nullptr, // filename,lineno,page
|
||||
valp0, valp1, valp2, valp3, valp4, valp5, valp6, valp7, valp8, valp9,
|
||||
valp10, valp11, valp12, valp13, valp14, valp15, valp16, valp17, valp18, valp19,
|
||||
valp20, valp21, valp22, valp23, valp24, valp25, valp26, valp27, valp28, valp29};
|
||||
VerilatedCovImp::imp().insertp(keyps, valps);
|
||||
}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
// there's not much more gain in having a version for each number of args.
|
||||
#define K(n) const char* key##n
|
||||
#define A(n) const char *key##n, const char *valp##n // Argument list
|
||||
#define D(n) const char *key##n = NULL, const char *valp##n = NULL // Argument list
|
||||
#define D(n) const char *key##n = nullptr, const char *valp##n = nullptr // Argument list
|
||||
static void _insertp(D(0), D(1), D(2), D(3), D(4), D(5), D(6), D(7), D(8), D(9));
|
||||
static void _insertp(A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), D(11),
|
||||
D(12), D(13), D(14), D(15), D(16), D(17), D(18), D(19));
|
||||
|
|
|
@ -181,7 +181,7 @@ void svPutPartselLogic(svLogicVecVal* dp, const svLogicVecVal s, int lbit, int w
|
|||
static inline const VerilatedDpiOpenVar* _vl_openhandle_varp(const svOpenArrayHandle h) {
|
||||
if (VL_UNLIKELY(!h)) {
|
||||
VL_FATAL_MT(__FILE__, __LINE__, "",
|
||||
"%%Error: DPI svOpenArrayHandle function called with NULL handle");
|
||||
"%%Error: DPI svOpenArrayHandle function called with nullptr handle");
|
||||
}
|
||||
const VerilatedDpiOpenVar* varp = reinterpret_cast<const VerilatedDpiOpenVar*>(h);
|
||||
if (VL_UNLIKELY(!varp->magicOk())) {
|
||||
|
@ -202,10 +202,10 @@ int svIncrement(const svOpenArrayHandle h, int d) { return _vl_openhandle_varp(h
|
|||
int svSize(const svOpenArrayHandle h, int d) { return _vl_openhandle_varp(h)->elements(d); }
|
||||
int svDimensions(const svOpenArrayHandle h) { return _vl_openhandle_varp(h)->udims(); }
|
||||
|
||||
/// Return pointer to open array data, or NULL if not in IEEE standard C layout
|
||||
/// Return pointer to open array data, or nullptr if not in IEEE standard C layout
|
||||
void* svGetArrayPtr(const svOpenArrayHandle h) {
|
||||
const VerilatedDpiOpenVar* varp = _vl_openhandle_varp(h);
|
||||
if (VL_UNLIKELY(!varp->isDpiStdLayout())) return NULL;
|
||||
if (VL_UNLIKELY(!varp->isDpiStdLayout())) return nullptr;
|
||||
return varp->datap();
|
||||
}
|
||||
/// Return size of open array, or 0 if not in IEEE standard C layout
|
||||
|
@ -226,7 +226,7 @@ static void* _vl_sv_adjusted_datap(const VerilatedDpiOpenVar* varp, int nargs, i
|
|||
_VL_SVDPI_WARN("%%Warning: DPI svOpenArrayHandle function called on"
|
||||
" %d dimensional array using %d dimensional function.\n",
|
||||
varp->udims(), nargs);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (nargs >= 1) {
|
||||
datap = varp->datapAdjustIndex(datap, 1, indx1);
|
||||
|
@ -234,7 +234,7 @@ static void* _vl_sv_adjusted_datap(const VerilatedDpiOpenVar* varp, int nargs, i
|
|||
_VL_SVDPI_WARN("%%Warning: DPI svOpenArrayHandle function index 1 "
|
||||
"out of bounds; %d outside [%d:%d].\n",
|
||||
indx1, varp->left(1), varp->right(1));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
if (nargs >= 2) {
|
||||
|
@ -243,7 +243,7 @@ static void* _vl_sv_adjusted_datap(const VerilatedDpiOpenVar* varp, int nargs, i
|
|||
_VL_SVDPI_WARN("%%Warning: DPI svOpenArrayHandle function index 2 "
|
||||
"out of bounds; %d outside [%d:%d].\n",
|
||||
indx2, varp->left(2), varp->right(2));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
if (nargs >= 3) {
|
||||
|
@ -252,7 +252,7 @@ static void* _vl_sv_adjusted_datap(const VerilatedDpiOpenVar* varp, int nargs, i
|
|||
_VL_SVDPI_WARN("%%Warning: DPI svOpenArrayHandle function index 3 "
|
||||
"out of bounds; %d outside [%d:%d].\n",
|
||||
indx1, varp->left(3), varp->right(3));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
return datap;
|
||||
|
@ -268,11 +268,11 @@ static int _vl_sv_adjusted_bit(const VerilatedDpiOpenVar* varp, int indx) {
|
|||
return indx - varp->low(0);
|
||||
}
|
||||
|
||||
/// Return pointer to simulator open array element, or NULL if outside range
|
||||
/// Return pointer to simulator open array element, or nullptr if outside range
|
||||
static void* _vl_svGetArrElemPtr(const svOpenArrayHandle h, int nargs, int indx1, int indx2,
|
||||
int indx3) VL_MT_SAFE {
|
||||
const VerilatedDpiOpenVar* varp = _vl_openhandle_varp(h);
|
||||
if (VL_UNLIKELY(!varp->isDpiStdLayout())) return NULL;
|
||||
if (VL_UNLIKELY(!varp->isDpiStdLayout())) return nullptr;
|
||||
void* datap = _vl_sv_adjusted_datap(varp, nargs, indx1, indx2, indx3);
|
||||
return datap;
|
||||
}
|
||||
|
@ -794,7 +794,7 @@ void svPutLogicArrElem3(const svOpenArrayHandle d, svLogic value, int indx1, int
|
|||
svScope svGetScope() {
|
||||
if (VL_UNLIKELY(!Verilated::dpiInContext())) {
|
||||
_VL_SVDPI_CONTEXT_WARN();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// NOLINTNEXTLINE(google-readability-casting)
|
||||
return (svScope)(Verilated::dpiScope());
|
||||
|
|
|
@ -59,13 +59,13 @@
|
|||
|
||||
VerilatedFst::VerilatedFst(void* fst)
|
||||
: m_fst(fst)
|
||||
, m_symbolp(NULL)
|
||||
, m_strbuf(NULL) {}
|
||||
, m_symbolp(nullptr)
|
||||
, m_strbuf(nullptr) {}
|
||||
|
||||
VerilatedFst::~VerilatedFst() {
|
||||
if (m_fst) fstWriterClose(m_fst);
|
||||
if (m_symbolp) VL_DO_CLEAR(delete[] m_symbolp, m_symbolp = NULL);
|
||||
if (m_strbuf) VL_DO_CLEAR(delete[] m_strbuf, m_strbuf = NULL);
|
||||
if (m_symbolp) VL_DO_CLEAR(delete[] m_symbolp, m_symbolp = nullptr);
|
||||
if (m_strbuf) VL_DO_CLEAR(delete[] m_strbuf, m_strbuf = nullptr);
|
||||
}
|
||||
|
||||
void VerilatedFst::open(const char* filename) VL_MT_UNSAFE {
|
||||
|
@ -106,7 +106,7 @@ void VerilatedFst::close() {
|
|||
m_assertOne.check();
|
||||
VerilatedTrace<VerilatedFst>::close();
|
||||
fstWriterClose(m_fst);
|
||||
m_fst = NULL;
|
||||
m_fst = nullptr;
|
||||
}
|
||||
|
||||
void VerilatedFst::flush() {
|
||||
|
@ -158,7 +158,7 @@ void VerilatedFst::declare(vluint32_t code, const char* name, int dtypenum, fstV
|
|||
|
||||
// Follow the hierarchy of the new variable from the common scope point
|
||||
while (new_it != tokens.end()) {
|
||||
fstWriterSetScope(m_fst, FST_ST_VCD_SCOPE, new_it->c_str(), NULL);
|
||||
fstWriterSetScope(m_fst, FST_ST_VCD_SCOPE, new_it->c_str(), nullptr);
|
||||
m_curScope.push_back(*new_it);
|
||||
new_it = tokens.erase(new_it);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
//=========================================================================
|
||||
// External interface to client code
|
||||
|
||||
explicit VerilatedFst(void* fst = NULL);
|
||||
explicit VerilatedFst(void* fst = nullptr);
|
||||
~VerilatedFst();
|
||||
|
||||
/// Open the file; call isOpen() to see if errors
|
||||
|
@ -93,7 +93,7 @@ public:
|
|||
/// Flush any remaining data to this file
|
||||
void flush() VL_MT_UNSAFE;
|
||||
/// Is file open?
|
||||
bool isOpen() const { return m_fst != NULL; }
|
||||
bool isOpen() const { return m_fst != nullptr; }
|
||||
|
||||
//=========================================================================
|
||||
// Internal interface to Verilator generated code
|
||||
|
@ -135,7 +135,7 @@ class VerilatedFstC {
|
|||
VL_UNCOPYABLE(VerilatedFstC);
|
||||
|
||||
public:
|
||||
explicit VerilatedFstC(void* filep = NULL)
|
||||
explicit VerilatedFstC(void* filep = nullptr)
|
||||
: m_sptrace(filep) {}
|
||||
~VerilatedFstC() { close(); }
|
||||
/// Routines can only be called from one thread; allow next call from different thread
|
||||
|
|
|
@ -55,7 +55,7 @@ class VlReadMem {
|
|||
public:
|
||||
VlReadMem(bool hex, int bits, const std::string& filename, QData start, QData end);
|
||||
~VlReadMem();
|
||||
bool isOpen() const { return m_fp != NULL; }
|
||||
bool isOpen() const { return m_fp != nullptr; }
|
||||
int linenum() const { return m_linenum; }
|
||||
bool get(QData& addrr, std::string& valuer);
|
||||
void setData(void* valuep, const std::string& rhs);
|
||||
|
@ -69,7 +69,7 @@ class VlWriteMem {
|
|||
public:
|
||||
VlWriteMem(bool hex, int bits, const std::string& filename, QData start, QData end);
|
||||
~VlWriteMem();
|
||||
bool isOpen() const { return m_fp != NULL; }
|
||||
bool isOpen() const { return m_fp != nullptr; }
|
||||
void print(QData addr, bool addrstamp, const void* valuep);
|
||||
};
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ public:
|
|||
static inline void* userFind(const void* scopep, void* userKey) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock(s_s.m_userMapMutex);
|
||||
UserMap::const_iterator it = s_s.m_userMap.find(std::make_pair(scopep, userKey));
|
||||
if (VL_UNLIKELY(it == s_s.m_userMap.end())) return NULL;
|
||||
if (VL_UNLIKELY(it == s_s.m_userMap.end())) return nullptr;
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ public: // But only for verilated*.cpp
|
|||
const VerilatedLockGuard lock(s_s.m_nameMutex);
|
||||
// If too slow, can assume this is only VL_MT_SAFE_POSINIT
|
||||
VerilatedScopeNameMap::const_iterator it = s_s.m_nameMap.find(namep);
|
||||
if (VL_UNLIKELY(it == s_s.m_nameMap.end())) return NULL;
|
||||
if (VL_UNLIKELY(it == s_s.m_nameMap.end())) return nullptr;
|
||||
return it->second;
|
||||
}
|
||||
static void scopeErase(const VerilatedScope* scopep) VL_MT_SAFE {
|
||||
|
@ -544,7 +544,7 @@ public: // But only for verilated*.cpp
|
|||
for (int i = 0; (fdi != 0) && (i < 31); i++, fdi >>= 1) {
|
||||
if (fdi & VL_MASK_I(1)) {
|
||||
fclose(s_s.m_fdps[i]);
|
||||
s_s.m_fdps[i] = NULL;
|
||||
s_s.m_fdps[i] = nullptr;
|
||||
s_s.m_fdFreeMct.push_back(i);
|
||||
}
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ public: // But only for verilated*.cpp
|
|||
static inline FILE* fdToFp(IData fdi) VL_MT_SAFE {
|
||||
const VerilatedLockGuard lock(s_s.m_fdMutex);
|
||||
const VerilatedFpList fdlist = fdToFpList(fdi);
|
||||
if (VL_UNLIKELY(fdlist.size() != 1)) return NULL;
|
||||
if (VL_UNLIKELY(fdlist.size() != 1)) return nullptr;
|
||||
return *fdlist.begin();
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
}
|
||||
virtual ~VerilatedSerialize() {
|
||||
close();
|
||||
if (m_bufp) VL_DO_CLEAR(delete[] m_bufp, m_bufp = NULL);
|
||||
if (m_bufp) VL_DO_CLEAR(delete[] m_bufp, m_bufp = nullptr);
|
||||
}
|
||||
// METHODS
|
||||
bool isOpen() const { return m_isOpen; }
|
||||
|
@ -114,11 +114,11 @@ public:
|
|||
m_isOpen = false;
|
||||
m_bufp = new vluint8_t[bufferSize()];
|
||||
m_cp = m_bufp;
|
||||
m_endp = NULL;
|
||||
m_endp = nullptr;
|
||||
}
|
||||
virtual ~VerilatedDeserialize() {
|
||||
close();
|
||||
if (m_bufp) VL_DO_CLEAR(delete[] m_bufp, m_bufp = NULL);
|
||||
if (m_bufp) VL_DO_CLEAR(delete[] m_bufp, m_bufp = nullptr);
|
||||
}
|
||||
// METHODS
|
||||
bool isOpen() const { return m_isOpen; }
|
||||
|
|
|
@ -97,7 +97,7 @@ protected:
|
|||
, m_vlflags(vlflags)
|
||||
, m_pdims(pdims)
|
||||
, m_udims(udims) {
|
||||
initUnpacked(NULL);
|
||||
initUnpacked(nullptr);
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
std::atomic<vluint64_t> VlMTaskVertex::s_yields;
|
||||
|
||||
VL_THREAD_LOCAL VlThreadPool::ProfileTrace* VlThreadPool::t_profilep = NULL;
|
||||
VL_THREAD_LOCAL VlThreadPool::ProfileTrace* VlThreadPool::t_profilep = nullptr;
|
||||
|
||||
//=============================================================================
|
||||
// VlMTaskVertex
|
||||
|
@ -55,7 +55,7 @@ void VlWorkerThread::workerLoop() {
|
|||
if (VL_UNLIKELY(m_profiling)) m_poolp->setupProfilingClientThread();
|
||||
|
||||
ExecRec work;
|
||||
work.m_fnp = NULL;
|
||||
work.m_fnp = nullptr;
|
||||
|
||||
while (true) {
|
||||
if (VL_LIKELY(!work.m_fnp)) dequeWork(&work);
|
||||
|
@ -65,7 +65,7 @@ void VlWorkerThread::workerLoop() {
|
|||
|
||||
if (VL_LIKELY(work.m_fnp)) {
|
||||
work.m_fnp(work.m_evenCycle, work.m_sym);
|
||||
work.m_fnp = NULL;
|
||||
work.m_fnp = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ VlThreadPool::~VlThreadPool() {
|
|||
void VlThreadPool::tearDownProfilingClientThread() {
|
||||
assert(t_profilep);
|
||||
delete t_profilep;
|
||||
t_profilep = NULL;
|
||||
t_profilep = nullptr;
|
||||
}
|
||||
|
||||
void VlThreadPool::setupProfilingClientThread() {
|
||||
|
|
|
@ -174,8 +174,8 @@ private:
|
|||
VlThrSymTab m_sym; // Symbol table to execute
|
||||
bool m_evenCycle; // Even/odd for flag alternation
|
||||
ExecRec()
|
||||
: m_fnp(NULL)
|
||||
, m_sym(NULL)
|
||||
: m_fnp(nullptr)
|
||||
, m_sym(nullptr)
|
||||
, m_evenCycle(false) {}
|
||||
ExecRec(VlExecFnp fnp, bool evenCycle, VlThrSymTab sym)
|
||||
: m_fnp(fnp)
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
// Static utility functions
|
||||
|
||||
static double timescaleToDouble(const char* unitp) {
|
||||
char* endp = NULL;
|
||||
char* endp = nullptr;
|
||||
double value = strtod(unitp, &endp);
|
||||
// On error so we allow just "ns" to return 1e-9.
|
||||
if (value == 0.0 && endp == unitp) value = 1;
|
||||
|
@ -276,7 +276,7 @@ template <> void VerilatedTrace<VL_DERIVED_T>::onExit(void* selfp) {
|
|||
|
||||
template <>
|
||||
VerilatedTrace<VL_DERIVED_T>::VerilatedTrace()
|
||||
: m_sigs_oldvalp(NULL)
|
||||
: m_sigs_oldvalp(nullptr)
|
||||
, m_timeLastDump(0)
|
||||
, m_fullDump(true)
|
||||
, m_nextCode(0)
|
||||
|
@ -294,7 +294,7 @@ VerilatedTrace<VL_DERIVED_T>::VerilatedTrace()
|
|||
}
|
||||
|
||||
template <> VerilatedTrace<VL_DERIVED_T>::~VerilatedTrace() {
|
||||
if (m_sigs_oldvalp) VL_DO_CLEAR(delete[] m_sigs_oldvalp, m_sigs_oldvalp = NULL);
|
||||
if (m_sigs_oldvalp) VL_DO_CLEAR(delete[] m_sigs_oldvalp, m_sigs_oldvalp = nullptr);
|
||||
Verilated::removeFlushCb(VerilatedTrace<VL_DERIVED_T>::onFlush, this);
|
||||
Verilated::removeExitCb(VerilatedTrace<VL_DERIVED_T>::onExit, this);
|
||||
#ifdef VL_TRACE_THREADED
|
||||
|
|
|
@ -93,16 +93,16 @@ VerilatedVcd::VerilatedVcd(VerilatedVcdFile* filep)
|
|||
, m_rolloverMB(0)
|
||||
, m_modDepth(0) {
|
||||
// Not in header to avoid link issue if header is included without this .cpp file
|
||||
m_fileNewed = (filep == NULL);
|
||||
m_fileNewed = (filep == nullptr);
|
||||
m_filep = m_fileNewed ? new VerilatedVcdFile : filep;
|
||||
m_namemapp = NULL;
|
||||
m_namemapp = nullptr;
|
||||
m_evcd = false;
|
||||
m_wrChunkSize = 8 * 1024;
|
||||
m_wrBufp = new char[m_wrChunkSize * 8];
|
||||
m_wrFlushp = m_wrBufp + m_wrChunkSize * 6;
|
||||
m_writep = m_wrBufp;
|
||||
m_wroteBytes = 0;
|
||||
m_suffixesp = NULL;
|
||||
m_suffixesp = nullptr;
|
||||
}
|
||||
|
||||
void VerilatedVcd::open(const char* filename) {
|
||||
|
@ -211,14 +211,14 @@ void VerilatedVcd::makeNameMap() {
|
|||
}
|
||||
|
||||
void VerilatedVcd::deleteNameMap() {
|
||||
if (m_namemapp) VL_DO_CLEAR(delete m_namemapp, m_namemapp = NULL);
|
||||
if (m_namemapp) VL_DO_CLEAR(delete m_namemapp, m_namemapp = nullptr);
|
||||
}
|
||||
|
||||
VerilatedVcd::~VerilatedVcd() {
|
||||
close();
|
||||
if (m_wrBufp) VL_DO_CLEAR(delete[] m_wrBufp, m_wrBufp = NULL);
|
||||
if (m_wrBufp) VL_DO_CLEAR(delete[] m_wrBufp, m_wrBufp = nullptr);
|
||||
deleteNameMap();
|
||||
if (m_filep && m_fileNewed) VL_DO_CLEAR(delete m_filep, m_filep = NULL);
|
||||
if (m_filep && m_fileNewed) VL_DO_CLEAR(delete m_filep, m_filep = nullptr);
|
||||
}
|
||||
|
||||
void VerilatedVcd::closePrev() {
|
||||
|
@ -286,7 +286,7 @@ void VerilatedVcd::bufferResize(vluint64_t minsize) {
|
|||
memcpy(m_wrBufp, oldbufp, m_writep - oldbufp);
|
||||
m_writep = m_wrBufp + (m_writep - oldbufp);
|
||||
m_wrFlushp = m_wrBufp + m_wrChunkSize * 6;
|
||||
VL_DO_CLEAR(delete[] oldbufp, oldbufp = NULL);
|
||||
VL_DO_CLEAR(delete[] oldbufp, oldbufp = nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,7 +350,7 @@ void VerilatedVcd::printIndent(int level_change) {
|
|||
|
||||
void VerilatedVcd::dumpHeader() {
|
||||
printStr("$version Generated by VerilatedVcd $end\n");
|
||||
time_t time_str = time(NULL);
|
||||
time_t time_str = time(nullptr);
|
||||
printStr("$date ");
|
||||
printStr(ctime(&time_str));
|
||||
printStr(" $end\n");
|
||||
|
|
|
@ -133,7 +133,7 @@ public:
|
|||
//=========================================================================
|
||||
// External interface to client code
|
||||
|
||||
explicit VerilatedVcd(VerilatedVcdFile* filep = NULL);
|
||||
explicit VerilatedVcd(VerilatedVcdFile* filep = nullptr);
|
||||
~VerilatedVcd();
|
||||
|
||||
// ACCESSORS
|
||||
|
@ -337,7 +337,7 @@ class VerilatedVcdC {
|
|||
VL_UNCOPYABLE(VerilatedVcdC);
|
||||
|
||||
public:
|
||||
explicit VerilatedVcdC(VerilatedVcdFile* filep = NULL)
|
||||
explicit VerilatedVcdC(VerilatedVcdFile* filep = nullptr)
|
||||
: m_sptrace(filep) {}
|
||||
~VerilatedVcdC() { close(); }
|
||||
/// Routines can only be called from one thread; allow next call from different thread
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
virtual const char* defname() const { return "<null>"; }
|
||||
virtual vluint32_t type() const { return 0; }
|
||||
virtual vluint32_t size() const { return 0; }
|
||||
virtual const VerilatedRange* rangep() const { return NULL; }
|
||||
virtual const VerilatedRange* rangep() const { return nullptr; }
|
||||
virtual vpiHandle dovpi_scan() { return 0; }
|
||||
};
|
||||
|
||||
|
@ -231,13 +231,13 @@ public:
|
|||
: m_varp(varp)
|
||||
, m_scopep(scopep)
|
||||
, m_index(0) {
|
||||
m_prevDatap = NULL;
|
||||
m_prevDatap = nullptr;
|
||||
m_mask.u32 = VL_MASK_I(varp->packed().elements());
|
||||
m_entSize = varp->entSize();
|
||||
m_varDatap = varp->datap();
|
||||
}
|
||||
virtual ~VerilatedVpioVar() {
|
||||
if (m_prevDatap) VL_DO_CLEAR(delete[] m_prevDatap, m_prevDatap = NULL);
|
||||
if (m_prevDatap) VL_DO_CLEAR(delete[] m_prevDatap, m_prevDatap = nullptr);
|
||||
}
|
||||
static inline VerilatedVpioVar* castp(vpiHandle h) {
|
||||
return dynamic_cast<VerilatedVpioVar*>(reinterpret_cast<VerilatedVpio*>(h));
|
||||
|
@ -427,7 +427,7 @@ class VerilatedVpiImp {
|
|||
static VerilatedVpiImp s_s; // Singleton
|
||||
|
||||
public:
|
||||
VerilatedVpiImp() { m_errorInfop = NULL; }
|
||||
VerilatedVpiImp() { m_errorInfop = nullptr; }
|
||||
~VerilatedVpiImp() {}
|
||||
static void assertOneCheck() { s_s.m_assertOne.check(); }
|
||||
static void cbReasonAdd(VerilatedVpioCb* vop) {
|
||||
|
@ -447,9 +447,9 @@ public:
|
|||
static void cbReasonRemove(VerilatedVpioCb* cbp) {
|
||||
VpioCbList& cbObjList = s_s.m_cbObjLists[cbp->reason()];
|
||||
// We do not remove it now as we may be iterating the list,
|
||||
// instead set to NULL and will cleanup later
|
||||
// instead set to nullptr and will cleanup later
|
||||
for (VpioCbList::iterator it = cbObjList.begin(); it != cbObjList.end(); ++it) {
|
||||
if (*it == cbp) *it = NULL;
|
||||
if (*it == cbp) *it = nullptr;
|
||||
}
|
||||
}
|
||||
static void cbTimedRemove(VerilatedVpioCb* cbp) {
|
||||
|
@ -572,11 +572,11 @@ public:
|
|||
va_end(args);
|
||||
m_errorInfo.state = vpiPLI;
|
||||
filehold = file;
|
||||
setError((PLI_BYTE8*)m_buff, NULL, const_cast<PLI_BYTE8*>(filehold.c_str()), line);
|
||||
setError((PLI_BYTE8*)m_buff, nullptr, const_cast<PLI_BYTE8*>(filehold.c_str()), line);
|
||||
}
|
||||
p_vpi_error_info getError() {
|
||||
if (m_flag) return &m_errorInfo;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void resetError() { m_flag = false; }
|
||||
static void vpi_unsupported() {
|
||||
|
@ -598,7 +598,7 @@ public:
|
|||
//======================================================================
|
||||
|
||||
VerilatedVpiImp VerilatedVpiImp::s_s; // Singleton
|
||||
VL_THREAD_LOCAL vluint8_t* VerilatedVpio::t_freeHead = NULL;
|
||||
VL_THREAD_LOCAL vluint8_t* VerilatedVpio::t_freeHead = nullptr;
|
||||
|
||||
//======================================================================
|
||||
// VerilatedVpi implementation
|
||||
|
@ -1020,7 +1020,7 @@ vpiHandle vpi_register_cb(p_cb_data cb_data_p) {
|
|||
// cppcheck-suppress nullPointer
|
||||
if (VL_UNLIKELY(!cb_data_p)) {
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "%s : callback data pointer is null", VL_FUNC);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
switch (cb_data_p->reason) {
|
||||
case cbAfterDelay: {
|
||||
|
@ -1050,7 +1050,7 @@ vpiHandle vpi_register_cb(p_cb_data cb_data_p) {
|
|||
default:
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "%s: Unsupported callback type %s", VL_FUNC,
|
||||
VerilatedVpiError::strFromVpiCallbackReason(cb_data_p->reason));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1082,9 +1082,9 @@ void vpi_get_systf_info(vpiHandle /*object*/, p_vpi_systf_data /*systf_data_p*/)
|
|||
vpiHandle vpi_handle_by_name(PLI_BYTE8* namep, vpiHandle scope) {
|
||||
VerilatedVpiImp::assertOneCheck();
|
||||
_VL_VPI_ERROR_RESET();
|
||||
if (VL_UNLIKELY(!namep)) return NULL;
|
||||
if (VL_UNLIKELY(!namep)) return nullptr;
|
||||
VL_DEBUG_IF_PLI(VL_DBG_MSGF("- vpi: vpi_handle_by_name %s %p\n", namep, scope););
|
||||
const VerilatedVar* varp = NULL;
|
||||
const VerilatedVar* varp = nullptr;
|
||||
const VerilatedScope* scopep;
|
||||
VerilatedVpioScope* voScopep = VerilatedVpioScope::castp(scope);
|
||||
std::string scopeAndName = namep;
|
||||
|
@ -1117,11 +1117,11 @@ vpiHandle vpi_handle_by_name(PLI_BYTE8* namep, vpiHandle scope) {
|
|||
}
|
||||
if (!varp) {
|
||||
scopep = Verilated::scopeFind(scopename.c_str());
|
||||
if (!scopep) return NULL;
|
||||
if (!scopep) return nullptr;
|
||||
varp = scopep->varFind(baseNamep);
|
||||
}
|
||||
}
|
||||
if (!varp) return NULL;
|
||||
if (!varp) return nullptr;
|
||||
|
||||
if (varp->isParam()) {
|
||||
return (new VerilatedVpioParam(varp, scopep))->castVpiHandle();
|
||||
|
@ -1256,7 +1256,7 @@ vpiHandle vpi_iterate(PLI_INT32 type, vpiHandle object) {
|
|||
case vpiModule: {
|
||||
VerilatedVpioModule* vop = VerilatedVpioModule::castp(object);
|
||||
const VerilatedHierarchyMap* map = VerilatedImp::hierarchyMap();
|
||||
const VerilatedScope* mod = vop ? vop->scopep() : NULL;
|
||||
const VerilatedScope* mod = vop ? vop->scopep() : nullptr;
|
||||
VerilatedHierarchyMap::const_iterator it = map->find(const_cast<VerilatedScope*>(mod));
|
||||
if (it == map->end()) return 0;
|
||||
return ((new VerilatedVpioModuleIter(it->second))->castVpiHandle());
|
||||
|
@ -1272,7 +1272,7 @@ vpiHandle vpi_scan(vpiHandle object) {
|
|||
VerilatedVpiImp::assertOneCheck();
|
||||
_VL_VPI_ERROR_RESET();
|
||||
VerilatedVpio* vop = VerilatedVpio::castp(object);
|
||||
if (VL_UNLIKELY(!vop)) return NULL;
|
||||
if (VL_UNLIKELY(!vop)) return nullptr;
|
||||
return vop->dovpi_scan();
|
||||
}
|
||||
|
||||
|
@ -1331,7 +1331,7 @@ PLI_BYTE8* vpi_get_str(PLI_INT32 property, vpiHandle object) {
|
|||
VerilatedVpiImp::assertOneCheck();
|
||||
VerilatedVpio* vop = VerilatedVpio::castp(object);
|
||||
_VL_VPI_ERROR_RESET();
|
||||
if (VL_UNLIKELY(!vop)) return NULL;
|
||||
if (VL_UNLIKELY(!vop)) return nullptr;
|
||||
switch (property) {
|
||||
case vpiName: {
|
||||
return const_cast<PLI_BYTE8*>(vop->name());
|
||||
|
@ -1521,7 +1521,7 @@ void vl_get_value(const VerilatedVar* varp, void* varDatap, p_vpi_value valuep,
|
|||
return;
|
||||
} else if (valuep->format == vpiDecStrVal) {
|
||||
valuep->value.str = outStr;
|
||||
// outStrSz does not include NULL termination so add one
|
||||
// outStrSz does not include nullptr termination so add one
|
||||
if (varp->vltype() == VLVT_UINT8) {
|
||||
VL_SNPRINTF(outStr, outStrSz + 1, "%hhu",
|
||||
static_cast<unsigned char>(*(reinterpret_cast<CData*>(varDatap))));
|
||||
|
@ -1645,7 +1645,7 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_
|
|||
VerilatedVpiImp::assertOneCheck();
|
||||
_VL_VPI_ERROR_RESET();
|
||||
if (VL_UNLIKELY(!valuep)) {
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_put_value with NULL value pointer");
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_put_value with nullptr value pointer");
|
||||
return 0;
|
||||
}
|
||||
if (VerilatedVpioVar* vop = VerilatedVpioVar::castp(object)) {
|
||||
|
@ -1663,7 +1663,7 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_
|
|||
}
|
||||
if (!vl_check_format(vop->varp(), valuep, vop->fullname(), false)) return 0;
|
||||
if (valuep->format == vpiVectorVal) {
|
||||
if (VL_UNLIKELY(!valuep->value.vector)) return NULL;
|
||||
if (VL_UNLIKELY(!valuep->value.vector)) return nullptr;
|
||||
if (vop->varp()->vltype() == VLVT_UINT8) {
|
||||
*(reinterpret_cast<CData*>(vop->varDatap()))
|
||||
= valuep->value.vector[0].aval & vop->mask();
|
||||
|
@ -1847,7 +1847,7 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_
|
|||
}
|
||||
_VL_VPI_ERROR(__FILE__, __LINE__, "%s: Unsupported format (%s) as requested for %s",
|
||||
VL_FUNC, VerilatedVpiError::strFromVpiVal(valuep->format), vop->fullname());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} else if (VerilatedVpioParam* vop = VerilatedVpioParam::castp(object)) {
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "%s: Ignoring vpi_put_value to vpiParameter: %s",
|
||||
VL_FUNC, vop->fullname());
|
||||
|
@ -1858,7 +1858,7 @@ vpiHandle vpi_put_value(vpiHandle object, p_vpi_value valuep, p_vpi_time /*time_
|
|||
return 0;
|
||||
}
|
||||
_VL_VPI_ERROR(__FILE__, __LINE__, "%s: Unsupported vpiHandle (%p)", VL_FUNC, object);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void vpi_get_value_array(vpiHandle /*object*/, p_vpi_arrayvalue /*arrayvalue_p*/,
|
||||
|
@ -1877,7 +1877,7 @@ void vpi_get_time(vpiHandle object, p_vpi_time time_p) {
|
|||
_VL_VPI_ERROR_RESET();
|
||||
// cppcheck-suppress nullPointer
|
||||
if (VL_UNLIKELY(!time_p)) {
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_get_time with NULL value pointer");
|
||||
_VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_get_time with nullptr value pointer");
|
||||
return;
|
||||
}
|
||||
if (time_p->type == vpiSimTime) {
|
||||
|
@ -1980,7 +1980,7 @@ PLI_INT32 vpi_compare_objects(vpiHandle /*object1*/, vpiHandle /*object2*/) {
|
|||
}
|
||||
PLI_INT32 vpi_chk_error(p_vpi_error_info error_info_p) {
|
||||
// executing vpi_chk_error does not reset error
|
||||
// error_info_p can be NULL, so only return level in that case
|
||||
// error_info_p can be nullptr, so only return level in that case
|
||||
VerilatedVpiImp::assertOneCheck();
|
||||
p_vpi_error_info _error_info_p = VerilatedVpiImp::error_info()->getError();
|
||||
if (error_info_p && _error_info_p) *error_info_p = *_error_info_p;
|
||||
|
|
|
@ -152,14 +152,14 @@
|
|||
#if defined(VL_CPPCHECK) || defined(__clang_analyzer__) || __cplusplus < 201103L
|
||||
# define VL_DANGLING(var)
|
||||
#else
|
||||
/// After e.g. delete, set variable to NULL to indicate must not use later
|
||||
/// After e.g. delete, set variable to nullptr to indicate must not use later
|
||||
# define VL_DANGLING(var) \
|
||||
do { \
|
||||
*const_cast<const void**>(reinterpret_cast<const void* const*>(&var)) = NULL; \
|
||||
*const_cast<const void**>(reinterpret_cast<const void* const*>(&var)) = nullptr; \
|
||||
} while (false)
|
||||
#endif
|
||||
|
||||
/// Perform an e.g. delete, then set variable to NULL to indicate must not use later.
|
||||
/// Perform an e.g. delete, then set variable to nullptr to indicate must not use later.
|
||||
/// Unlike VL_DO_CLEAR the setting of the variable is only for debug reasons.
|
||||
#define VL_DO_DANGLING(stmt, var) \
|
||||
do { \
|
||||
|
@ -169,7 +169,7 @@
|
|||
VL_DANGLING(var); \
|
||||
} while (false)
|
||||
|
||||
/// Perform an e.g. delete, then set variable to NULL as a requirement
|
||||
/// Perform an e.g. delete, then set variable to nullptr as a requirement
|
||||
#define VL_DO_CLEAR(stmt, stmt2) \
|
||||
do { \
|
||||
do { \
|
||||
|
|
|
@ -61,14 +61,14 @@ private:
|
|||
|
||||
// METHODS
|
||||
void addActive(AstActive* nodep) {
|
||||
UASSERT_OBJ(m_scopep, nodep, "NULL scope");
|
||||
UASSERT_OBJ(m_scopep, nodep, "nullptr scope");
|
||||
m_scopep->addActivep(nodep);
|
||||
}
|
||||
// VISITORS
|
||||
virtual void visit(AstScope* nodep) override {
|
||||
m_scopep = nodep;
|
||||
m_iActivep = NULL;
|
||||
m_cActivep = NULL;
|
||||
m_iActivep = nullptr;
|
||||
m_cActivep = nullptr;
|
||||
m_activeSens.clear();
|
||||
m_activeMap.clear();
|
||||
iterateChildren(nodep);
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
AstActive* getActive(FileLine* fl, AstSenTree* sensesp) {
|
||||
// Return a sentree in this scope that matches given sense list.
|
||||
|
||||
AstActive* activep = NULL;
|
||||
AstActive* activep = nullptr;
|
||||
AstSenTree* activeSenp = m_activeSens.find(sensesp);
|
||||
if (activeSenp) {
|
||||
ActiveMap::iterator it = m_activeMap.find(activeSenp);
|
||||
|
@ -132,9 +132,9 @@ public:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
ActiveNamer() {
|
||||
m_scopep = NULL;
|
||||
m_iActivep = NULL;
|
||||
m_cActivep = NULL;
|
||||
m_scopep = nullptr;
|
||||
m_iActivep = nullptr;
|
||||
m_cActivep = nullptr;
|
||||
}
|
||||
virtual ~ActiveNamer() {}
|
||||
void main(AstScope* nodep) { iterate(nodep); }
|
||||
|
@ -208,7 +208,7 @@ public:
|
|||
ActiveDlyVisitor(AstNode* nodep, CheckType check) {
|
||||
m_alwaysp = nodep;
|
||||
m_check = check;
|
||||
m_assignp = NULL;
|
||||
m_assignp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~ActiveDlyVisitor() {}
|
||||
|
@ -235,7 +235,7 @@ private:
|
|||
UINFO(4, " SCOPE " << nodep << endl);
|
||||
// Clear last scope's names, and collect this scope's existing names
|
||||
m_namer.main(nodep);
|
||||
m_scopeFinalp = NULL;
|
||||
m_scopeFinalp = nullptr;
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
|
@ -321,7 +321,7 @@ private:
|
|||
sequent = false;
|
||||
}
|
||||
|
||||
AstActive* wantactivep = NULL;
|
||||
AstActive* wantactivep = nullptr;
|
||||
if (combo && !sequent) {
|
||||
// Combo: Relink to ACTIVE(combo)
|
||||
wantactivep = m_namer.getCActive(nodep->fileline());
|
||||
|
@ -412,7 +412,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit ActiveVisitor(AstNetlist* nodep)
|
||||
: m_scopeFinalp(NULL)
|
||||
: m_scopeFinalp(nullptr)
|
||||
, m_itemCombo(false)
|
||||
, m_itemSequent(false) {
|
||||
iterate(nodep);
|
||||
|
|
|
@ -56,7 +56,7 @@ private:
|
|||
m_topscopep = nodep;
|
||||
m_finder.init(m_topscopep);
|
||||
iterateChildren(nodep);
|
||||
m_topscopep = NULL;
|
||||
m_topscopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeModule* nodep) override {
|
||||
// Create required actives and add to module
|
||||
|
@ -69,7 +69,7 @@ private:
|
|||
// Remove duplicate clocks and such; sensesp() may change!
|
||||
V3Const::constifyExpensiveEdit(nodep);
|
||||
AstSenTree* sensesp = nodep->sensesp();
|
||||
UASSERT_OBJ(sensesp, nodep, "NULL");
|
||||
UASSERT_OBJ(sensesp, nodep, "nullptr");
|
||||
if (sensesp->sensesp() && VN_IS(sensesp->sensesp(), SenItem)
|
||||
&& VN_CAST(sensesp->sensesp(), SenItem)->isNever()) {
|
||||
// Never executing. Kill it.
|
||||
|
@ -128,7 +128,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit ActiveTopVisitor(AstNetlist* nodep)
|
||||
: m_topscopep(NULL) {
|
||||
: m_topscopep(nullptr) {
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~ActiveTopVisitor() {}
|
||||
|
|
|
@ -74,15 +74,15 @@ private:
|
|||
(v3Global.opt.assertOn()
|
||||
? static_cast<AstNode*>(new AstCMath(fl, "Verilated::assertOn()", 1))
|
||||
: static_cast<AstNode*>(new AstConst(fl, AstConst::LogicFalse()))),
|
||||
nodep, NULL);
|
||||
nodep, nullptr);
|
||||
newp->user1(true); // Don't assert/cover this if
|
||||
return newp;
|
||||
}
|
||||
|
||||
AstNode* newFireAssertUnchecked(AstNode* nodep, const string& message) {
|
||||
// Like newFireAssert() but omits the asserts-on check
|
||||
AstDisplay* dispp
|
||||
= new AstDisplay(nodep->fileline(), AstDisplayType::DT_ERROR, message, NULL, NULL);
|
||||
AstDisplay* dispp = new AstDisplay(nodep->fileline(), AstDisplayType::DT_ERROR, message,
|
||||
nullptr, nullptr);
|
||||
AstNode* bodysp = dispp;
|
||||
replaceDisplay(dispp, "%%Error"); // Convert to standard DISPLAY format
|
||||
bodysp->addNext(new AstStop(nodep->fileline(), true));
|
||||
|
@ -112,9 +112,9 @@ private:
|
|||
sentreep->unlinkFrBack();
|
||||
}
|
||||
//
|
||||
AstNode* bodysp = NULL;
|
||||
AstNode* bodysp = nullptr;
|
||||
bool selfDestruct = false;
|
||||
AstIf* ifp = NULL;
|
||||
AstIf* ifp = nullptr;
|
||||
if (AstCover* snodep = VN_CAST(nodep, Cover)) {
|
||||
++m_statCover;
|
||||
if (!v3Global.opt.coverageUser()) {
|
||||
|
@ -129,7 +129,7 @@ private:
|
|||
}
|
||||
|
||||
if (bodysp && passsp) bodysp = bodysp->addNext(passsp);
|
||||
ifp = new AstIf(nodep->fileline(), propp, bodysp, NULL);
|
||||
ifp = new AstIf(nodep->fileline(), propp, bodysp, nullptr);
|
||||
bodysp = ifp;
|
||||
} else if (VN_IS(nodep, Assert)) {
|
||||
if (nodep->immediate()) {
|
||||
|
@ -141,7 +141,7 @@ private:
|
|||
if (failsp) failsp = newIfAssertOn(failsp);
|
||||
if (!failsp) failsp = newFireAssertUnchecked(nodep, "'assert' failed.");
|
||||
ifp = new AstIf(nodep->fileline(), propp, passsp, failsp);
|
||||
// It's more LIKELY that we'll take the NULL if clause
|
||||
// It's more LIKELY that we'll take the nullptr if clause
|
||||
// than the sim-killing else clause:
|
||||
ifp->branchPred(VBranchPred::BP_LIKELY);
|
||||
bodysp = newIfAssertOn(ifp);
|
||||
|
@ -173,7 +173,7 @@ private:
|
|||
if (nodep->user1SetOnce()) return;
|
||||
if (nodep->uniquePragma() || nodep->unique0Pragma()) {
|
||||
AstNodeIf* ifp = nodep;
|
||||
AstNode* propp = NULL;
|
||||
AstNode* propp = nullptr;
|
||||
bool hasDefaultElse = false;
|
||||
do {
|
||||
// If this statement ends with 'else if', then nextIf will point to the
|
||||
|
@ -239,7 +239,7 @@ private:
|
|||
++m_statAsFull;
|
||||
if (!has_default) {
|
||||
nodep->addItemsp(new AstCaseItem(
|
||||
nodep->fileline(), NULL /*DEFAULT*/,
|
||||
nodep->fileline(), nullptr /*DEFAULT*/,
|
||||
newFireAssert(nodep, "synthesis full_case, but non-match found")));
|
||||
}
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ private:
|
|||
if (!has_default && !nodep->itemsp()) {
|
||||
// Not parallel, but harmlessly so.
|
||||
} else {
|
||||
AstNode* propp = NULL;
|
||||
AstNode* propp = nullptr;
|
||||
for (AstCaseItem* itemp = nodep->itemsp(); itemp;
|
||||
itemp = VN_CAST(itemp->nextp(), CaseItem)) {
|
||||
for (AstNode* icondp = itemp->condsp(); icondp; icondp = icondp->nextp()) {
|
||||
|
@ -287,7 +287,7 @@ private:
|
|||
nodep->fileline(), new AstLogNot(nodep->fileline(), ohot),
|
||||
newFireAssert(nodep,
|
||||
"synthesis parallel_case, but multiple matches found"),
|
||||
NULL);
|
||||
nullptr);
|
||||
ifp->branchPred(VBranchPred::BP_UNLIKELY);
|
||||
nodep->addNotParallelp(ifp);
|
||||
}
|
||||
|
@ -306,10 +306,11 @@ private:
|
|||
}
|
||||
UASSERT_OBJ(ticks >= 1, nodep, "0 tick should have been checked in V3Width");
|
||||
AstNode* inp = nodep->exprp()->unlinkFrBack();
|
||||
AstVar* invarp = NULL;
|
||||
AstVar* invarp = nullptr;
|
||||
AstSenTree* sentreep = nodep->sentreep();
|
||||
sentreep->unlinkFrBack();
|
||||
AstAlways* alwaysp = new AstAlways(nodep->fileline(), VAlwaysKwd::ALWAYS, sentreep, NULL);
|
||||
AstAlways* alwaysp
|
||||
= new AstAlways(nodep->fileline(), VAlwaysKwd::ALWAYS, sentreep, nullptr);
|
||||
m_modp->addStmtp(alwaysp);
|
||||
for (uint32_t i = 0; i < ticks; ++i) {
|
||||
AstVar* outvarp = new AstVar(nodep->fileline(), AstVarType::MODULETEMP,
|
||||
|
@ -350,7 +351,7 @@ private:
|
|||
}
|
||||
virtual void visit(AstCover* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
newPslAssertion(nodep, NULL);
|
||||
newPslAssertion(nodep, nullptr);
|
||||
}
|
||||
virtual void visit(AstRestrict* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
|
@ -385,8 +386,8 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit AssertVisitor(AstNetlist* nodep) {
|
||||
m_beginp = NULL;
|
||||
m_modp = NULL;
|
||||
m_beginp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_modPastNum = 0;
|
||||
// Process
|
||||
iterate(nodep);
|
||||
|
|
|
@ -45,20 +45,20 @@ private:
|
|||
|
||||
AstSenTree* newSenTree(AstNode* nodep) {
|
||||
// Create sentree based on clocked or default clock
|
||||
// Return NULL for always
|
||||
AstSenTree* newp = NULL;
|
||||
// Return nullptr for always
|
||||
AstSenTree* newp = nullptr;
|
||||
AstSenItem* senip = m_senip;
|
||||
if (!senip) senip = m_seniDefaultp;
|
||||
if (!senip) senip = m_seniAlwaysp;
|
||||
if (!senip) {
|
||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Unclocked assertion");
|
||||
newp = new AstSenTree(nodep->fileline(), NULL);
|
||||
newp = new AstSenTree(nodep->fileline(), nullptr);
|
||||
} else {
|
||||
newp = new AstSenTree(nodep->fileline(), senip->cloneTree(true));
|
||||
}
|
||||
return newp;
|
||||
}
|
||||
void clearAssertInfo() { m_senip = NULL; }
|
||||
void clearAssertInfo() { m_senip = nullptr; }
|
||||
|
||||
// VISITORS
|
||||
//========== Statements
|
||||
|
@ -78,7 +78,7 @@ private:
|
|||
iterateAndNextNull(nodep->sensesp());
|
||||
if (nodep->sensesp()) m_seniAlwaysp = nodep->sensesp()->sensesp();
|
||||
iterateAndNextNull(nodep->bodysp());
|
||||
m_seniAlwaysp = NULL;
|
||||
m_seniAlwaysp = nullptr;
|
||||
}
|
||||
|
||||
virtual void visit(AstNodeCoverOrAssert* nodep) override {
|
||||
|
@ -95,7 +95,7 @@ private:
|
|||
FileLine* fl = nodep->fileline();
|
||||
AstNode* exprp = nodep->exprp()->unlinkFrBack();
|
||||
if (exprp->width() > 1) exprp = new AstSel(fl, exprp, 0, 1);
|
||||
AstNode* past = new AstPast(fl, exprp, NULL);
|
||||
AstNode* past = new AstPast(fl, exprp, nullptr);
|
||||
past->dtypeFrom(exprp);
|
||||
exprp = new AstAnd(fl, past, new AstNot(fl, exprp->cloneTree(false)));
|
||||
exprp->dtypeSetLogicBool();
|
||||
|
@ -114,7 +114,7 @@ private:
|
|||
FileLine* fl = nodep->fileline();
|
||||
AstNode* exprp = nodep->exprp()->unlinkFrBack();
|
||||
if (exprp->width() > 1) exprp = new AstSel(fl, exprp, 0, 1);
|
||||
AstNode* past = new AstPast(fl, exprp, NULL);
|
||||
AstNode* past = new AstPast(fl, exprp, nullptr);
|
||||
past->dtypeFrom(exprp);
|
||||
exprp = new AstAnd(fl, new AstNot(fl, past), exprp->cloneTree(false));
|
||||
exprp->dtypeSetLogicBool();
|
||||
|
@ -127,7 +127,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
FileLine* fl = nodep->fileline();
|
||||
AstNode* exprp = nodep->exprp()->unlinkFrBack();
|
||||
AstNode* past = new AstPast(fl, exprp, NULL);
|
||||
AstNode* past = new AstPast(fl, exprp, nullptr);
|
||||
past->dtypeFrom(exprp);
|
||||
exprp = new AstEq(fl, past,
|
||||
exprp->cloneTree(false)); // new AstVarRef(fl, exprp, true)
|
||||
|
@ -163,15 +163,15 @@ private:
|
|||
virtual void visit(AstNodeModule* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
// Reset defaults
|
||||
m_seniDefaultp = NULL;
|
||||
m_seniDefaultp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNode* nodep) override { iterateChildren(nodep); }
|
||||
|
||||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit AssertPreVisitor(AstNetlist* nodep) {
|
||||
m_seniDefaultp = NULL;
|
||||
m_seniAlwaysp = NULL;
|
||||
m_seniDefaultp = nullptr;
|
||||
m_seniAlwaysp = nullptr;
|
||||
clearAssertInfo();
|
||||
// Process
|
||||
iterate(nodep);
|
||||
|
|
|
@ -60,17 +60,17 @@ std::ostream& operator<<(std::ostream& os, AstType rhs);
|
|||
|
||||
void AstNode::init() {
|
||||
editCountInc();
|
||||
m_fileline = NULL;
|
||||
m_nextp = NULL;
|
||||
m_backp = NULL;
|
||||
m_fileline = nullptr;
|
||||
m_nextp = nullptr;
|
||||
m_backp = nullptr;
|
||||
m_headtailp = this; // When made, we're a list of only a single element
|
||||
m_op1p = NULL;
|
||||
m_op2p = NULL;
|
||||
m_op3p = NULL;
|
||||
m_op4p = NULL;
|
||||
m_iterpp = NULL;
|
||||
m_dtypep = NULL;
|
||||
m_clonep = NULL;
|
||||
m_op1p = nullptr;
|
||||
m_op2p = nullptr;
|
||||
m_op3p = nullptr;
|
||||
m_op4p = nullptr;
|
||||
m_iterpp = nullptr;
|
||||
m_dtypep = nullptr;
|
||||
m_clonep = nullptr;
|
||||
m_cloneCnt = 0;
|
||||
// Attributes
|
||||
m_didWidth = false;
|
||||
|
@ -275,8 +275,8 @@ AstNode* AstNode::addNext(AstNode* nodep, AstNode* newp) {
|
|||
// New tail needs the head
|
||||
AstNode* newtailp = newp->m_headtailp;
|
||||
AstNode* headp = oldtailp->m_headtailp;
|
||||
oldtailp->m_headtailp = NULL; // May be written again as new head
|
||||
newp->m_headtailp = NULL; // May be written again as new tail
|
||||
oldtailp->m_headtailp = nullptr; // May be written again as new head
|
||||
newp->m_headtailp = nullptr; // May be written again as new tail
|
||||
newtailp->m_headtailp = headp;
|
||||
headp->m_headtailp = newtailp;
|
||||
newp->editCountInc();
|
||||
|
@ -321,17 +321,17 @@ void AstNode::addNextHere(AstNode* newp) {
|
|||
// tail (oldheadtailp && !oldnextp) // this was tail of list, might also
|
||||
// be head of one-node list
|
||||
//
|
||||
newp->m_headtailp = NULL; // Not at head any longer
|
||||
addlastp->m_headtailp = NULL; // Presume middle of list
|
||||
newp->m_headtailp = nullptr; // Not at head any longer
|
||||
addlastp->m_headtailp = nullptr; // Presume middle of list
|
||||
// newp might happen to be head/tail after all, if so will be set again below
|
||||
if (oldheadtailp) { // else in middle of list, no change
|
||||
if (oldheadtailp == this) { // this was one node
|
||||
this->m_headtailp = addlastp; // Was head/tail, now a tail
|
||||
addlastp->m_headtailp = oldheadtailp; // Tail needs to remember head (or NULL)
|
||||
addlastp->m_headtailp = oldheadtailp; // Tail needs to remember head (or nullptr)
|
||||
} else if (!oldnextp) { // this was tail
|
||||
this->m_headtailp = NULL; // No longer a tail
|
||||
this->m_headtailp = nullptr; // No longer a tail
|
||||
oldheadtailp->m_headtailp = addlastp; // Head gets new tail
|
||||
addlastp->m_headtailp = oldheadtailp; // Tail needs to remember head (or NULL)
|
||||
addlastp->m_headtailp = oldheadtailp; // Tail needs to remember head (or nullptr)
|
||||
} // else is head, and we're inserting into the middle, so no other change
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ AstNode* AstNode::unlinkFrBackWithNext(AstNRelinker* linkerp) {
|
|||
}
|
||||
}
|
||||
if (backp->m_nextp == oldp) {
|
||||
backp->m_nextp = NULL;
|
||||
backp->m_nextp = nullptr;
|
||||
// Old list gets truncated
|
||||
// New list becomes a list upon itself
|
||||
// Most common case is unlinking a entire operand tree
|
||||
|
@ -486,21 +486,21 @@ AstNode* AstNode::unlinkFrBackWithNext(AstNRelinker* linkerp) {
|
|||
oldp->m_headtailp = oldtailp;
|
||||
oldp->m_headtailp->m_headtailp = oldp;
|
||||
} else if (backp->m_op1p == oldp) {
|
||||
backp->m_op1p = NULL;
|
||||
backp->m_op1p = nullptr;
|
||||
} else if (backp->m_op2p == oldp) {
|
||||
backp->m_op2p = NULL;
|
||||
backp->m_op2p = nullptr;
|
||||
} else if (backp->m_op3p == oldp) {
|
||||
backp->m_op3p = NULL;
|
||||
backp->m_op3p = nullptr;
|
||||
} else if (backp->m_op4p == oldp) {
|
||||
backp->m_op4p = NULL;
|
||||
backp->m_op4p = nullptr;
|
||||
} else {
|
||||
this->v3fatalSrc("Unlink of node with back not pointing to it.");
|
||||
}
|
||||
// Relink
|
||||
oldp->m_backp = NULL;
|
||||
oldp->m_backp = nullptr;
|
||||
// Iterator fixup
|
||||
if (oldp->m_iterpp) *(oldp->m_iterpp) = NULL;
|
||||
oldp->m_iterpp = NULL;
|
||||
if (oldp->m_iterpp) *(oldp->m_iterpp) = nullptr;
|
||||
oldp->m_iterpp = nullptr;
|
||||
oldp->debugTreeChange("-unlinkWNextOut: ", __LINE__, true);
|
||||
return oldp;
|
||||
}
|
||||
|
@ -561,10 +561,10 @@ AstNode* AstNode::unlinkFrBack(AstNRelinker* linkerp) {
|
|||
// Iterator fixup
|
||||
if (oldp->m_iterpp) *(oldp->m_iterpp) = oldp->m_nextp;
|
||||
// Relink
|
||||
oldp->m_nextp = NULL;
|
||||
oldp->m_backp = NULL;
|
||||
oldp->m_nextp = nullptr;
|
||||
oldp->m_backp = nullptr;
|
||||
oldp->m_headtailp = this;
|
||||
oldp->m_iterpp = NULL;
|
||||
oldp->m_iterpp = nullptr;
|
||||
oldp->debugTreeChange("-unlinkFrBkOut: ", __LINE__, true);
|
||||
return oldp;
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ void AstNode::relink(AstNRelinker* linkerp) {
|
|||
}
|
||||
// Relink
|
||||
newp->m_backp = backp;
|
||||
linkerp->m_backp = NULL;
|
||||
linkerp->m_backp = nullptr;
|
||||
// Iterator fixup
|
||||
if (linkerp->m_iterpp) {
|
||||
// If we're iterating over a next() link, we need to follow links off the
|
||||
|
@ -610,7 +610,7 @@ void AstNode::relink(AstNRelinker* linkerp) {
|
|||
newp->m_iterpp = linkerp->m_iterpp;
|
||||
}
|
||||
// Empty the linker so not used twice accidentally
|
||||
linkerp->m_backp = NULL;
|
||||
linkerp->m_backp = nullptr;
|
||||
this->debugTreeChange("-relinkOut: ", __LINE__, true);
|
||||
}
|
||||
|
||||
|
@ -633,8 +633,8 @@ void AstNode::relinkOneLink(AstNode*& pointpr, // Ref to pointer that gets set
|
|||
newlistlastp->m_nextp = pointpr;
|
||||
pointpr->m_backp = newlistlastp;
|
||||
// Head/tail
|
||||
pointpr->m_headtailp = NULL; // Old head
|
||||
newlistlastp->m_headtailp = NULL; // Old tail
|
||||
pointpr->m_headtailp = nullptr; // Old head
|
||||
newlistlastp->m_headtailp = nullptr; // Old tail
|
||||
newp->m_headtailp = oldlistlastp; // Head points to tail
|
||||
oldlistlastp->m_headtailp = newp; // Tail points to head
|
||||
}
|
||||
|
@ -668,7 +668,7 @@ AstNode* AstNode::cloneTreeIter() {
|
|||
if (this->m_op2p) newp->op2p(this->m_op2p->cloneTreeIterList());
|
||||
if (this->m_op3p) newp->op3p(this->m_op3p->cloneTreeIterList());
|
||||
if (this->m_op4p) newp->op4p(this->m_op4p->cloneTreeIterList());
|
||||
newp->m_iterpp = NULL;
|
||||
newp->m_iterpp = nullptr;
|
||||
newp->clonep(this); // Save pointers to/from both to simplify relinking.
|
||||
this->clonep(newp); // Save pointers to/from both to simplify relinking.
|
||||
return newp;
|
||||
|
@ -676,12 +676,12 @@ AstNode* AstNode::cloneTreeIter() {
|
|||
|
||||
AstNode* AstNode::cloneTreeIterList() {
|
||||
// private: Clone list of nodes, set m_headtailp
|
||||
AstNode* newheadp = NULL;
|
||||
AstNode* newtailp = NULL;
|
||||
// Audited to make sure this is never NULL
|
||||
AstNode* newheadp = nullptr;
|
||||
AstNode* newtailp = nullptr;
|
||||
// Audited to make sure this is never nullptr
|
||||
for (AstNode* oldp = this; oldp; oldp = oldp->m_nextp) {
|
||||
AstNode* newp = oldp->cloneTreeIter();
|
||||
newp->m_headtailp = NULL;
|
||||
newp->m_headtailp = nullptr;
|
||||
newp->m_backp = newtailp;
|
||||
if (newtailp) newtailp->m_nextp = newp;
|
||||
if (!newheadp) newheadp = newp;
|
||||
|
@ -700,10 +700,10 @@ AstNode* AstNode::cloneTree(bool cloneNextLink) {
|
|||
newp = cloneTreeIterList();
|
||||
} else {
|
||||
newp = cloneTreeIter();
|
||||
newp->m_nextp = NULL;
|
||||
newp->m_nextp = nullptr;
|
||||
newp->m_headtailp = newp;
|
||||
}
|
||||
newp->m_backp = NULL;
|
||||
newp->m_backp = nullptr;
|
||||
newp->cloneRelinkTree();
|
||||
newp->debugTreeChange("-cloneOut: ", __LINE__, true);
|
||||
return newp;
|
||||
|
@ -739,7 +739,7 @@ void AstNode::deleteNode() {
|
|||
|
||||
void AstNode::deleteTreeIter() {
|
||||
// private: Delete list of nodes. Publicly call deleteTree() instead.
|
||||
// Audited to make sure this is never NULL
|
||||
// Audited to make sure this is never nullptr
|
||||
for (AstNode *nodep = this, *nnextp; nodep; nodep = nnextp) {
|
||||
nnextp = nodep->m_nextp;
|
||||
// MUST be depth first!
|
||||
|
@ -747,8 +747,8 @@ void AstNode::deleteTreeIter() {
|
|||
if (nodep->m_op2p) nodep->m_op2p->deleteTreeIter();
|
||||
if (nodep->m_op3p) nodep->m_op3p->deleteTreeIter();
|
||||
if (nodep->m_op4p) nodep->m_op4p->deleteTreeIter();
|
||||
nodep->m_nextp = NULL;
|
||||
nodep->m_backp = NULL;
|
||||
nodep->m_nextp = nullptr;
|
||||
nodep->m_backp = nullptr;
|
||||
nodep->deleteNode();
|
||||
}
|
||||
}
|
||||
|
@ -831,11 +831,11 @@ void AstNode::iterateAndNext(AstNVisitor& v) {
|
|||
niterp->m_iterpp = &niterp;
|
||||
niterp->accept(v);
|
||||
// accept may do a replaceNode and change niterp on us...
|
||||
// niterp maybe NULL, so need cast if printing
|
||||
// niterp maybe nullptr, so need cast if printing
|
||||
// if (niterp != nodep) UINFO(1,"iterateAndNext edited "<<cvtToHex(nodep)
|
||||
// <<" now into "<<cvtToHex(niterp)<<endl);
|
||||
if (!niterp) return; // Perhaps node deleted inside accept
|
||||
niterp->m_iterpp = NULL;
|
||||
niterp->m_iterpp = nullptr;
|
||||
if (VL_UNLIKELY(niterp != nodep)) { // Edited node inside accept
|
||||
nodep = niterp;
|
||||
} else { // Unchanged node, just continue loop
|
||||
|
@ -853,7 +853,7 @@ void AstNode::iterateListBackwards(AstNVisitor& v) {
|
|||
if (nodep->backp()->m_nextp == nodep) {
|
||||
nodep = nodep->backp();
|
||||
} else {
|
||||
nodep = NULL;
|
||||
nodep = nullptr;
|
||||
} // else: backp points up the tree.
|
||||
}
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ AstNode* AstNode::iterateSubtreeReturnEdits(AstNVisitor& v) {
|
|||
} else {
|
||||
// Use back to determine who's pointing at us (IE assume new node
|
||||
// grafts into same place as old one)
|
||||
AstNode** nextnodepp = NULL;
|
||||
AstNode** nextnodepp = nullptr;
|
||||
if (this->m_backp->m_op1p == this) {
|
||||
nextnodepp = &(this->m_backp->m_op1p);
|
||||
} else if (this->m_backp->m_op2p == this) {
|
||||
|
@ -999,7 +999,7 @@ void AstNode::checkTreeIter(AstNode* backp) {
|
|||
|
||||
void AstNode::checkTreeIterList(AstNode* backp) {
|
||||
// private: Check a (possible) list of nodes, this is always the head of the list
|
||||
// Audited to make sure this is never NULL
|
||||
// Audited to make sure this is never nullptr
|
||||
AstNode* headp = this;
|
||||
AstNode* tailp = this;
|
||||
for (AstNode* nodep = headp; nodep; nodep = nodep->nextp()) {
|
||||
|
@ -1052,7 +1052,7 @@ void AstNode::checkIter() const {
|
|||
if (m_iterpp) {
|
||||
dumpPtrs(cout);
|
||||
// Perhaps something forgot to clear m_iterpp?
|
||||
this->v3fatalSrc("Iteration link should be NULL");
|
||||
this->v3fatalSrc("Iteration link should be nullptr");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ void AstNode::dumpTree(std::ostream& os, const string& indent, int maxDepth) con
|
|||
}
|
||||
|
||||
void AstNode::dumpTreeAndNext(std::ostream& os, const string& indent, int maxDepth) const {
|
||||
// Audited to make sure this is never NULL
|
||||
// Audited to make sure this is never nullptr
|
||||
for (const AstNode* nodep = this; nodep; nodep = nodep->nextp()) {
|
||||
nodep->dumpTree(os, indent, maxDepth);
|
||||
}
|
||||
|
|
89
src/V3Ast.h
89
src/V3Ast.h
|
@ -1242,9 +1242,9 @@ public:
|
|||
void iterateChildrenBackwards(AstNode* nodep);
|
||||
/// Call visit()s on const nodep's children
|
||||
void iterateChildrenConst(AstNode* nodep);
|
||||
/// Call visit()s on nodep (maybe NULL) and nodep's nextp() list
|
||||
/// Call visit()s on nodep (maybe nullptr) and nodep's nextp() list
|
||||
void iterateAndNextNull(AstNode* nodep);
|
||||
/// Call visit()s on const nodep (maybe NULL) and nodep's nextp() list
|
||||
/// Call visit()s on const nodep (maybe nullptr) and nodep's nextp() list
|
||||
void iterateAndNextConstNull(AstNode* nodep);
|
||||
/// Return edited nodep; see comments in V3Ast.cpp
|
||||
AstNode* iterateSubtreeReturnEdits(AstNode* nodep);
|
||||
|
@ -1270,10 +1270,10 @@ protected:
|
|||
|
||||
public:
|
||||
AstNRelinker() {
|
||||
m_oldp = NULL;
|
||||
m_backp = NULL;
|
||||
m_oldp = nullptr;
|
||||
m_backp = nullptr;
|
||||
m_chg = RELINK_BAD;
|
||||
m_iterpp = NULL;
|
||||
m_iterpp = nullptr;
|
||||
}
|
||||
void relink(AstNode* newp);
|
||||
AstNode* oldp() const { return m_oldp; }
|
||||
|
@ -1498,9 +1498,9 @@ public:
|
|||
AstNode* op3p() const { return m_op3p; }
|
||||
AstNode* op4p() const { return m_op4p; }
|
||||
AstNodeDType* dtypep() const { return m_dtypep; }
|
||||
AstNode* clonep() const { return ((m_cloneCnt == s_cloneCntGbl) ? m_clonep : NULL); }
|
||||
AstNode* firstAbovep() const { // Returns NULL when second or later in list
|
||||
return ((backp() && backp()->nextp() != this) ? backp() : NULL);
|
||||
AstNode* clonep() const { return ((m_cloneCnt == s_cloneCntGbl) ? m_clonep : nullptr); }
|
||||
AstNode* firstAbovep() const { // Returns nullptr when second or later in list
|
||||
return ((backp() && backp()->nextp() != this) ? backp() : nullptr);
|
||||
}
|
||||
bool brokeExists() const;
|
||||
bool brokeExistsAbove() const;
|
||||
|
@ -1664,7 +1664,7 @@ public:
|
|||
static void editCountSetLast() { s_editCntLast = editCountGbl(); }
|
||||
|
||||
// ACCESSORS for specific types
|
||||
// Alas these can't be virtual or they break when passed a NULL
|
||||
// Alas these can't be virtual or they break when passed a nullptr
|
||||
bool isZero() const;
|
||||
bool isOne() const;
|
||||
bool isNeqZero() const;
|
||||
|
@ -1735,7 +1735,7 @@ public:
|
|||
// METHODS - Tree modifications
|
||||
// Returns nodep, adds newp to end of nodep's list
|
||||
static AstNode* addNext(AstNode* nodep, AstNode* newp);
|
||||
// Returns nodep, adds newp (maybe NULL) to end of nodep's list
|
||||
// Returns nodep, adds newp (maybe nullptr) to end of nodep's list
|
||||
static AstNode* addNextNull(AstNode* nodep, AstNode* newp);
|
||||
inline AstNode* addNext(AstNode* newp) { return addNext(this, newp); }
|
||||
inline AstNode* addNextNull(AstNode* newp) { return addNextNull(this, newp); }
|
||||
|
@ -1746,9 +1746,10 @@ public:
|
|||
}
|
||||
void addHereThisAsNext(AstNode* newp); // Adds at old place of this, this becomes next
|
||||
void replaceWith(AstNode* newp); // Replace current node in tree with new node
|
||||
AstNode* unlinkFrBack(AstNRelinker* linkerp = NULL); // Unlink this from whoever points to it.
|
||||
AstNode* unlinkFrBack(AstNRelinker* linkerp
|
||||
= nullptr); // Unlink this from whoever points to it.
|
||||
// Unlink this from whoever points to it, keep entire next list with unlinked node
|
||||
AstNode* unlinkFrBackWithNext(AstNRelinker* linkerp = NULL);
|
||||
AstNode* unlinkFrBackWithNext(AstNRelinker* linkerp = nullptr);
|
||||
void swapWith(AstNode* bp);
|
||||
void relink(AstNRelinker* linkerp); // Generally use linker->relink() instead
|
||||
void cloneRelinkNode() { cloneRelink(); }
|
||||
|
@ -1759,9 +1760,9 @@ public:
|
|||
AstNode* belowp); // When calling, "this" is second argument
|
||||
|
||||
// METHODS - Iterate on a tree
|
||||
// Clone or return NULL if NULL
|
||||
// Clone or return nullptr if nullptr
|
||||
static AstNode* cloneTreeNull(AstNode* nodep, bool cloneNextLink) {
|
||||
return nodep ? nodep->cloneTree(cloneNextLink) : NULL;
|
||||
return nodep ? nodep->cloneTree(cloneNextLink) : nullptr;
|
||||
}
|
||||
AstNode* cloneTree(bool cloneNextLink); // Not const, as sets clonep() on original nodep
|
||||
bool gateTree() { return gateTreeIter(); } // Is tree isGateOptimizable?
|
||||
|
@ -1771,7 +1772,7 @@ public:
|
|||
void deleteTree(); // Always deletes the next link
|
||||
void checkTree(); // User Interface version
|
||||
void checkIter() const;
|
||||
void clearIter() { m_iterpp = NULL; }
|
||||
void clearIter() { m_iterpp = nullptr; }
|
||||
void dumpPtrs(std::ostream& os = std::cout) const;
|
||||
void dumpTree(std::ostream& os = std::cout, const string& indent = " ",
|
||||
int maxDepth = 0) const;
|
||||
|
@ -1782,7 +1783,7 @@ public:
|
|||
void dumpTreeAndNext(std::ostream& os = std::cout, const string& indent = " ",
|
||||
int maxDepth = 0) const;
|
||||
void dumpTreeFile(const string& filename, bool append = false, bool doDump = true);
|
||||
static void dumpTreeFileGdb(const char* filenamep = NULL);
|
||||
static void dumpTreeFileGdb(const char* filenamep = nullptr);
|
||||
|
||||
// METHODS - queries
|
||||
// Changes control flow, disable some optimizations
|
||||
|
@ -1812,12 +1813,12 @@ public:
|
|||
// Iff has a data type; dtype() must be non null
|
||||
virtual bool hasDType() const { return false; }
|
||||
// Iff has a non-null childDTypep(), as generic node function
|
||||
virtual AstNodeDType* getChildDTypep() const { return NULL; }
|
||||
virtual AstNodeDType* getChildDTypep() const { return nullptr; }
|
||||
// Iff has a non-null child2DTypep(), as generic node function
|
||||
virtual AstNodeDType* getChild2DTypep() const { return NULL; }
|
||||
virtual AstNodeDType* getChild2DTypep() const { return nullptr; }
|
||||
// Another AstNode* may have a pointer into this node, other then normal front/back/etc.
|
||||
virtual bool maybePointedTo() const { return false; }
|
||||
virtual const char* broken() const { return NULL; }
|
||||
virtual const char* broken() const { return nullptr; }
|
||||
|
||||
// INVOKERS
|
||||
virtual void accept(AstNVisitor& v) = 0;
|
||||
|
@ -1858,7 +1859,7 @@ public:
|
|||
|
||||
inline std::ostream& operator<<(std::ostream& os, const AstNode* rhs) {
|
||||
if (!rhs) {
|
||||
os << "NULL";
|
||||
os << "nullptr";
|
||||
} else {
|
||||
rhs->dump(os);
|
||||
}
|
||||
|
@ -1873,7 +1874,7 @@ inline void AstNRelinker::relink(AstNode* newp) { newp->AstNode::relink(this); }
|
|||
#define ASTNODE_BASE_FUNCS(name) \
|
||||
virtual ~Ast##name() {} \
|
||||
static Ast##name* cloneTreeNull(Ast##name* nodep, bool cloneNextLink) { \
|
||||
return nodep ? nodep->cloneTree(cloneNextLink) : NULL; \
|
||||
return nodep ? nodep->cloneTree(cloneNextLink) : nullptr; \
|
||||
} \
|
||||
Ast##name* cloneTree(bool cloneNext) { \
|
||||
return static_cast<Ast##name*>(AstNode::cloneTree(cloneNext)); \
|
||||
|
@ -2263,20 +2264,20 @@ public:
|
|||
AstNodeVarRef(AstType t, FileLine* fl, const string& name, bool lvalue)
|
||||
: AstNodeMath(t, fl)
|
||||
, m_lvalue(lvalue)
|
||||
, m_varScopep(NULL)
|
||||
, m_packagep(NULL)
|
||||
, m_varScopep(nullptr)
|
||||
, m_packagep(nullptr)
|
||||
, m_name(name)
|
||||
, m_hierThis(false) {
|
||||
this->varp(NULL);
|
||||
this->varp(nullptr);
|
||||
}
|
||||
AstNodeVarRef(AstType t, FileLine* fl, const string& name, AstVar* varp, bool lvalue)
|
||||
: AstNodeMath(t, fl)
|
||||
, m_lvalue(lvalue)
|
||||
, m_varScopep(NULL)
|
||||
, m_packagep(NULL)
|
||||
, m_varScopep(nullptr)
|
||||
, m_packagep(nullptr)
|
||||
, m_name(name)
|
||||
, m_hierThis(false) {
|
||||
// May have varp==NULL
|
||||
// May have varp==nullptr
|
||||
this->varp(varp);
|
||||
}
|
||||
ASTNODE_BASE_FUNCS(NodeVarRef)
|
||||
|
@ -2364,17 +2365,17 @@ public:
|
|||
virtual int widthTotalBytes() const = 0;
|
||||
virtual bool maybePointedTo() const { return true; }
|
||||
// Iff has a non-null refDTypep(), as generic node function
|
||||
virtual AstNodeDType* virtRefDTypep() const { return NULL; }
|
||||
virtual AstNodeDType* virtRefDTypep() const { return nullptr; }
|
||||
// Iff has refDTypep(), set as generic node function
|
||||
virtual void virtRefDTypep(AstNodeDType* nodep) {}
|
||||
// Iff has a non-null second dtypep, as generic node function
|
||||
virtual AstNodeDType* virtRefDType2p() const { return NULL; }
|
||||
virtual AstNodeDType* virtRefDType2p() const { return nullptr; }
|
||||
// Iff has second dtype, set as generic node function
|
||||
virtual void virtRefDType2p(AstNodeDType* nodep) {}
|
||||
// Assignable equivalence. Call skipRefp() on this and samep before calling
|
||||
virtual bool similarDType(AstNodeDType* samep) const = 0;
|
||||
// Iff has a non-null subDTypep(), as generic node function
|
||||
virtual AstNodeDType* subDTypep() const { return NULL; }
|
||||
virtual AstNodeDType* subDTypep() const { return nullptr; }
|
||||
virtual bool isFourstate() const;
|
||||
// Ideally an IEEE $typename
|
||||
virtual string prettyDTypeName() const { return prettyTypeName(); }
|
||||
|
@ -2473,7 +2474,7 @@ public:
|
|||
void repairMemberCache();
|
||||
AstMemberDType* findMember(const string& name) const {
|
||||
MemberNameMap::const_iterator it = m_members.find(name);
|
||||
return (it == m_members.end()) ? NULL : it->second;
|
||||
return (it == m_members.end()) ? nullptr : it->second;
|
||||
}
|
||||
static int lsb() { return 0; }
|
||||
int msb() const { return dtypep()->width() - 1; } // Packed classes look like arrays
|
||||
|
@ -2490,7 +2491,7 @@ private:
|
|||
public:
|
||||
AstNodeArrayDType(AstType t, FileLine* fl)
|
||||
: AstNodeDType(t, fl) {
|
||||
m_refDTypep = NULL;
|
||||
m_refDTypep = nullptr;
|
||||
}
|
||||
ASTNODE_BASE_FUNCS(NodeArrayDType)
|
||||
virtual void dump(std::ostream& str) const;
|
||||
|
@ -2498,7 +2499,7 @@ public:
|
|||
virtual const char* broken() const {
|
||||
BROKEN_RTN(!((m_refDTypep && !childDTypep() && m_refDTypep->brokeExists())
|
||||
|| (!m_refDTypep && childDTypep())));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
virtual void cloneRelink() {
|
||||
if (m_refDTypep && m_refDTypep->clonep()) { m_refDTypep = m_refDTypep->clonep(); }
|
||||
|
@ -2549,7 +2550,9 @@ public:
|
|||
AstNodeSel(AstType t, FileLine* fl, AstNode* fromp, AstNode* bitp)
|
||||
: AstNodeBiop(t, fl, fromp, bitp) {}
|
||||
ASTNODE_BASE_FUNCS(NodeSel)
|
||||
AstNode* fromp() const { return op1p(); } // op1 = Extracting what (NULL=TBD during parsing)
|
||||
AstNode* fromp() const {
|
||||
return op1p();
|
||||
} // op1 = Extracting what (nullptr=TBD during parsing)
|
||||
void fromp(AstNode* nodep) { setOp1p(nodep); }
|
||||
AstNode* bitp() const { return op2p(); } // op2 = Msb selection expression
|
||||
void bitp(AstNode* nodep) { setOp2p(nodep); }
|
||||
|
@ -2578,7 +2581,7 @@ class AstNodeCCall : public AstNodeStmt {
|
|||
string m_argTypes;
|
||||
|
||||
public:
|
||||
AstNodeCCall(AstType t, FileLine* fl, AstCFunc* funcp, AstNode* argsp = NULL)
|
||||
AstNodeCCall(AstType t, FileLine* fl, AstCFunc* funcp, AstNode* argsp = nullptr)
|
||||
: AstNodeStmt(t, fl, true)
|
||||
, m_funcp(funcp) {
|
||||
addNOp2p(argsp);
|
||||
|
@ -2670,10 +2673,10 @@ public:
|
|||
virtual void name(const string& name) { m_name = name; }
|
||||
string cname() const { return m_cname; }
|
||||
void cname(const string& cname) { m_cname = cname; }
|
||||
// op1 = Output variable (functions only, NULL for tasks)
|
||||
// op1 = Output variable (functions only, nullptr for tasks)
|
||||
AstNode* fvarp() const { return op1p(); }
|
||||
void addFvarp(AstNode* nodep) { addNOp1p(nodep); }
|
||||
bool isFunction() const { return fvarp() != NULL; }
|
||||
bool isFunction() const { return fvarp() != nullptr; }
|
||||
// op3 = Statements/Ports/Vars
|
||||
AstNode* stmtsp() const { return op3p(); } // op3 = List of statements
|
||||
void addStmtsp(AstNode* nodep) { addNOp3p(nodep); }
|
||||
|
@ -2729,24 +2732,24 @@ private:
|
|||
public:
|
||||
AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, AstNode* namep, AstNode* pinsp)
|
||||
: AstNodeStmt(t, fl, statement)
|
||||
, m_taskp(NULL)
|
||||
, m_packagep(NULL)
|
||||
, m_taskp(nullptr)
|
||||
, m_packagep(nullptr)
|
||||
, m_pli(false) {
|
||||
setOp1p(namep);
|
||||
addNOp3p(pinsp);
|
||||
}
|
||||
AstNodeFTaskRef(AstType t, FileLine* fl, bool statement, const string& name, AstNode* pinsp)
|
||||
: AstNodeStmt(t, fl, statement)
|
||||
, m_taskp(NULL)
|
||||
, m_taskp(nullptr)
|
||||
, m_name(name)
|
||||
, m_packagep(NULL)
|
||||
, m_packagep(nullptr)
|
||||
, m_pli(false) {
|
||||
addNOp3p(pinsp);
|
||||
}
|
||||
ASTNODE_BASE_FUNCS(NodeFTaskRef)
|
||||
virtual const char* broken() const {
|
||||
BROKEN_RTN(m_taskp && !m_taskp->brokeExists());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
virtual void cloneRelink() {
|
||||
if (m_taskp && m_taskp->clonep()) { m_taskp = m_taskp->clonep(); }
|
||||
|
@ -2792,7 +2795,7 @@ private:
|
|||
bool m_hierBlock : 1; // Hiearchical Block marked by HIER_BLOCK pragma
|
||||
bool m_internal : 1; // Internally created
|
||||
bool m_recursive : 1; // Recursive module
|
||||
bool m_recursiveClone : 1; // If recursive, what module it clones, otherwise NULL
|
||||
bool m_recursiveClone : 1; // If recursive, what module it clones, otherwise nullptr
|
||||
int m_level; // 1=top module, 2=cell off top module, ...
|
||||
int m_varNum; // Incrementing variable number
|
||||
int m_typeNum; // Incrementing implicit type number
|
||||
|
|
|
@ -36,7 +36,7 @@ const char* AstIfaceRefDType::broken() const {
|
|||
BROKEN_RTN(m_ifacep && !m_ifacep->brokeExists());
|
||||
BROKEN_RTN(m_cellp && !m_cellp->brokeExists());
|
||||
BROKEN_RTN(m_modportp && !m_modportp->brokeExists());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AstIface* AstIfaceRefDType::ifaceViaCellp() const {
|
||||
|
@ -46,7 +46,7 @@ AstIface* AstIfaceRefDType::ifaceViaCellp() const {
|
|||
const char* AstNodeVarRef::broken() const {
|
||||
BROKEN_RTN(m_varScopep && !m_varScopep->brokeExists());
|
||||
BROKEN_RTN(m_varp && !m_varp->brokeExists());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AstNodeVarRef::cloneRelink() {
|
||||
|
@ -84,7 +84,7 @@ const char* AstNodeUOrStructDType::broken() const {
|
|||
return "member broken";
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AstNodeCCall::dump(std::ostream& str) const {
|
||||
|
@ -101,7 +101,7 @@ void AstNodeCCall::cloneRelink() {
|
|||
}
|
||||
const char* AstNodeCCall::broken() const {
|
||||
BROKEN_RTN(m_funcp && !m_funcp->brokeExists());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
bool AstNodeCCall::isPure() const { return funcp()->pure(); }
|
||||
string AstNodeCCall::hiernameProtect() const {
|
||||
|
@ -253,7 +253,7 @@ AstConst* AstConst::parseParamLiteral(FileLine* fl, const string& literal) {
|
|||
return new AstConst(fl, AstConst::StringToParse(), literal.c_str());
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AstNetlist::timeprecisionMerge(FileLine*, const VTimescale& value) {
|
||||
|
@ -604,13 +604,13 @@ AstVar* AstVar::scVarRecurse(AstNode* nodep) {
|
|||
if (anodep->isSc()) {
|
||||
return anodep;
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
} else if (VN_IS(nodep, VarRef)) {
|
||||
if (VN_CAST(nodep, VarRef)->varp()->isSc()) {
|
||||
return VN_CAST(nodep, VarRef)->varp();
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
} else if (VN_IS(nodep, ArraySel)) {
|
||||
if (nodep->op1p()) {
|
||||
|
@ -626,7 +626,7 @@ AstVar* AstVar::scVarRecurse(AstNode* nodep) {
|
|||
if (AstVar* p = scVarRecurse(nodep->op4p())) return p;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
string AstVar::mtasksString() const {
|
||||
|
@ -664,17 +664,17 @@ AstNodeDType* AstNodeDType::dtypeDimensionp(int dimension) {
|
|||
if (adtypep->isRanged()) {
|
||||
if ((dim++) == dimension) return adtypep;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} else if (AstNodeUOrStructDType* adtypep = VN_CAST(dtypep, NodeUOrStructDType)) {
|
||||
if (adtypep->packed()) {
|
||||
if ((dim++) == dimension) return adtypep;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// Node no ->next in loop; use continue where necessary
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32_t AstNodeDType::arrayUnpackedElements() {
|
||||
|
@ -761,7 +761,7 @@ AstNode* AstArraySel::baseFromp(AstNode* nodep) {
|
|||
|
||||
const char* AstJumpBlock::broken() const {
|
||||
BROKEN_RTN(!labelp()->brokeExistsBelow());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void AstJumpBlock::cloneRelink() {
|
||||
if (m_labelp->clonep()) m_labelp = m_labelp->clonep();
|
||||
|
@ -772,7 +772,7 @@ const char* AstScope::broken() const {
|
|||
BROKEN_RTN(m_aboveCellp && !m_aboveCellp->brokeExists());
|
||||
BROKEN_RTN(!m_modp);
|
||||
BROKEN_RTN(m_modp && !m_modp->brokeExists());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void AstScope::cloneRelink() {
|
||||
if (m_aboveScopep && m_aboveScopep->clonep()) m_aboveScopep->clonep();
|
||||
|
@ -846,7 +846,7 @@ void AstTypeTable::clearCache() {
|
|||
// When we mass-change widthMin in V3WidthCommit, we need to correct the table.
|
||||
// Just clear out the maps; the search functions will be used to rebuild the map
|
||||
for (int i = 0; i < static_cast<int>(AstBasicDTypeKwd::_ENUM_MAX); ++i) {
|
||||
m_basicps[i] = NULL;
|
||||
m_basicps[i] = nullptr;
|
||||
}
|
||||
m_detailedMap.clear();
|
||||
// Clear generic()'s so dead detection will work
|
||||
|
@ -1079,7 +1079,7 @@ void AstCellInline::dump(std::ostream& str) const {
|
|||
const char* AstClassPackage::broken() const {
|
||||
BROKEN_BASE_RTN(AstNodeModule::broken());
|
||||
BROKEN_RTN(m_classp && !m_classp->brokeExists());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void AstClass::insertCache(AstNode* nodep) {
|
||||
if (VN_IS(nodep, Var) || VN_IS(nodep, NodeFTask) || VN_IS(nodep, EnumItemRef)) {
|
||||
|
|
358
src/V3AstNodes.h
358
src/V3AstNodes.h
File diff suppressed because it is too large
Load Diff
|
@ -99,7 +99,7 @@ private:
|
|||
m_unnamedScope = "";
|
||||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
m_namedScope = oldScope;
|
||||
m_unnamedScope = oldUnnamed;
|
||||
|
@ -147,7 +147,7 @@ private:
|
|||
m_unnamedScope = oldUnnamed;
|
||||
|
||||
// Cleanup
|
||||
AstNode* addsp = NULL;
|
||||
AstNode* addsp = nullptr;
|
||||
if (AstNode* stmtsp = nodep->stmtsp()) {
|
||||
stmtsp->unlinkFrBackWithNext();
|
||||
if (addsp) {
|
||||
|
@ -252,8 +252,8 @@ public:
|
|||
// CONSTRUCTORS
|
||||
BeginVisitor(AstNetlist* nodep, BeginState* statep) {
|
||||
m_statep = statep;
|
||||
m_modp = NULL;
|
||||
m_ftaskp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
m_ifDepth = 0;
|
||||
iterate(nodep);
|
||||
}
|
||||
|
|
|
@ -48,11 +48,11 @@ private:
|
|||
public:
|
||||
void add(AstNode* nodep) {
|
||||
if (v3Global.opt.outputSplitCFuncs() && v3Global.opt.outputSplitCFuncs() < m_numStmts) {
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
}
|
||||
if (!m_funcp) {
|
||||
m_funcp = new AstCFunc(m_modp->fileline(), m_basename + "_" + cvtToStr(++m_funcNum),
|
||||
NULL, "void");
|
||||
nullptr, "void");
|
||||
m_funcp->isStatic(false);
|
||||
m_funcp->declPrivate(true);
|
||||
m_funcp->slow(!VN_IS(m_modp, Class)); // Only classes construct on fast path
|
||||
|
@ -78,7 +78,7 @@ public:
|
|||
m_modp = nodep;
|
||||
m_numStmts = 0;
|
||||
m_funcNum = 0;
|
||||
m_tlFuncp = new AstCFunc(nodep->fileline(), basename, NULL, "void");
|
||||
m_tlFuncp = new AstCFunc(nodep->fileline(), basename, nullptr, "void");
|
||||
m_tlFuncp->declPrivate(true);
|
||||
m_tlFuncp->isStatic(false);
|
||||
m_tlFuncp->slow(!VN_IS(m_modp, Class)); // Only classes construct on fast path
|
||||
|
@ -97,7 +97,7 @@ private:
|
|||
|
||||
void V3CCtors::evalAsserts() {
|
||||
AstNodeModule* modp = v3Global.rootp()->modulesp(); // Top module wrapper
|
||||
AstCFunc* funcp = new AstCFunc(modp->fileline(), "_eval_debug_assertions", NULL, "void");
|
||||
AstCFunc* funcp = new AstCFunc(modp->fileline(), "_eval_debug_assertions", nullptr, "void");
|
||||
funcp->declPrivate(true);
|
||||
funcp->isStatic(false);
|
||||
funcp->slow(false);
|
||||
|
@ -171,7 +171,7 @@ void V3CCtors::cctorsAll() {
|
|||
}
|
||||
}
|
||||
if (VN_IS(modp, Class)) {
|
||||
AstCFunc* funcp = new AstCFunc(modp->fileline(), "~", NULL, "");
|
||||
AstCFunc* funcp = new AstCFunc(modp->fileline(), "~", nullptr, "");
|
||||
funcp->isDestructor(true);
|
||||
funcp->isStatic(false);
|
||||
funcp->slow(false);
|
||||
|
|
|
@ -132,7 +132,7 @@ class CUseVisitor : public AstNVisitor {
|
|||
}
|
||||
}
|
||||
void makeVlToString(AstClass* nodep) {
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), "VL_TO_STRING", NULL, "std::string");
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), "VL_TO_STRING", nullptr, "std::string");
|
||||
funcp->argTypes("const VlClassRef<" + EmitCBaseVisitor::prefixNameProtect(nodep)
|
||||
+ ">& obj");
|
||||
funcp->isMethod(false);
|
||||
|
@ -145,7 +145,7 @@ class CUseVisitor : public AstNVisitor {
|
|||
nodep->addStmtp(funcp);
|
||||
}
|
||||
void makeToString(AstClass* nodep) {
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), "to_string", NULL, "std::string");
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), "to_string", nullptr, "std::string");
|
||||
funcp->isConst(true);
|
||||
funcp->isStatic(false);
|
||||
funcp->protect(false);
|
||||
|
@ -156,7 +156,8 @@ class CUseVisitor : public AstNVisitor {
|
|||
nodep->addStmtp(funcp);
|
||||
}
|
||||
void makeToStringMiddle(AstClass* nodep) {
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), "to_string_middle", NULL, "std::string");
|
||||
AstCFunc* funcp
|
||||
= new AstCFunc(nodep->fileline(), "to_string_middle", nullptr, "std::string");
|
||||
funcp->isConst(true);
|
||||
funcp->isStatic(false);
|
||||
funcp->protect(false);
|
||||
|
|
|
@ -81,7 +81,7 @@ private:
|
|||
itemp = VN_CAST(itemp->nextp(), CaseItem)) {
|
||||
iterateAndNextNull(itemp->condsp());
|
||||
}
|
||||
m_caseExprp = NULL;
|
||||
m_caseExprp = nullptr;
|
||||
}
|
||||
}
|
||||
virtual void visit(AstConst* nodep) override {
|
||||
|
@ -110,7 +110,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit CaseLintVisitor(AstNodeCase* nodep) {
|
||||
m_caseExprp = NULL;
|
||||
m_caseExprp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~CaseLintVisitor() {}
|
||||
|
@ -161,7 +161,7 @@ private:
|
|||
}
|
||||
UINFO(8, "Simple case statement: " << nodep << endl);
|
||||
// Zero list of items for each value
|
||||
for (uint32_t i = 0; i < (1UL << m_caseWidth); ++i) m_valueItem[i] = NULL;
|
||||
for (uint32_t i = 0; i < (1UL << m_caseWidth); ++i) m_valueItem[i] = nullptr;
|
||||
// Now pick up the values for each assignment
|
||||
// We can cheat and use uint32_t's because we only support narrow case's
|
||||
bool bitched = false;
|
||||
|
@ -218,7 +218,7 @@ private:
|
|||
}
|
||||
|
||||
// Convert valueItem from AstCaseItem* to the expression
|
||||
// Not done earlier, as we may now have a NULL because it's just a ";" NOP branch
|
||||
// Not done earlier, as we may now have a nullptr because it's just a ";" NOP branch
|
||||
for (uint32_t i = 0; i < (1UL << m_caseWidth); ++i) {
|
||||
m_valueItem[i] = VN_CAST(m_valueItem[i], CaseItem)->bodysp();
|
||||
}
|
||||
|
@ -324,13 +324,13 @@ private:
|
|||
hadDefault = true;
|
||||
} else {
|
||||
// Expressioned clause
|
||||
AstNode* icondNextp = NULL;
|
||||
AstNode* ifexprp = NULL; // If expression to test
|
||||
AstNode* icondNextp = nullptr;
|
||||
AstNode* ifexprp = nullptr; // If expression to test
|
||||
for (AstNode* icondp = itemp->condsp(); icondp; icondp = icondNextp) {
|
||||
icondNextp = icondp->nextp();
|
||||
icondp->unlinkFrBack();
|
||||
|
||||
AstNode* condp = NULL; // Default is to use and1p/and2p
|
||||
AstNode* condp = nullptr; // Default is to use and1p/and2p
|
||||
AstConst* iconstp = VN_CAST(icondp, Const);
|
||||
if (iconstp && neverItem(nodep, iconstp)) {
|
||||
// X in casez can't ever be executed
|
||||
|
@ -377,8 +377,9 @@ private:
|
|||
if (!hadDefault) {
|
||||
// If there was no default, add a empty one, this greatly simplifies below code
|
||||
// and constant propagation will just eliminate it for us later.
|
||||
nodep->addItemsp(new AstCaseItem(
|
||||
nodep->fileline(), new AstConst(nodep->fileline(), AstConst::LogicTrue()), NULL));
|
||||
nodep->addItemsp(
|
||||
new AstCaseItem(nodep->fileline(),
|
||||
new AstConst(nodep->fileline(), AstConst::LogicTrue()), nullptr));
|
||||
}
|
||||
if (debug() >= 9) nodep->dumpTree(cout, " _comp_COND: ");
|
||||
// Now build the IF statement tree
|
||||
|
@ -388,9 +389,9 @@ private:
|
|||
// should pull out the most common item from here and instead make
|
||||
// it the first IF branch.
|
||||
int depth = 0;
|
||||
AstNode* grouprootp = NULL;
|
||||
AstIf* groupnextp = NULL;
|
||||
AstIf* itemnextp = NULL;
|
||||
AstNode* grouprootp = nullptr;
|
||||
AstIf* groupnextp = nullptr;
|
||||
AstIf* itemnextp = nullptr;
|
||||
for (AstCaseItem* itemp = nodep->itemsp(); itemp;
|
||||
itemp = VN_CAST(itemp->nextp(), CaseItem)) {
|
||||
AstNode* istmtsp = itemp->bodysp(); // Maybe null -- no action.
|
||||
|
@ -400,9 +401,9 @@ private:
|
|||
{ // Prepare for next group
|
||||
if (++depth > CASE_ENCODER_GROUP_DEPTH) depth = 1;
|
||||
if (depth == 1) { // First group or starting new group
|
||||
itemnextp = NULL;
|
||||
itemnextp = nullptr;
|
||||
AstIf* newp
|
||||
= new AstIf(itemp->fileline(), ifexprp->cloneTree(true), NULL, NULL);
|
||||
= new AstIf(itemp->fileline(), ifexprp->cloneTree(true), nullptr, nullptr);
|
||||
if (groupnextp) {
|
||||
groupnextp->addElsesp(newp);
|
||||
} else {
|
||||
|
@ -422,7 +423,7 @@ private:
|
|||
VL_DO_DANGLING(itemexprp->deleteTree(), itemexprp);
|
||||
itemexprp = new AstConst(itemp->fileline(), AstConst::LogicTrue());
|
||||
}
|
||||
AstIf* newp = new AstIf(itemp->fileline(), itemexprp, istmtsp, NULL);
|
||||
AstIf* newp = new AstIf(itemp->fileline(), itemexprp, istmtsp, nullptr);
|
||||
if (itemnextp) {
|
||||
itemnextp->addElsesp(newp);
|
||||
} else {
|
||||
|
@ -490,7 +491,7 @@ public:
|
|||
m_caseWidth = 0;
|
||||
m_caseItems = 0;
|
||||
m_caseNoOverlapsAllCovered = false;
|
||||
for (uint32_t i = 0; i < (1UL << CASE_OVERLAP_WIDTH); ++i) m_valueItem[i] = NULL;
|
||||
for (uint32_t i = 0; i < (1UL << CASE_OVERLAP_WIDTH); ++i) m_valueItem[i] = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~CaseVisitor() {
|
||||
|
|
|
@ -63,8 +63,8 @@ public:
|
|||
: V3GraphVertex(graphp)
|
||||
, m_scopep(scopep)
|
||||
, m_nodep(nodep)
|
||||
, m_srcDomainp(NULL)
|
||||
, m_dstDomainp(NULL)
|
||||
, m_srcDomainp(nullptr)
|
||||
, m_dstDomainp(nullptr)
|
||||
, m_srcDomainSet(false)
|
||||
, m_dstDomainSet(false)
|
||||
, m_asyncPath(false) {}
|
||||
|
@ -229,7 +229,7 @@ private:
|
|||
|
||||
// STATE
|
||||
V3Graph m_graph; // Scoreboard of var usages/dependencies
|
||||
CdcLogicVertex* m_logicVertexp; // Current statement being tracked, NULL=ignored
|
||||
CdcLogicVertex* m_logicVertexp; // Current statement being tracked, nullptr=ignored
|
||||
AstScope* m_scopep; // Current scope being processed
|
||||
AstNodeModule* m_modp; // Current module
|
||||
AstSenTree* m_domainp; // Current sentree
|
||||
|
@ -253,7 +253,7 @@ private:
|
|||
m_logicVertexp->dstDomainSet(true);
|
||||
}
|
||||
iterateChildren(nodep);
|
||||
m_logicVertexp = NULL;
|
||||
m_logicVertexp = nullptr;
|
||||
|
||||
if (false && debug() >= 9) {
|
||||
UINFO(9, "Trace Logic:\n");
|
||||
|
@ -273,7 +273,7 @@ private:
|
|||
// Create IO vertex - note it's relative to the pointed to var, not where we are
|
||||
// now This allows reporting to easily print the input statement
|
||||
CdcLogicVertex* ioVertexp
|
||||
= new CdcLogicVertex(&m_graph, varscp->scopep(), varscp->varp(), NULL);
|
||||
= new CdcLogicVertex(&m_graph, varscp->scopep(), varscp->varp(), nullptr);
|
||||
if (varscp->varp()->isWritable()) {
|
||||
new V3GraphEdge(&m_graph, vertexp, ioVertexp, 1);
|
||||
} else {
|
||||
|
@ -364,7 +364,7 @@ private:
|
|||
UINFO(8, " Trace One async: " << vvertexp << endl);
|
||||
// Twice, as we need to detect, then propagate
|
||||
CdcEitherVertex* markp = traceAsyncRecurse(vvertexp, false);
|
||||
if (markp) { // Mark is non-NULL if something bad on this path
|
||||
if (markp) { // Mark is non-nullptr if something bad on this path
|
||||
UINFO(9, " Trace One bad! " << vvertexp << endl);
|
||||
m_userGeneration++; // Effectively a userClearVertices()
|
||||
traceAsyncRecurse(vvertexp, true);
|
||||
|
@ -377,12 +377,12 @@ private:
|
|||
}
|
||||
|
||||
CdcEitherVertex* traceAsyncRecurse(CdcEitherVertex* vertexp, bool mark) {
|
||||
// First pass: Return vertex of any hazardous stuff attached, or NULL if OK
|
||||
// First pass: Return vertex of any hazardous stuff attached, or nullptr if OK
|
||||
// If first pass returns true, second pass calls asyncPath() on appropriate nodes
|
||||
if (vertexp->user() >= m_userGeneration) return NULL; // Processed - prevent loop
|
||||
if (vertexp->user() >= m_userGeneration) return nullptr; // Processed - prevent loop
|
||||
vertexp->user(m_userGeneration);
|
||||
|
||||
CdcEitherVertex* mark_outp = NULL;
|
||||
CdcEitherVertex* mark_outp = nullptr;
|
||||
UINFO(9, " Trace: " << vertexp << endl);
|
||||
|
||||
// Clear out in prep for marking next path
|
||||
|
@ -401,7 +401,7 @@ private:
|
|||
CdcEitherVertex* eFromVertexp = static_cast<CdcEitherVertex*>(edgep->fromp());
|
||||
eFromVertexp->asyncPath(true);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// Also ok if from flop, but partially trace the flop so more obvious to users
|
||||
if (vvertexp->fromFlop()) {
|
||||
|
@ -409,7 +409,7 @@ private:
|
|||
CdcEitherVertex* eFromVertexp = static_cast<CdcEitherVertex*>(edgep->fromp());
|
||||
eFromVertexp->asyncPath(true);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -594,7 +594,7 @@ private:
|
|||
}
|
||||
|
||||
// Convert list of senses into one sense node
|
||||
AstSenTree* senoutp = NULL;
|
||||
AstSenTree* senoutp = nullptr;
|
||||
bool senedited = false;
|
||||
for (SenSet::iterator it = senouts.begin(); it != senouts.end(); ++it) {
|
||||
if (!senoutp) {
|
||||
|
@ -644,9 +644,9 @@ private:
|
|||
virtual void visit(AstScope* nodep) override {
|
||||
UINFO(4, " SCOPE " << nodep << endl);
|
||||
m_scopep = nodep;
|
||||
m_logicVertexp = NULL;
|
||||
m_logicVertexp = nullptr;
|
||||
iterateChildren(nodep);
|
||||
m_scopep = NULL;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
// Create required blocks and add to module
|
||||
|
@ -657,7 +657,7 @@ private:
|
|||
|| m_domainp->hasClocked()) { // IE not hasSettle/hasInitial
|
||||
iterateNewStmt(nodep);
|
||||
}
|
||||
m_domainp = NULL;
|
||||
m_domainp = nullptr;
|
||||
AstNode::user2ClearTree();
|
||||
}
|
||||
virtual void visit(AstNodeVarRef* nodep) override {
|
||||
|
@ -737,10 +737,10 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit CdcVisitor(AstNode* nodep) {
|
||||
m_logicVertexp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_modp = NULL;
|
||||
m_domainp = NULL;
|
||||
m_logicVertexp = nullptr;
|
||||
m_scopep = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_domainp = nullptr;
|
||||
m_inDly = false;
|
||||
m_inSenItem = 0;
|
||||
m_userGeneration = 0;
|
||||
|
@ -763,12 +763,12 @@ public:
|
|||
if (debug() >= 1) edgeReport(); // Not useful to users at the moment
|
||||
if (false) {
|
||||
*m_ofp << "\nDBG-test-dumper\n";
|
||||
V3EmitV::verilogPrefixedTree(nodep, *m_ofp, "DBG ", 40, NULL, true);
|
||||
V3EmitV::verilogPrefixedTree(nodep, *m_ofp, "DBG ", 40, nullptr, true);
|
||||
*m_ofp << endl;
|
||||
}
|
||||
}
|
||||
virtual ~CdcVisitor() {
|
||||
if (m_ofp) VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
if (m_ofp) VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -49,10 +49,10 @@ public:
|
|||
int m_funcNum; // Number of change functions emitted
|
||||
|
||||
ChangedState() {
|
||||
m_topModp = NULL;
|
||||
m_chgFuncp = NULL;
|
||||
m_scopetopp = NULL;
|
||||
m_tlChgFuncp = NULL;
|
||||
m_topModp = nullptr;
|
||||
m_chgFuncp = nullptr;
|
||||
m_scopetopp = nullptr;
|
||||
m_tlChgFuncp = nullptr;
|
||||
m_numStmts = 0;
|
||||
m_funcNum = 0;
|
||||
}
|
||||
|
@ -267,7 +267,8 @@ private:
|
|||
// Each change detection function needs at least one AstChangeDet
|
||||
// to ensure that V3EmitC outputs the necessary code.
|
||||
m_statep->maybeCreateChgFuncp();
|
||||
m_statep->m_chgFuncp->addStmtsp(new AstChangeDet(nodep->fileline(), NULL, NULL, false));
|
||||
m_statep->m_chgFuncp->addStmtsp(
|
||||
new AstChangeDet(nodep->fileline(), nullptr, nullptr, false));
|
||||
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
|
|
|
@ -59,12 +59,12 @@ private:
|
|||
v3Global.rootp()->addModulep(packagep);
|
||||
// Add package to hierarchy
|
||||
AstCell* cellp = new AstCell(packagep->fileline(), packagep->fileline(), packagep->name(),
|
||||
packagep->name(), NULL, NULL, NULL);
|
||||
packagep->name(), nullptr, nullptr, nullptr);
|
||||
cellp->modp(packagep);
|
||||
v3Global.rootp()->topModulep()->addStmtp(cellp);
|
||||
// Find class's scope
|
||||
// Alternative would be to move this and related to V3Scope
|
||||
AstScope* classScopep = NULL;
|
||||
AstScope* classScopep = nullptr;
|
||||
for (AstNode* itp = nodep->stmtsp(); itp; itp = itp->nextp()) {
|
||||
if ((classScopep = VN_CAST(itp, Scope))) break;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
}
|
||||
m_prefix = prevPrefix;
|
||||
m_classScopep = NULL;
|
||||
m_classScopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstPackage* nodep) override {
|
||||
string prevPrefix = m_prefix;
|
||||
|
@ -117,7 +117,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit ClassVisitor(AstNetlist* nodep)
|
||||
: m_classScopep(NULL) {
|
||||
: m_classScopep(nullptr) {
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~ClassVisitor() {
|
||||
|
|
|
@ -301,7 +301,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit CleanVisitor(AstNetlist* nodep) {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~CleanVisitor() {}
|
||||
|
|
|
@ -101,11 +101,11 @@ private:
|
|||
// BOTHEDGE: var ^ var_last
|
||||
// HIGHEDGE: var
|
||||
// LOWEDGE: ~var
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
if (nodep->edgeType() == VEdgeType::ET_ILLEGAL) {
|
||||
nodep->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: Complicated event expression in sensitive activity list");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
AstVarScope* clkvscp = nodep->varrefp()->varScopep();
|
||||
if (nodep->edgeType() == VEdgeType::ET_POSEDGE) {
|
||||
|
@ -138,7 +138,7 @@ private:
|
|||
}
|
||||
AstNode* createSenseEquation(AstSenItem* nodesp) {
|
||||
// Nodep may be a list of elements; we need to walk it
|
||||
AstNode* senEqnp = NULL;
|
||||
AstNode* senEqnp = nullptr;
|
||||
for (AstSenItem* senp = nodesp; senp; senp = VN_CAST(senp->nextp(), SenItem)) {
|
||||
AstNode* const senOnep = createSenItemEquation(senp);
|
||||
if (senEqnp) {
|
||||
|
@ -153,12 +153,12 @@ private:
|
|||
AstIf* makeActiveIf(AstSenTree* sensesp) {
|
||||
AstNode* senEqnp = createSenseEquation(sensesp->sensesp());
|
||||
UASSERT_OBJ(senEqnp, sensesp, "No sense equation, shouldn't be in sequent activation.");
|
||||
AstIf* newifp = new AstIf(sensesp->fileline(), senEqnp, NULL, NULL);
|
||||
AstIf* newifp = new AstIf(sensesp->fileline(), senEqnp, nullptr, nullptr);
|
||||
return newifp;
|
||||
}
|
||||
void clearLastSen() {
|
||||
m_lastSenp = NULL;
|
||||
m_lastIfp = NULL;
|
||||
m_lastSenp = nullptr;
|
||||
m_lastIfp = nullptr;
|
||||
}
|
||||
|
||||
// VISITORS
|
||||
|
@ -223,8 +223,8 @@ private:
|
|||
// Done, clear so we can detect errors
|
||||
UINFO(4, " TOPSCOPEDONE " << nodep << endl);
|
||||
clearLastSen();
|
||||
m_topScopep = NULL;
|
||||
m_scopep = NULL;
|
||||
m_topScopep = nullptr;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeModule* nodep) override {
|
||||
// UINFO(4, " MOD " << nodep << endl);
|
||||
|
@ -244,7 +244,7 @@ private:
|
|||
movep->unlinkFrBackWithNext();
|
||||
m_evalFuncp->addFinalsp(movep);
|
||||
}
|
||||
m_scopep = NULL;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstAlways* nodep) override {
|
||||
AstNode* cmtp = new AstComment(nodep->fileline(), nodep->typeName(), true);
|
||||
|
@ -272,7 +272,7 @@ private:
|
|||
AstNode* origp = nodep->origp()->unlinkFrBack();
|
||||
AstNode* changep = nodep->changep()->unlinkFrBack();
|
||||
AstIf* newp = new AstIf(nodep->fileline(), new AstXor(nodep->fileline(), origp, changep),
|
||||
incp, NULL);
|
||||
incp, nullptr);
|
||||
// We could add another IF to detect posedges, and only increment if so.
|
||||
// It's another whole branch though versus a potential memory miss.
|
||||
// We'll go with the miss.
|
||||
|
@ -402,16 +402,16 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit ClockVisitor(AstNetlist* nodep) {
|
||||
m_modp = NULL;
|
||||
m_evalFuncp = NULL;
|
||||
m_initFuncp = NULL;
|
||||
m_finalFuncp = NULL;
|
||||
m_settleFuncp = NULL;
|
||||
m_topScopep = NULL;
|
||||
m_lastSenp = NULL;
|
||||
m_lastIfp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_mtaskBodyp = NULL;
|
||||
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);
|
||||
// Allow downstream modules to find _eval()
|
||||
|
|
|
@ -208,7 +208,7 @@ private:
|
|||
<< oldfuncp << endl);
|
||||
// Mark user3p on entire old tree, so we don't process it more
|
||||
CombMarkVisitor visitor(oldfuncp);
|
||||
m_call.replaceFunc(oldfuncp, NULL);
|
||||
m_call.replaceFunc(oldfuncp, nullptr);
|
||||
oldfuncp->unlinkFrBack();
|
||||
VL_DO_DANGLING(pushDeletep(oldfuncp), oldfuncp);
|
||||
}
|
||||
|
@ -251,8 +251,8 @@ private:
|
|||
void replaceOnlyCallFunc(AstCCall* nodep) {
|
||||
if (AstCFunc* oldfuncp = VN_CAST(nodep->backp(), CFunc)) {
|
||||
// oldfuncp->dumpTree(cout, "MAYDEL: ");
|
||||
if (nodep->nextp() == NULL && oldfuncp->initsp() == NULL && oldfuncp->stmtsp() == nodep
|
||||
&& oldfuncp->finalsp() == NULL) {
|
||||
if (nodep->nextp() == nullptr && oldfuncp->initsp() == nullptr
|
||||
&& oldfuncp->stmtsp() == nodep && oldfuncp->finalsp() == nullptr) {
|
||||
UINFO(9, " Function only has call " << oldfuncp << endl);
|
||||
m_call.deleteCall(nodep);
|
||||
CombMarkVisitor visitor(oldfuncp);
|
||||
|
@ -266,9 +266,9 @@ private:
|
|||
// UINFO(4," STMT " << hashval << " " << node1p << endl);
|
||||
//
|
||||
int bestDepth = 0; // Best substitution found in the search
|
||||
AstNode* bestNode2p = NULL;
|
||||
AstNode* bestLast1p = NULL;
|
||||
AstNode* bestLast2p = NULL;
|
||||
AstNode* bestNode2p = nullptr;
|
||||
AstNode* bestLast1p = nullptr;
|
||||
AstNode* bestLast2p = nullptr;
|
||||
//
|
||||
std::pair<V3Hashed::iterator, V3Hashed::iterator> eqrange
|
||||
= m_hashed.mmap().equal_range(hashval);
|
||||
|
@ -279,8 +279,8 @@ private:
|
|||
// We need to mark iteration to prevent matching code inside
|
||||
// code (abab matching in ababab)
|
||||
AstNode::user1ClearTree(); // user1p() used on entire tree
|
||||
m_walkLast1p = NULL;
|
||||
m_walkLast2p = NULL;
|
||||
m_walkLast1p = nullptr;
|
||||
m_walkLast2p = nullptr;
|
||||
int depth = walkDupCodeNext(node1p, node2p, 1);
|
||||
if (depth > COMBINE_MIN_STATEMENTS && depth > bestDepth) {
|
||||
bestDepth = depth;
|
||||
|
@ -332,7 +332,7 @@ private:
|
|||
if ((pos = oldname.find("_common")) != string::npos) oldname.erase(pos);
|
||||
if ((pos = oldname.find("__")) != string::npos) oldname.erase(pos);
|
||||
AstCFunc* newfuncp = new AstCFunc(node1p->fileline(),
|
||||
oldname + "_common" + cvtToStr(++m_modNFuncs), NULL);
|
||||
oldname + "_common" + cvtToStr(++m_modNFuncs), nullptr);
|
||||
m_modp->addStmtp(newfuncp);
|
||||
// Create calls
|
||||
AstCCall* call1p = new AstCCall(node1p->fileline(), newfuncp);
|
||||
|
@ -394,7 +394,7 @@ private:
|
|||
UINFO(4, " MOD " << nodep << endl);
|
||||
m_modp = nodep;
|
||||
m_modNFuncs = 0;
|
||||
m_walkLast2p = NULL;
|
||||
m_walkLast2p = nullptr;
|
||||
m_hashed.clear();
|
||||
// Compute hash of all statement trees in the function
|
||||
m_state = STATE_HASH;
|
||||
|
@ -417,7 +417,7 @@ private:
|
|||
m_state = STATE_IDLE;
|
||||
}
|
||||
#endif
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) override {
|
||||
m_funcp = nodep;
|
||||
|
@ -431,7 +431,7 @@ private:
|
|||
}
|
||||
#endif
|
||||
}
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeStmt* nodep) override {
|
||||
if (!nodep->isStatement()) {
|
||||
|
@ -459,11 +459,11 @@ public:
|
|||
// CONSTRUCTORS
|
||||
explicit CombineVisitor(AstNetlist* nodep) {
|
||||
m_state = STATE_IDLE;
|
||||
m_modp = NULL;
|
||||
m_funcp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_funcp = nullptr;
|
||||
m_modNFuncs = 0;
|
||||
m_walkLast1p = NULL;
|
||||
m_walkLast2p = NULL;
|
||||
m_walkLast1p = nullptr;
|
||||
m_walkLast2p = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~CombineVisitor() { //
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
typename Map::iterator it = m_mapResolved.find(name);
|
||||
if (VL_UNLIKELY(it != m_mapResolved.end())) { return &it->second; }
|
||||
|
||||
T* newp = NULL;
|
||||
T* newp = nullptr;
|
||||
// Cannot be resolved, create if matched
|
||||
|
||||
// Update this entity with all matches in the wildcards
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
AstNode* newp = new AstAttrOf(varp->fileline(), it->m_type);
|
||||
varp->addAttrsp(newp);
|
||||
if (it->m_type == AstAttrType::VAR_PUBLIC_FLAT_RW && it->m_sentreep) {
|
||||
newp->addNext(new AstAlwaysPublic(varp->fileline(), it->m_sentreep, NULL));
|
||||
newp->addNext(new AstAlwaysPublic(varp->fileline(), it->m_sentreep, nullptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1115,7 +1115,7 @@ private:
|
|||
AstSel* sel2p = new AstSel(conp->fileline(), rhs2p, lsb2, msb2 - lsb2 + 1);
|
||||
// Make new assigns of same flavor as old one
|
||||
//*** Not cloneTree; just one node.
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
if (!need_temp) {
|
||||
AstNodeAssign* asn1ap = VN_CAST(nodep->cloneType(lc1p, sel1p), NodeAssign);
|
||||
AstNodeAssign* asn2ap = VN_CAST(nodep->cloneType(lc2p, sel2p), NodeAssign);
|
||||
|
@ -1307,7 +1307,7 @@ private:
|
|||
m_wremove = false;
|
||||
iterateChildren(nodep);
|
||||
m_wremove = true;
|
||||
m_scopep = NULL;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
|
||||
void swapSides(AstNodeBiCom* nodep) {
|
||||
|
@ -1594,7 +1594,7 @@ private:
|
|||
VL_DO_DANGLING(nodep->deleteTree(), nodep);
|
||||
}
|
||||
}
|
||||
m_selp = NULL;
|
||||
m_selp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeVarRef* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
|
@ -1784,7 +1784,7 @@ private:
|
|||
SenItemCmp cmp;
|
||||
if (nextp && !cmp(senp, nextp)) {
|
||||
// Something's out of order, sort it
|
||||
senp = NULL;
|
||||
senp = nullptr;
|
||||
std::vector<AstSenItem*> vec;
|
||||
for (AstSenItem* senp = VN_CAST(nodep->sensesp(), SenItem); senp;
|
||||
senp = VN_CAST(senp->nextp(), SenItem)) {
|
||||
|
@ -1883,7 +1883,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
if (m_doNConst) {
|
||||
if (const AstConst* constp = VN_CAST(nodep->condp(), Const)) {
|
||||
AstNode* keepp = NULL;
|
||||
AstNode* keepp = nullptr;
|
||||
if (constp->isZero()) {
|
||||
UINFO(4, "IF(0,{any},{x}) => {x}: " << nodep << endl);
|
||||
keepp = nodep->elsesp();
|
||||
|
@ -1907,7 +1907,7 @@ private:
|
|||
// effects in the condition itself
|
||||
VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
|
||||
} else if (!afterComment(nodep->ifsp())) {
|
||||
UINFO(4, "IF({x}) NULL {...} => IF(NOT{x}}: " << nodep << endl);
|
||||
UINFO(4, "IF({x}) nullptr {...} => IF(NOT{x}}: " << nodep << endl);
|
||||
AstNode* condp = nodep->condp();
|
||||
AstNode* elsesp = nodep->elsesp();
|
||||
condp->unlinkFrBackWithNext();
|
||||
|
@ -2173,7 +2173,7 @@ private:
|
|||
// AstJumpGo's below here that point to this node will set user4
|
||||
if (m_doExpensive && !nodep->user4()) {
|
||||
UINFO(4, "JUMPLABEL => unused " << nodep << endl);
|
||||
AstNode* underp = NULL;
|
||||
AstNode* underp = nullptr;
|
||||
if (nodep->stmtsp()) underp = nodep->stmtsp()->unlinkFrBackWithNext();
|
||||
if (underp) {
|
||||
nodep->replaceWith(underp);
|
||||
|
@ -2559,10 +2559,10 @@ public:
|
|||
m_hasJumpDelay = false;
|
||||
m_warn = false;
|
||||
m_wremove = true; // Overridden in visitors
|
||||
m_modp = NULL;
|
||||
m_selp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_attrp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_selp = nullptr;
|
||||
m_scopep = nullptr;
|
||||
m_attrp = nullptr;
|
||||
//
|
||||
// clang-format off
|
||||
switch (pmode) {
|
||||
|
|
|
@ -54,8 +54,8 @@ private:
|
|||
, m_chgRefp(cp) {}
|
||||
~ToggleEnt() {}
|
||||
void cleanup() {
|
||||
VL_DO_CLEAR(m_varRefp->deleteTree(), m_varRefp = NULL);
|
||||
VL_DO_CLEAR(m_chgRefp->deleteTree(), m_chgRefp = NULL);
|
||||
VL_DO_CLEAR(m_varRefp->deleteTree(), m_varRefp = nullptr);
|
||||
VL_DO_CLEAR(m_chgRefp->deleteTree(), m_chgRefp = nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@ private:
|
|||
: m_on(false)
|
||||
, m_inModOff(false)
|
||||
, m_handle(0)
|
||||
, m_nodep(NULL) {}
|
||||
, m_nodep(nullptr) {}
|
||||
bool lineCoverageOn(const AstNode* nodep) {
|
||||
return m_on && !m_inModOff && nodep->fileline()->coverageOn()
|
||||
&& v3Global.opt.coverageLine();
|
||||
|
@ -106,7 +106,7 @@ private:
|
|||
}
|
||||
// We allow this, though tracing doesn't
|
||||
// if (nodep->arrayp(1)) return "Unsupported: Multi-dimensional array";
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AstCoverInc* newCoverInc(FileLine* fl, const string& hier, const string& page_prefix,
|
||||
|
@ -546,7 +546,7 @@ public:
|
|||
explicit CoverageVisitor(AstNetlist* rootp) {
|
||||
// Operate on all modules
|
||||
m_nextHandle = 0;
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_beginHier = "";
|
||||
m_inToggleOff = false;
|
||||
iterateChildren(rootp);
|
||||
|
|
|
@ -170,7 +170,7 @@ private:
|
|||
if (nodep->varp()) nodep->varp()->user1Inc();
|
||||
if (nodep->packagep()) {
|
||||
if (m_elimCells) {
|
||||
nodep->packagep(NULL);
|
||||
nodep->packagep(nullptr);
|
||||
} else {
|
||||
nodep->packagep()->user1Inc();
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ private:
|
|||
checkAll(nodep);
|
||||
if (nodep->packagep()) {
|
||||
if (m_elimCells) {
|
||||
nodep->packagep(NULL);
|
||||
nodep->packagep(nullptr);
|
||||
} else {
|
||||
nodep->packagep()->user1Inc();
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ private:
|
|||
"RefDType should point to data type before typedefs removed");
|
||||
if (nodep->packagep()) {
|
||||
if (m_elimCells) {
|
||||
nodep->packagep(NULL);
|
||||
nodep->packagep(nullptr);
|
||||
} else {
|
||||
nodep->packagep()->user1Inc();
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ private:
|
|||
checkAll(nodep);
|
||||
if (nodep->packagep()) {
|
||||
if (m_elimCells) {
|
||||
nodep->packagep(NULL);
|
||||
nodep->packagep(nullptr);
|
||||
} else {
|
||||
nodep->packagep()->user1Inc();
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ private:
|
|||
checkAll(nodep);
|
||||
if (nodep->packagep()) {
|
||||
if (m_elimCells) {
|
||||
nodep->packagep(NULL);
|
||||
nodep->packagep(nullptr);
|
||||
} else {
|
||||
nodep->packagep()->user1Inc();
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ private:
|
|||
scp->aboveScopep()->user1Inc(-1);
|
||||
if (scp->dtypep()) scp->dtypep()->user1Inc(-1);
|
||||
VL_DO_DANGLING(scp->unlinkFrBack()->deleteTree(), scp);
|
||||
*it = NULL;
|
||||
*it = nullptr;
|
||||
retry = true;
|
||||
}
|
||||
}
|
||||
|
@ -371,12 +371,12 @@ private:
|
|||
retry = false;
|
||||
for (std::vector<AstClass*>::iterator it = m_classesp.begin(); it != m_classesp.end();
|
||||
++it) {
|
||||
if (AstClass* nodep = *it) { // NULL if deleted earlier
|
||||
if (AstClass* nodep = *it) { // nullptr if deleted earlier
|
||||
if (nodep->user1() == 0) {
|
||||
if (nodep->extendsp()) nodep->extendsp()->user1Inc(-1);
|
||||
if (nodep->packagep()) nodep->packagep()->user1Inc(-1);
|
||||
VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep);
|
||||
*it = NULL;
|
||||
*it = nullptr;
|
||||
retry = true;
|
||||
}
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ private:
|
|||
UINFO(4, " Dead " << varp << endl);
|
||||
if (varp->dtypep()) varp->dtypep()->user1Inc(-1);
|
||||
VL_DO_DANGLING(varp->unlinkFrBack()->deleteTree(), varp);
|
||||
*it = NULL;
|
||||
*it = nullptr;
|
||||
retry = true;
|
||||
}
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ public:
|
|||
// CONSTRUCTORS
|
||||
DeadVisitor(AstNetlist* nodep, bool elimUserVars, bool elimDTypes, bool elimScopes,
|
||||
bool elimCells) {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_elimCells = elimCells;
|
||||
m_elimUserVars = elimUserVars;
|
||||
m_elimDTypes = elimDTypes;
|
||||
|
|
|
@ -189,9 +189,9 @@ private:
|
|||
// See top of this file for transformation
|
||||
// Return the new LHS for the assignment, Null = unlink
|
||||
// Find selects
|
||||
AstNode* newlhsp = NULL; // NULL = unlink old assign
|
||||
AstSel* bitselp = NULL;
|
||||
AstArraySel* arrayselp = NULL;
|
||||
AstNode* newlhsp = nullptr; // nullptr = unlink old assign
|
||||
AstSel* bitselp = nullptr;
|
||||
AstArraySel* arrayselp = nullptr;
|
||||
if (VN_IS(lhsp, Sel)) {
|
||||
bitselp = VN_CAST(lhsp, Sel);
|
||||
arrayselp = VN_CAST(bitselp->fromp(), ArraySel);
|
||||
|
@ -226,7 +226,7 @@ private:
|
|||
string bitvarname = (string("__Vdlyvdim") + cvtToStr(dimension) + "__"
|
||||
+ oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
|
||||
AstVarScope* bitvscp
|
||||
= createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), NULL);
|
||||
= createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), nullptr);
|
||||
AstAssign* bitassignp = new AstAssign(
|
||||
nodep->fileline(), new AstVarRef(nodep->fileline(), bitvscp, true), dimp);
|
||||
nodep->addNextHere(bitassignp);
|
||||
|
@ -235,7 +235,7 @@ private:
|
|||
}
|
||||
//
|
||||
//=== Bitselect: __Vdlyvlsb__
|
||||
AstNode* bitreadp = NULL; // Code to read Vdlyvlsb
|
||||
AstNode* bitreadp = nullptr; // Code to read Vdlyvlsb
|
||||
if (bitselp) {
|
||||
AstNode* lsbvaluep = bitselp->lsbp()->unlinkFrBack();
|
||||
if (VN_IS(bitselp->fromp(), Const)) {
|
||||
|
@ -245,7 +245,7 @@ private:
|
|||
string bitvarname = (string("__Vdlyvlsb__") + oldvarp->shortName() + "__v"
|
||||
+ cvtToStr(modVecNum));
|
||||
AstVarScope* bitvscp
|
||||
= createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), NULL);
|
||||
= createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), nullptr);
|
||||
AstAssign* bitassignp = new AstAssign(
|
||||
nodep->fileline(), new AstVarRef(nodep->fileline(), bitvscp, true), lsbvaluep);
|
||||
nodep->addNextHere(bitassignp);
|
||||
|
@ -269,7 +269,7 @@ private:
|
|||
//
|
||||
//=== Setting/not setting boolean: __Vdlyvset__
|
||||
AstVarScope* setvscp;
|
||||
AstAssignPre* setinitp = NULL;
|
||||
AstAssignPre* setinitp = nullptr;
|
||||
|
||||
if (nodep->user3p()) {
|
||||
// Simplistic optimization. If the previous statement in same scope was also a =>,
|
||||
|
@ -281,7 +281,7 @@ private:
|
|||
} else { // Create new one
|
||||
string setvarname
|
||||
= (string("__Vdlyvset__") + oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
|
||||
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, NULL);
|
||||
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, nullptr);
|
||||
setinitp = new AstAssignPre(nodep->fileline(),
|
||||
new AstVarRef(nodep->fileline(), setvscp, true),
|
||||
new AstConst(nodep->fileline(), 0));
|
||||
|
@ -316,7 +316,7 @@ private:
|
|||
checkActivePost(varrefp, oldactivep);
|
||||
if (setinitp) oldactivep->addStmtsp(setinitp);
|
||||
} else { // first time we've dealt with this memory
|
||||
finalp = new AstAlwaysPost(nodep->fileline(), NULL /*sens*/, NULL /*body*/);
|
||||
finalp = new AstAlwaysPost(nodep->fileline(), nullptr /*sens*/, nullptr /*body*/);
|
||||
UINFO(9, " Created " << finalp << endl);
|
||||
AstActive* newactp = createActivePost(varrefp);
|
||||
newactp->addStmtsp(finalp);
|
||||
|
@ -332,8 +332,9 @@ private:
|
|||
UASSERT_OBJ(postLogicp, nodep,
|
||||
"Delayed assignment misoptimized; prev var found w/o associated IF");
|
||||
} else {
|
||||
postLogicp = new AstIf(nodep->fileline(),
|
||||
new AstVarRef(nodep->fileline(), setvscp, false), NULL, NULL);
|
||||
postLogicp
|
||||
= new AstIf(nodep->fileline(), new AstVarRef(nodep->fileline(), setvscp, false),
|
||||
nullptr, nullptr);
|
||||
UINFO(9, " Created " << postLogicp << endl);
|
||||
finalp->addBodysp(postLogicp);
|
||||
finalp->user3p(setvscp); // Remember IF's vset variable
|
||||
|
@ -357,7 +358,7 @@ private:
|
|||
virtual void visit(AstCFunc* nodep) override {
|
||||
m_cfuncp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_cfuncp = NULL;
|
||||
m_cfuncp = nullptr;
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
m_activep = nodep;
|
||||
|
@ -371,7 +372,7 @@ private:
|
|||
virtual void visit(AstAssignDly* nodep) override {
|
||||
m_inDly = true;
|
||||
m_nextDlyp
|
||||
= VN_CAST(nodep->nextp(), AssignDly); // Next assignment in same block, maybe NULL.
|
||||
= VN_CAST(nodep->nextp(), AssignDly); // Next assignment in same block, maybe nullptr.
|
||||
if (m_cfuncp) {
|
||||
nodep->v3warn(E_UNSUPPORTED,
|
||||
"Unsupported: Delayed assignment inside public function/task");
|
||||
|
@ -399,7 +400,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
}
|
||||
m_inDly = false;
|
||||
m_nextDlyp = NULL;
|
||||
m_nextDlyp = nullptr;
|
||||
}
|
||||
|
||||
virtual void visit(AstVarRef* nodep) override {
|
||||
|
@ -421,7 +422,7 @@ private:
|
|||
}
|
||||
if (!dlyvscp) { // First use of this delayed variable
|
||||
string newvarname = (string("__Vdly__") + nodep->varp()->shortName());
|
||||
dlyvscp = createVarSc(oldvscp, newvarname, 0, NULL);
|
||||
dlyvscp = createVarSc(oldvscp, newvarname, 0, nullptr);
|
||||
AstNodeAssign* prep;
|
||||
AstBasicDType* basicp = oldvscp->dtypep()->basicp();
|
||||
if (basicp && basicp->isEventValue()) {
|
||||
|
@ -477,9 +478,9 @@ public:
|
|||
// CONSTRUCTORS
|
||||
explicit DelayedVisitor(AstNetlist* nodep) {
|
||||
m_inDly = false;
|
||||
m_activep = NULL;
|
||||
m_cfuncp = NULL;
|
||||
m_nextDlyp = NULL;
|
||||
m_activep = nullptr;
|
||||
m_cfuncp = nullptr;
|
||||
m_nextDlyp = nullptr;
|
||||
m_inLoop = false;
|
||||
m_inInitial = false;
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ private:
|
|||
AstNodeModule* origModp = m_modp;
|
||||
{
|
||||
m_modp = nodep;
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
m_modp = origModp;
|
||||
|
@ -91,14 +91,14 @@ private:
|
|||
m_depth = 0;
|
||||
m_maxdepth = 0;
|
||||
iterateChildren(nodep);
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
}
|
||||
void visitStmt(AstNodeStmt* nodep) {
|
||||
m_depth = 0;
|
||||
m_maxdepth = 0;
|
||||
m_stmtp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_stmtp = NULL;
|
||||
m_stmtp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeStmt* nodep) override {
|
||||
if (!nodep->isStatement()) {
|
||||
|
@ -152,9 +152,9 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit DepthVisitor(AstNetlist* nodep) {
|
||||
m_modp = NULL;
|
||||
m_funcp = NULL;
|
||||
m_stmtp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_funcp = nullptr;
|
||||
m_stmtp = nullptr;
|
||||
m_depth = 0;
|
||||
m_maxdepth = 0;
|
||||
//
|
||||
|
|
|
@ -50,7 +50,7 @@ private:
|
|||
nodep->unlinkFrBack(&relinkHandle);
|
||||
// Create function
|
||||
string name = m_funcp->name() + "__deep" + cvtToStr(++m_deepNum);
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), name, NULL);
|
||||
AstCFunc* funcp = new AstCFunc(nodep->fileline(), name, nullptr);
|
||||
funcp->argTypes(EmitCBaseVisitor::symClassVar());
|
||||
funcp->symProlog(true);
|
||||
funcp->slow(m_funcp->slow());
|
||||
|
@ -120,8 +120,8 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit DepthBlockVisitor(AstNetlist* nodep) {
|
||||
m_modp = NULL;
|
||||
m_funcp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_funcp = nullptr;
|
||||
m_depth = 0;
|
||||
m_deepNum = 0;
|
||||
//
|
||||
|
|
|
@ -76,7 +76,7 @@ private:
|
|||
// Sets 'hierThisr' true if the object is local to this scope
|
||||
// (and could be made into a function-local later in V3Localize),
|
||||
// false if the object is in another scope.
|
||||
string descopedName(const AstScope* scopep, bool& hierThisr, const AstVar* varp = NULL) {
|
||||
string descopedName(const AstScope* scopep, bool& hierThisr, const AstVar* varp = nullptr) {
|
||||
UASSERT(scopep, "Var/Func not scoped");
|
||||
hierThisr = (scopep == m_scopep);
|
||||
|
||||
|
@ -180,7 +180,7 @@ private:
|
|||
UINFO(6,
|
||||
" at " << newfuncp->argTypes() << " und " << funcp->argTypes() << endl);
|
||||
funcp->declPrivate(true);
|
||||
AstNode* argsp = NULL;
|
||||
AstNode* argsp = nullptr;
|
||||
for (AstNode* stmtp = newfuncp->argsp(); stmtp; stmtp = stmtp->nextp()) {
|
||||
if (AstVar* portp = VN_CAST(stmtp, Var)) {
|
||||
if (portp->isIO() && !portp->isFuncReturn()) {
|
||||
|
@ -202,7 +202,7 @@ private:
|
|||
new AstCMath(funcp->fileline(),
|
||||
string("&(") + funcp->scopep()->nameVlSym() + ")",
|
||||
64)),
|
||||
returnp, NULL);
|
||||
returnp, nullptr);
|
||||
newfuncp->addStmtsp(ifp);
|
||||
} else {
|
||||
newfuncp->addStmtsp(returnp);
|
||||
|
@ -213,7 +213,7 @@ private:
|
|||
// newfuncp->addStmtsp(new AstDisplay(newfuncp->fileline(),
|
||||
// AstDisplayType::DT_WARNING,
|
||||
// string("%%Error: ")+name+"() called with bad
|
||||
// scope", NULL));
|
||||
// scope", nullptr));
|
||||
// newfuncp->addStmtsp(new AstStop(newfuncp->fileline()));
|
||||
if (debug() >= 9) newfuncp->dumpTree(cout, " newfunc: ");
|
||||
} else {
|
||||
|
@ -239,7 +239,7 @@ private:
|
|||
virtual void visit(AstScope* nodep) override {
|
||||
m_scopep = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_scopep = NULL;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstVarScope* nodep) override {
|
||||
// Delete the varscope when we're finished
|
||||
|
@ -254,7 +254,7 @@ private:
|
|||
nodep->hiername(descopedName(nodep->varScopep()->scopep(), hierThis /*ref*/,
|
||||
nodep->varScopep()->varp()));
|
||||
nodep->hierThis(hierThis);
|
||||
nodep->varScopep(NULL);
|
||||
nodep->varScopep(nullptr);
|
||||
}
|
||||
virtual void visit(AstNodeCCall* nodep) override {
|
||||
// UINFO(9, " " << nodep << endl);
|
||||
|
@ -265,7 +265,7 @@ private:
|
|||
bool hierThis;
|
||||
nodep->hiername(descopedName(nodep->funcp()->scopep(), hierThis /*ref*/));
|
||||
// Can't do this, as we may have more calls later
|
||||
// nodep->funcp()->scopep(NULL);
|
||||
// nodep->funcp()->scopep(nullptr);
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) override {
|
||||
if (!nodep->user1()) {
|
||||
|
@ -294,8 +294,8 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit DescopeVisitor(AstNetlist* nodep)
|
||||
: m_modp(NULL)
|
||||
, m_scopep(NULL)
|
||||
: m_modp(nullptr)
|
||||
, m_scopep(nullptr)
|
||||
, m_modSingleton(false)
|
||||
, m_allowThis(false)
|
||||
, m_needThis(false) {
|
||||
|
|
|
@ -539,10 +539,10 @@ public:
|
|||
displayNode(nodep, nodep->scopeNamep(), nodep->text(), nodep->exprsp(), false);
|
||||
}
|
||||
virtual void visit(AstFScanF* nodep) override {
|
||||
displayNode(nodep, NULL, nodep->text(), nodep->exprsp(), true);
|
||||
displayNode(nodep, nullptr, nodep->text(), nodep->exprsp(), true);
|
||||
}
|
||||
virtual void visit(AstSScanF* nodep) override {
|
||||
displayNode(nodep, NULL, nodep->text(), nodep->exprsp(), true);
|
||||
displayNode(nodep, nullptr, nodep->text(), nodep->exprsp(), true);
|
||||
}
|
||||
virtual void visit(AstValuePlusArgs* nodep) override {
|
||||
puts("VL_VALUEPLUSARGS_IN");
|
||||
|
@ -570,7 +570,7 @@ public:
|
|||
}
|
||||
virtual void visit(AstFGetS* nodep) override {
|
||||
checkMaxWords(nodep);
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nodep->rhsp(), NULL);
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nodep->rhsp(), nullptr);
|
||||
}
|
||||
|
||||
void checkMaxWords(AstNode* nodep) {
|
||||
|
@ -874,7 +874,7 @@ public:
|
|||
|
||||
// Operators
|
||||
virtual void visit(AstNodeTermop* nodep) override {
|
||||
emitOpName(nodep, nodep->emitC(), NULL, NULL, NULL);
|
||||
emitOpName(nodep, nodep->emitC(), nullptr, nullptr, nullptr);
|
||||
}
|
||||
virtual void visit(AstNodeUniop* nodep) override {
|
||||
if (nodep->emitCheckMaxWords()
|
||||
|
@ -893,7 +893,7 @@ public:
|
|||
iterateAndNextNull(nodep->lhsp());
|
||||
puts(")");
|
||||
} else {
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), NULL, NULL);
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstNodeBiop* nodep) override {
|
||||
|
@ -913,7 +913,7 @@ public:
|
|||
iterateAndNextNull(nodep->rhsp());
|
||||
puts(")");
|
||||
} else {
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nodep->rhsp(), NULL);
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nodep->rhsp(), nullptr);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstNodeTriop* nodep) override {
|
||||
|
@ -1004,7 +1004,7 @@ public:
|
|||
iterateAndNextNull(nodep->rhsp());
|
||||
puts(")");
|
||||
} else {
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nodep->rhsp(), NULL);
|
||||
emitOpName(nodep, nodep->emitC(), nodep->lhsp(), nodep->rhsp(), nullptr);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstStreamL* nodep) override {
|
||||
|
@ -1029,7 +1029,7 @@ public:
|
|||
}
|
||||
}
|
||||
emitOpName(nodep, "VL_STREAML_%nq%lq%rq(%nw,%lw,%rw, %P, %li, %ri)", nodep->lhsp(),
|
||||
nodep->rhsp(), NULL);
|
||||
nodep->rhsp(), nullptr);
|
||||
}
|
||||
virtual void visit(AstCountBits* nodep) override {
|
||||
putbs("VL_COUNTBITS_");
|
||||
|
@ -1187,16 +1187,16 @@ public:
|
|||
puts(assignString);
|
||||
puts(" = ");
|
||||
}
|
||||
emitConstant(constp, NULL, assignString);
|
||||
emitConstant(constp, nullptr, assignString);
|
||||
puts(";\n");
|
||||
}
|
||||
virtual void visit(AstConst* nodep) override {
|
||||
if (nodep->isWide()) {
|
||||
UASSERT_OBJ(m_wideTempRefp, nodep, "Wide Constant w/ no temp");
|
||||
emitConstant(nodep, m_wideTempRefp, "");
|
||||
m_wideTempRefp = NULL; // We used it, barf if set it a second time
|
||||
m_wideTempRefp = nullptr; // We used it, barf if set it a second time
|
||||
} else {
|
||||
emitConstant(nodep, NULL, "");
|
||||
emitConstant(nodep, nullptr, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1224,7 +1224,7 @@ public:
|
|||
|
||||
void init() {
|
||||
m_suppressSemi = false;
|
||||
m_wideTempRefp = NULL;
|
||||
m_wideTempRefp = nullptr;
|
||||
m_labelNum = 0;
|
||||
m_splitSize = 0;
|
||||
m_splitFilenum = 0;
|
||||
|
@ -1340,7 +1340,7 @@ class EmitCImp : EmitCStmts {
|
|||
string filenameNoExt = v3Global.opt.makeDir() + "/" + prefixNameProtect(modp);
|
||||
if (filenum) filenameNoExt += "__" + cvtToStr(filenum);
|
||||
filenameNoExt += (slow ? "__Slow" : "");
|
||||
V3OutCFile* ofp = NULL;
|
||||
V3OutCFile* ofp = nullptr;
|
||||
if (v3Global.opt.lintOnly()) {
|
||||
// Unfortunately we have some lint checks here, so we can't just skip processing.
|
||||
// We should move them to a different stage.
|
||||
|
@ -1401,7 +1401,7 @@ class EmitCImp : EmitCStmts {
|
|||
string recName;
|
||||
if (v3Global.opt.profThreads()) {
|
||||
recName = "__Vprfthr_" + cvtToStr(curExecMTaskp->id());
|
||||
puts("VlProfileRec* " + recName + " = NULL;\n");
|
||||
puts("VlProfileRec* " + recName + " = nullptr;\n");
|
||||
// Leave this if() here, as don't want to call VL_RDTSC_Q unless profiling
|
||||
puts("if (VL_UNLIKELY(vlTOPp->__Vm_profile_cycle_start)) {\n");
|
||||
puts(recName + " = vlTOPp->__Vm_threadPoolp->profileAppend();\n");
|
||||
|
@ -1772,7 +1772,7 @@ class EmitCImp : EmitCStmts {
|
|||
|
||||
public:
|
||||
EmitCImp() {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_slow = false;
|
||||
m_fast = false;
|
||||
}
|
||||
|
@ -1934,7 +1934,7 @@ void EmitCStmts::emitOpName(AstNode* nodep, const string& format, AstNode* lhsp,
|
|||
} else if (pos[0] == '%') {
|
||||
++pos;
|
||||
bool detail = false;
|
||||
AstNode* detailp = NULL;
|
||||
AstNode* detailp = nullptr;
|
||||
switch (pos[0]) {
|
||||
case '%': puts("%"); break;
|
||||
case 'k': putbs(""); break;
|
||||
|
@ -1961,7 +1961,7 @@ void EmitCStmts::emitOpName(AstNode* nodep, const string& format, AstNode* lhsp,
|
|||
COMMA;
|
||||
puts(m_wideTempRefp->hiernameProtect());
|
||||
puts(m_wideTempRefp->varp()->nameProtect());
|
||||
m_wideTempRefp = NULL;
|
||||
m_wideTempRefp = nullptr;
|
||||
needComma = true;
|
||||
}
|
||||
break;
|
||||
|
@ -2125,7 +2125,7 @@ void EmitCStmts::displayEmit(AstNode* nodep, bool isScan) {
|
|||
void EmitCStmts::displayArg(AstNode* dispp, AstNode** elistp, bool isScan, const string& vfmt,
|
||||
bool ignore, char fmtLetter) {
|
||||
// Print display argument, edits elistp
|
||||
AstNode* argp = NULL;
|
||||
AstNode* argp = nullptr;
|
||||
if (!ignore) {
|
||||
argp = *elistp;
|
||||
// Prep for next parameter
|
||||
|
@ -2161,10 +2161,10 @@ void EmitCStmts::displayArg(AstNode* dispp, AstNode** elistp, bool isScan, const
|
|||
}
|
||||
emitDispState.pushFormat(pfmt);
|
||||
if (!ignore) {
|
||||
emitDispState.pushArg(' ', NULL, cvtToStr(argp->widthMin()));
|
||||
emitDispState.pushArg(' ', nullptr, cvtToStr(argp->widthMin()));
|
||||
emitDispState.pushArg(fmtLetter, argp, "");
|
||||
} else {
|
||||
emitDispState.pushArg(fmtLetter, NULL, "");
|
||||
emitDispState.pushArg(fmtLetter, nullptr, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2247,7 +2247,7 @@ void EmitCStmts::displayNode(AstNode* nodep, AstScopeName* scopenamep, const str
|
|||
} else {
|
||||
emitDispState.pushFormat("%N"); // Add a . when needed
|
||||
}
|
||||
emitDispState.pushArg(' ', NULL, "vlSymsp->name()");
|
||||
emitDispState.pushArg(' ', nullptr, "vlSymsp->name()");
|
||||
emitDispState.pushFormat(suffix);
|
||||
break;
|
||||
}
|
||||
|
@ -2307,7 +2307,7 @@ void EmitCImp::emitMTaskVertexCtors(bool* firstp) {
|
|||
|
||||
// This will flip to 'true' before the start of the 0th cycle.
|
||||
emitCtorSep(firstp);
|
||||
puts("__Vm_threadPoolp(NULL)");
|
||||
puts("__Vm_threadPoolp(nullptr)");
|
||||
if (v3Global.opt.profThreads()) {
|
||||
emitCtorSep(firstp);
|
||||
puts("__Vm_profile_cycle_start(0)");
|
||||
|
@ -2438,7 +2438,7 @@ void EmitCImp::emitDestructorImp(AstNodeModule* modp) {
|
|||
puts(prefixNameProtect(modp) + "::~" + prefixNameProtect(modp) + "() {\n");
|
||||
if (modp->isTop()) {
|
||||
if (v3Global.opt.mtasks()) {
|
||||
puts("VL_DO_CLEAR(delete __Vm_threadPoolp, __Vm_threadPoolp = NULL);\n");
|
||||
puts("VL_DO_CLEAR(delete __Vm_threadPoolp, __Vm_threadPoolp = nullptr);\n");
|
||||
}
|
||||
// Call via function in __Trace.cpp as this .cpp file does not have trace header
|
||||
if (v3Global.needTraceDumper()) {
|
||||
|
@ -2448,7 +2448,7 @@ void EmitCImp::emitDestructorImp(AstNodeModule* modp) {
|
|||
}
|
||||
}
|
||||
emitTextSection(AstType::atScDtor);
|
||||
if (modp->isTop()) puts("VL_DO_CLEAR(delete __VlSymsp, __VlSymsp = NULL);\n");
|
||||
if (modp->isTop()) puts("VL_DO_CLEAR(delete __VlSymsp, __VlSymsp = nullptr);\n");
|
||||
puts("}\n");
|
||||
splitSizeInc(10);
|
||||
}
|
||||
|
@ -3252,7 +3252,7 @@ void EmitCImp::maybeSplit(AstNodeModule* fileModp) {
|
|||
// Splitting file, so using parallel build.
|
||||
v3Global.useParallelBuild(true);
|
||||
// Close old file
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
// Open a new file
|
||||
m_ofp = newOutCFile(fileModp, !m_fast, true /*source*/, splitFilenumInc());
|
||||
emitImpTop(fileModp);
|
||||
|
@ -3278,7 +3278,7 @@ void EmitCImp::mainInt(AstNodeModule* modp) {
|
|||
m_modp = modp;
|
||||
}
|
||||
ofp()->putsEndGuard();
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
|
||||
void EmitCImp::mainImp(AstNodeModule* modp, bool slow) {
|
||||
|
@ -3321,7 +3321,7 @@ void EmitCImp::mainImp(AstNodeModule* modp, bool slow) {
|
|||
}
|
||||
}
|
||||
}
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
|
||||
//######################################################################
|
||||
|
@ -3375,7 +3375,7 @@ class EmitCTrace : EmitCStmts {
|
|||
|
||||
if (v3Global.needTraceDumper() && !optSystemC()) {
|
||||
puts("void " + topClassName() + "::_traceDump() {\n");
|
||||
// Caller checked for __Vm_dumperp non-NULL
|
||||
// Caller checked for __Vm_dumperp non-nullptr
|
||||
puts("const VerilatedLockGuard lock(__VlSymsp->__Vm_dumperMutex);\n");
|
||||
puts("__VlSymsp->__Vm_dumperp->dump(VL_TIME_Q());\n");
|
||||
puts("}\n");
|
||||
|
@ -3399,7 +3399,8 @@ class EmitCTrace : EmitCStmts {
|
|||
puts("void " + topClassName() + "::_traceDumpClose() {\n");
|
||||
puts("const VerilatedLockGuard lock(__VlSymsp->__Vm_dumperMutex);\n");
|
||||
puts("__VlSymsp->__Vm_dumping = false;\n");
|
||||
puts("VL_DO_CLEAR(delete __VlSymsp->__Vm_dumperp, __VlSymsp->__Vm_dumperp = NULL);\n");
|
||||
puts("VL_DO_CLEAR(delete __VlSymsp->__Vm_dumperp, __VlSymsp->__Vm_dumperp = "
|
||||
"nullptr);\n");
|
||||
puts("}\n");
|
||||
splitSizeInc(10);
|
||||
}
|
||||
|
@ -3672,7 +3673,7 @@ class EmitCTrace : EmitCStmts {
|
|||
// Splitting file, so using parallel build.
|
||||
v3Global.useParallelBuild(true);
|
||||
// Close old file
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
// Open a new file
|
||||
newOutCFile(splitFilenumInc());
|
||||
}
|
||||
|
@ -3736,7 +3737,7 @@ class EmitCTrace : EmitCStmts {
|
|||
}
|
||||
puts("}\n");
|
||||
}
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
}
|
||||
virtual void visit(AstTraceDecl* nodep) override {
|
||||
int enumNum = emitTraceDeclDType(nodep->dtypep());
|
||||
|
@ -3764,7 +3765,7 @@ class EmitCTrace : EmitCStmts {
|
|||
|
||||
public:
|
||||
explicit EmitCTrace(bool slow) {
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
m_slow = slow;
|
||||
m_enumNum = 0;
|
||||
}
|
||||
|
@ -3777,7 +3778,7 @@ public:
|
|||
|
||||
iterate(v3Global.rootp());
|
||||
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
|
||||
// CONSTRUCTORS
|
||||
EmitCBaseVisitor() {
|
||||
m_ofp = NULL;
|
||||
m_ofp = nullptr;
|
||||
m_trackText = false;
|
||||
}
|
||||
virtual ~EmitCBaseVisitor() {}
|
||||
|
|
|
@ -345,7 +345,7 @@ class EmitCSyms : EmitCBaseVisitor {
|
|||
if (nodep->dpiImport() || nodep->dpiExportWrapper()) m_dpis.push_back(nodep);
|
||||
m_funcp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_funcp = NULL;
|
||||
m_funcp = nullptr;
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
|
@ -355,12 +355,12 @@ class EmitCSyms : EmitCBaseVisitor {
|
|||
public:
|
||||
explicit EmitCSyms(AstNetlist* nodep, bool dpiHdrOnly)
|
||||
: m_dpiHdrOnly(dpiHdrOnly) {
|
||||
m_funcp = NULL;
|
||||
m_modp = NULL;
|
||||
m_funcp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_coverBins = 0;
|
||||
m_numStmts = 0;
|
||||
m_funcNum = 0;
|
||||
m_ofpBase = NULL;
|
||||
m_ofpBase = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
};
|
||||
|
@ -496,14 +496,14 @@ void EmitCSyms::emitSymHdr() {
|
|||
puts("} VL_ATTR_ALIGNED(VL_CACHE_LINE_BYTES);\n");
|
||||
|
||||
ofp()->putsEndGuard();
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
|
||||
void EmitCSyms::closeSplit() {
|
||||
if (!m_ofp || m_ofp == m_ofpBase) return;
|
||||
|
||||
puts("}\n");
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
|
||||
void EmitCSyms::checkSplit(bool usesVfinal) {
|
||||
|
@ -617,7 +617,7 @@ void EmitCSyms::emitSymImp() {
|
|||
puts(" : __Vm_namep(namep)\n"); // No leak, as gets destroyed when the top is destroyed
|
||||
if (v3Global.needTraceDumper()) {
|
||||
puts(" , __Vm_dumping(false)\n");
|
||||
puts(" , __Vm_dumperp(NULL)\n");
|
||||
puts(" , __Vm_dumperp(nullptr)\n");
|
||||
}
|
||||
if (v3Global.opt.trace()) {
|
||||
puts(" , __Vm_activity(false)\n");
|
||||
|
@ -835,7 +835,7 @@ void EmitCSyms::emitSymImp() {
|
|||
|
||||
m_ofpBase->puts("}\n");
|
||||
closeSplit();
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = NULL);
|
||||
VL_DO_CLEAR(delete m_ofp, m_ofp = nullptr);
|
||||
}
|
||||
|
||||
//######################################################################
|
||||
|
|
|
@ -229,7 +229,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||
visitNodeDisplay(nodep, nodep->filep(), nodep->fmtp()->text(), nodep->fmtp()->exprsp());
|
||||
}
|
||||
virtual void visit(AstElabDisplay* nodep) override {
|
||||
visitNodeDisplay(nodep, NULL, nodep->fmtp()->text(), nodep->fmtp()->exprsp());
|
||||
visitNodeDisplay(nodep, nullptr, nodep->fmtp()->text(), nodep->fmtp()->exprsp());
|
||||
}
|
||||
virtual void visit(AstFScanF* nodep) override {
|
||||
visitNodeDisplay(nodep, nodep->filep(), nodep->text(), nodep->exprsp());
|
||||
|
@ -241,7 +241,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||
visitNodeDisplay(nodep, nodep->lhsp(), nodep->fmtp()->text(), nodep->fmtp()->exprsp());
|
||||
}
|
||||
virtual void visit(AstSFormatF* nodep) override {
|
||||
visitNodeDisplay(nodep, NULL, nodep->text(), nodep->exprsp());
|
||||
visitNodeDisplay(nodep, nullptr, nodep->text(), nodep->exprsp());
|
||||
}
|
||||
virtual void visit(AstFOpen* nodep) override {
|
||||
putfs(nodep, nodep->verilogKwd());
|
||||
|
@ -407,9 +407,9 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||
}
|
||||
|
||||
// Operators
|
||||
virtual void emitVerilogFormat(AstNode* nodep, const string& format, AstNode* lhsp = NULL,
|
||||
AstNode* rhsp = NULL, AstNode* thsp = NULL,
|
||||
AstNode* fhsp = NULL) {
|
||||
virtual void emitVerilogFormat(AstNode* nodep, const string& format, AstNode* lhsp = nullptr,
|
||||
AstNode* rhsp = nullptr, AstNode* thsp = nullptr,
|
||||
AstNode* fhsp = nullptr) {
|
||||
// Look at emitVerilog() format for term/uni/dual/triops,
|
||||
// and write out appropriate text.
|
||||
// %f Potential fileline-if-change and line break
|
||||
|
@ -640,7 +640,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||
virtual void visit(AstActive* nodep) override {
|
||||
m_sensesp = nodep->sensesp();
|
||||
iterateAndNextNull(nodep->stmtsp());
|
||||
m_sensesp = NULL;
|
||||
m_sensesp = nullptr;
|
||||
}
|
||||
virtual void visit(AstVarScope*) override {}
|
||||
virtual void visit(AstNodeText*) override {}
|
||||
|
@ -659,7 +659,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
|||
|
||||
public:
|
||||
bool m_suppressVarSemi; // Suppress emitting semicolon for AstVars
|
||||
explicit EmitVBaseVisitor(AstSenTree* domainp = NULL) {
|
||||
explicit EmitVBaseVisitor(AstSenTree* domainp = nullptr) {
|
||||
// Domain for printing one a ALWAYS under a ACTIVE
|
||||
m_suppressSemi = false;
|
||||
m_suppressVarSemi = false;
|
||||
|
@ -751,8 +751,9 @@ public:
|
|||
, m_prefix(prefix)
|
||||
, m_flWidth(flWidth) {
|
||||
m_column = 0;
|
||||
m_prefixFl = v3Global.rootp()
|
||||
->fileline(); // NETLIST's fileline instead of NULL to avoid NULL checks
|
||||
m_prefixFl
|
||||
= v3Global.rootp()
|
||||
->fileline(); // NETLIST's fileline instead of nullptr to avoid nullptr checks
|
||||
}
|
||||
virtual ~EmitVPrefixedFormatter() {
|
||||
if (m_column) puts("\n");
|
||||
|
|
|
@ -40,7 +40,7 @@ bool V3Error::s_describedEachWarn[V3ErrorCode::_ENUM_MAX];
|
|||
bool V3Error::s_describedWarnings = false;
|
||||
bool V3Error::s_pretendError[V3ErrorCode::_ENUM_MAX];
|
||||
V3Error::MessagesSet V3Error::s_messages;
|
||||
V3Error::ErrorExitCb V3Error::s_errorExitCb = NULL;
|
||||
V3Error::ErrorExitCb V3Error::s_errorExitCb = nullptr;
|
||||
|
||||
struct v3errorIniter {
|
||||
v3errorIniter() { V3Error::init(); }
|
||||
|
|
|
@ -341,7 +341,7 @@ private:
|
|||
AstNode* lowp = new AstShiftR(nodep->fileline(), lowwordp, newSelBitBit(nodep->lsbp()),
|
||||
nodep->width());
|
||||
// If > 1 bit, we might be crossing the word boundary
|
||||
AstNode* midp = NULL;
|
||||
AstNode* midp = nullptr;
|
||||
V3Number zero(nodep, longOrQuadWidth(nodep));
|
||||
if (nodep->widthConst() > 1) {
|
||||
AstNode* midwordp = // SEL(from,[1+wordnum])
|
||||
|
@ -378,7 +378,7 @@ private:
|
|||
}
|
||||
}
|
||||
// If > 32 bits, we might be crossing the second word boundary
|
||||
AstNode* hip = NULL;
|
||||
AstNode* hip = nullptr;
|
||||
if (nodep->widthConst() > VL_EDATASIZE) {
|
||||
AstNode* hiwordp = // SEL(from,[2+wordnum])
|
||||
newWordSel(nodep->fromp()->fileline(), nodep->fromp()->cloneTree(true),
|
||||
|
@ -710,11 +710,11 @@ private:
|
|||
iterateChildren(nodep);
|
||||
UINFO(8, " Wordize ChangeXor " << nodep << endl);
|
||||
// -> (0=={or{for each_word{WORDSEL(lhs,#)^WORDSEL(rhs,#)}}}
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
for (int w = 0; w < nodep->lhsp()->widthWords(); w++) {
|
||||
AstNode* eqp = new AstXor(nodep->fileline(), newAstWordSelClone(nodep->lhsp(), w),
|
||||
newAstWordSelClone(nodep->rhsp(), w));
|
||||
newp = (newp == NULL) ? eqp : (new AstOr(nodep->fileline(), newp, eqp));
|
||||
newp = (newp == nullptr) ? eqp : (new AstOr(nodep->fileline(), newp, eqp));
|
||||
}
|
||||
VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep);
|
||||
}
|
||||
|
@ -725,11 +725,11 @@ private:
|
|||
if (nodep->lhsp()->isWide()) {
|
||||
UINFO(8, " Wordize EQ/NEQ " << nodep << endl);
|
||||
// -> (0=={or{for each_word{WORDSEL(lhs,#)^WORDSEL(rhs,#)}}}
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
for (int w = 0; w < nodep->lhsp()->widthWords(); w++) {
|
||||
AstNode* eqp = new AstXor(nodep->fileline(), newAstWordSelClone(nodep->lhsp(), w),
|
||||
newAstWordSelClone(nodep->rhsp(), w));
|
||||
newp = (newp == NULL) ? eqp : (new AstOr(nodep->fileline(), newp, eqp));
|
||||
newp = (newp == nullptr) ? eqp : (new AstOr(nodep->fileline(), newp, eqp));
|
||||
}
|
||||
if (VN_IS(nodep, Neq)) {
|
||||
newp
|
||||
|
@ -751,10 +751,10 @@ private:
|
|||
if (nodep->lhsp()->isWide()) {
|
||||
UINFO(8, " Wordize REDOR " << nodep << endl);
|
||||
// -> (0!={or{for each_word{WORDSEL(lhs,#)}}}
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
for (int w = 0; w < nodep->lhsp()->widthWords(); w++) {
|
||||
AstNode* eqp = newAstWordSelClone(nodep->lhsp(), w);
|
||||
newp = (newp == NULL) ? eqp : (new AstOr(nodep->fileline(), newp, eqp));
|
||||
newp = (newp == nullptr) ? eqp : (new AstOr(nodep->fileline(), newp, eqp));
|
||||
}
|
||||
newp = new AstNeq(nodep->fileline(),
|
||||
new AstConst(nodep->fileline(), AstConst::SizedEData(), 0), newp);
|
||||
|
@ -775,7 +775,7 @@ private:
|
|||
if (nodep->lhsp()->isWide()) {
|
||||
UINFO(8, " Wordize REDAND " << nodep << endl);
|
||||
// -> (0!={and{for each_word{WORDSEL(lhs,#)}}}
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
for (int w = 0; w < nodep->lhsp()->widthWords(); w++) {
|
||||
AstNode* eqp = newAstWordSelClone(nodep->lhsp(), w);
|
||||
if (w == nodep->lhsp()->widthWords() - 1) {
|
||||
|
@ -787,7 +787,7 @@ private:
|
|||
// cppcheck-suppress memleak
|
||||
eqp);
|
||||
}
|
||||
newp = (newp == NULL) ? eqp : (new AstAnd(nodep->fileline(), newp, eqp));
|
||||
newp = (newp == nullptr) ? eqp : (new AstAnd(nodep->fileline(), newp, eqp));
|
||||
}
|
||||
newp = new AstEq(
|
||||
nodep->fileline(),
|
||||
|
@ -808,10 +808,10 @@ private:
|
|||
if (nodep->lhsp()->isWide()) {
|
||||
UINFO(8, " Wordize REDXOR " << nodep << endl);
|
||||
// -> (0!={redxor{for each_word{XOR(WORDSEL(lhs,#))}}}
|
||||
AstNode* newp = NULL;
|
||||
AstNode* newp = nullptr;
|
||||
for (int w = 0; w < nodep->lhsp()->widthWords(); w++) {
|
||||
AstNode* eqp = newAstWordSelClone(nodep->lhsp(), w);
|
||||
newp = (newp == NULL) ? eqp : (new AstXor(nodep->fileline(), newp, eqp));
|
||||
newp = (newp == nullptr) ? eqp : (new AstXor(nodep->fileline(), newp, eqp));
|
||||
}
|
||||
newp = new AstRedXor(nodep->fileline(), newp);
|
||||
UINFO(8, " Wordize REDXORnew " << newp << endl);
|
||||
|
@ -829,7 +829,7 @@ private:
|
|||
}
|
||||
m_stmtp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_stmtp = NULL;
|
||||
m_stmtp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeAssign* nodep) override {
|
||||
if (nodep->user1SetOnce()) return; // Process once
|
||||
|
@ -869,7 +869,7 @@ private:
|
|||
}
|
||||
// Cleanup common code
|
||||
if (did) VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
|
||||
m_stmtp = NULL;
|
||||
m_stmtp = nullptr;
|
||||
}
|
||||
|
||||
//--------------------
|
||||
|
@ -879,7 +879,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit ExpandVisitor(AstNetlist* nodep) {
|
||||
m_stmtp = NULL;
|
||||
m_stmtp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~ExpandVisitor() {}
|
||||
|
|
|
@ -523,7 +523,7 @@ private:
|
|||
dup2(fd_stdout[P_WR], 1);
|
||||
// And stderr comes from parent
|
||||
|
||||
execl("/bin/sh", "sh", "-c", command.c_str(), static_cast<char*>(NULL));
|
||||
execl("/bin/sh", "sh", "-c", command.c_str(), static_cast<char*>(nullptr));
|
||||
// Don't use v3fatal, we don't share the common structures any more
|
||||
fprintf(stderr, "--pipe-filter: exec failed: %s\n", strerror(errno));
|
||||
_exit(1);
|
||||
|
@ -619,7 +619,7 @@ protected:
|
|||
|
||||
VInFilter::VInFilter(const string& command) { m_impp = new VInFilterImp(command); }
|
||||
VInFilter::~VInFilter() {
|
||||
if (m_impp) VL_DO_CLEAR(delete m_impp, m_impp = NULL);
|
||||
if (m_impp) VL_DO_CLEAR(delete m_impp, m_impp = nullptr);
|
||||
}
|
||||
|
||||
bool VInFilter::readWholefile(const string& filename, VInFilter::StrList& outl) {
|
||||
|
@ -942,12 +942,14 @@ void V3OutFormatter::printf(const char* fmt...) {
|
|||
|
||||
V3OutFile::V3OutFile(const string& filename, V3OutFormatter::Language lang)
|
||||
: V3OutFormatter(filename, lang) {
|
||||
if ((m_fp = V3File::new_fopen_w(filename)) == NULL) { v3fatal("Cannot write " << filename); }
|
||||
if ((m_fp = V3File::new_fopen_w(filename)) == nullptr) {
|
||||
v3fatal("Cannot write " << filename);
|
||||
}
|
||||
}
|
||||
|
||||
V3OutFile::~V3OutFile() {
|
||||
if (m_fp) fclose(m_fp);
|
||||
m_fp = NULL;
|
||||
m_fp = nullptr;
|
||||
}
|
||||
|
||||
void V3OutFile::putsForceIncs() {
|
||||
|
|
|
@ -149,9 +149,9 @@ FileLine::FileLine(FileLine::EmptySecret) {
|
|||
m_firstColumn = 0;
|
||||
m_lastColumn = 0;
|
||||
m_filenameno = singleton().nameToNumber(FileLine::builtInFilename());
|
||||
m_contentp = NULL;
|
||||
m_contentp = nullptr;
|
||||
m_contentLineno = 0;
|
||||
m_parent = NULL;
|
||||
m_parent = nullptr;
|
||||
|
||||
m_warnOn = 0;
|
||||
for (int codei = V3ErrorCode::EC_MIN; codei < V3ErrorCode::_ENUM_MAX; codei++) {
|
||||
|
@ -250,7 +250,7 @@ FileLine* FileLine::copyOrSameFileLine() {
|
|||
#ifndef _V3ERROR_NO_GLOBAL_
|
||||
V3Config::applyIgnores(this); // Toggle warnings based on global config file
|
||||
#endif
|
||||
static FileLine* lastNewp = NULL;
|
||||
static FileLine* lastNewp = nullptr;
|
||||
if (lastNewp && *lastNewp == *this) { // Compares lineno, filename, etc
|
||||
return lastNewp;
|
||||
}
|
||||
|
|
|
@ -132,8 +132,8 @@ public:
|
|||
, m_lastColumn(0)
|
||||
, m_filenameno(singleton().nameToNumber(filename))
|
||||
, m_contentLineno(0)
|
||||
, m_contentp(NULL)
|
||||
, m_parent(NULL)
|
||||
, m_contentp(nullptr)
|
||||
, m_parent(nullptr)
|
||||
, m_warnOn(defaultFileLine().m_warnOn)
|
||||
, m_waive(false) {}
|
||||
explicit FileLine(FileLine* fromp)
|
||||
|
|
|
@ -116,7 +116,7 @@ public:
|
|||
// iterateInEdges() will stop traversing edges if one is deleted
|
||||
VNUser iterateCurrentOutEdges(GateGraphBaseVisitor& v, VNUser vu = VNUser(0)) {
|
||||
VNUser ret = VNUser(0);
|
||||
V3GraphEdge* next_edgep = NULL;
|
||||
V3GraphEdge* next_edgep = nullptr;
|
||||
for (V3GraphEdge* edgep = outBeginp(); edgep; edgep = next_edgep) {
|
||||
// Need to find the next edge before visiting in case the edge is deleted
|
||||
next_edgep = edgep->outNextp();
|
||||
|
@ -138,8 +138,8 @@ public:
|
|||
, m_varScp(varScp)
|
||||
, m_isTop(false)
|
||||
, m_isClock(false)
|
||||
, m_rstSyncNodep(NULL)
|
||||
, m_rstAsyncNodep(NULL) {}
|
||||
, m_rstSyncNodep(nullptr)
|
||||
, m_rstAsyncNodep(nullptr) {}
|
||||
virtual ~GateVarVertex() {}
|
||||
// ACCESSORS
|
||||
AstVarScope* varScp() const { return m_varScp; }
|
||||
|
@ -170,7 +170,7 @@ public:
|
|||
|
||||
class GateLogicVertex : public GateEitherVertex {
|
||||
AstNode* m_nodep;
|
||||
AstActive* m_activep; // Under what active; NULL is ok (under cfunc or such)
|
||||
AstActive* m_activep; // Under what active; nullptr is ok (under cfunc or such)
|
||||
bool m_slow; // In slow block
|
||||
public:
|
||||
GateLogicVertex(V3Graph* graphp, AstScope* scopep, AstNode* nodep, AstActive* activep,
|
||||
|
@ -277,9 +277,9 @@ public:
|
|||
// CONSTRUCTORS
|
||||
GateOkVisitor(AstNode* nodep, bool buffersOnly, bool dedupe) {
|
||||
m_isSimple = true;
|
||||
m_substTreep = NULL;
|
||||
m_substTreep = nullptr;
|
||||
m_buffersOnly = buffersOnly;
|
||||
m_lhsVarRef = NULL;
|
||||
m_lhsVarRef = nullptr;
|
||||
m_dedupe = dedupe;
|
||||
m_ops = 0;
|
||||
// Iterate
|
||||
|
@ -318,7 +318,7 @@ private:
|
|||
|
||||
// STATE
|
||||
V3Graph m_graph; // Scoreboard of var usages/dependencies
|
||||
GateLogicVertex* m_logicVertexp; // Current statement being tracked, NULL=ignored
|
||||
GateLogicVertex* m_logicVertexp; // Current statement being tracked, nullptr=ignored
|
||||
AstScope* m_scopep; // Current scope being processed
|
||||
AstNodeModule* m_modp; // Current module
|
||||
AstActive* m_activep; // Current active
|
||||
|
@ -346,7 +346,7 @@ private:
|
|||
if (consumeReason) m_logicVertexp->setConsumed(consumeReason);
|
||||
if (VN_IS(nodep, SenItem)) m_logicVertexp->setConsumed("senItem");
|
||||
iterateChildren(nodep);
|
||||
m_logicVertexp = NULL;
|
||||
m_logicVertexp = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -428,9 +428,9 @@ private:
|
|||
virtual void visit(AstScope* nodep) override {
|
||||
UINFO(4, " SCOPE " << nodep << endl);
|
||||
m_scopep = nodep;
|
||||
m_logicVertexp = NULL;
|
||||
m_logicVertexp = nullptr;
|
||||
iterateChildren(nodep);
|
||||
m_scopep = NULL;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
// Create required blocks and add to module
|
||||
|
@ -440,7 +440,7 @@ private:
|
|||
AstNode::user2ClearTree();
|
||||
iterateChildren(nodep);
|
||||
AstNode::user2ClearTree();
|
||||
m_activep = NULL;
|
||||
m_activep = nullptr;
|
||||
m_activeReducible = true;
|
||||
}
|
||||
virtual void visit(AstNodeVarRef* nodep) override {
|
||||
|
@ -471,12 +471,12 @@ private:
|
|||
}
|
||||
}
|
||||
virtual void visit(AstAlways* nodep) override {
|
||||
iterateNewStmt(nodep, (nodep->isJustOneBodyStmt() ? NULL : "Multiple Stmts"), NULL);
|
||||
iterateNewStmt(nodep, (nodep->isJustOneBodyStmt() ? nullptr : "Multiple Stmts"), nullptr);
|
||||
}
|
||||
virtual void visit(AstAlwaysPublic* nodep) override {
|
||||
bool lastslow = m_inSlow;
|
||||
m_inSlow = true;
|
||||
iterateNewStmt(nodep, "AlwaysPublic", NULL);
|
||||
iterateNewStmt(nodep, "AlwaysPublic", nullptr);
|
||||
m_inSlow = lastslow;
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) override {
|
||||
|
@ -487,21 +487,21 @@ private:
|
|||
if (m_logicVertexp) { // Already under logic; presumably a SenGate
|
||||
iterateChildren(nodep);
|
||||
} else { // Standalone item, probably right under a SenTree
|
||||
iterateNewStmt(nodep, NULL, NULL);
|
||||
iterateNewStmt(nodep, nullptr, nullptr);
|
||||
}
|
||||
m_inSenItem = false;
|
||||
}
|
||||
virtual void visit(AstInitial* nodep) override {
|
||||
bool lastslow = m_inSlow;
|
||||
m_inSlow = true;
|
||||
iterateNewStmt(nodep, (nodep->isJustOneBodyStmt() ? NULL : "Multiple Stmts"), NULL);
|
||||
iterateNewStmt(nodep, (nodep->isJustOneBodyStmt() ? nullptr : "Multiple Stmts"), nullptr);
|
||||
m_inSlow = lastslow;
|
||||
}
|
||||
virtual void visit(AstAssignAlias* nodep) override { //
|
||||
iterateNewStmt(nodep, NULL, NULL);
|
||||
iterateNewStmt(nodep, nullptr, nullptr);
|
||||
}
|
||||
virtual void visit(AstAssignW* nodep) override { //
|
||||
iterateNewStmt(nodep, NULL, NULL);
|
||||
iterateNewStmt(nodep, nullptr, nullptr);
|
||||
}
|
||||
virtual void visit(AstCoverToggle* nodep) override {
|
||||
iterateNewStmt(nodep, "CoverToggle", "CoverToggle");
|
||||
|
@ -529,10 +529,10 @@ public:
|
|||
// CONSTRUCTORS
|
||||
explicit GateVisitor(AstNode* nodep) {
|
||||
AstNode::user1ClearTree();
|
||||
m_logicVertexp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_modp = NULL;
|
||||
m_activep = NULL;
|
||||
m_logicVertexp = nullptr;
|
||||
m_scopep = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_activep = nullptr;
|
||||
m_activeReducible = true;
|
||||
m_inSenItem = false;
|
||||
m_inSlow = false;
|
||||
|
@ -675,7 +675,7 @@ void GateVisitor::optimizeSignals(bool allowMultiIn) {
|
|||
// optimize it further
|
||||
logicp->unlinkFrBack();
|
||||
vvertexp->varScp()->valuep(logicp);
|
||||
logicp = NULL;
|
||||
logicp = nullptr;
|
||||
// Mark the vertex so we don't mark it as being
|
||||
// unconsumed in the next step
|
||||
vvertexp->user(true);
|
||||
|
@ -787,7 +787,7 @@ void GateVisitor::consumedMove() {
|
|||
}
|
||||
if (GateLogicVertex* lvertexp = dynamic_cast<GateLogicVertex*>(vertexp)) {
|
||||
AstNode* nodep = lvertexp->nodep();
|
||||
AstActive* oldactp = lvertexp->activep(); // NULL under cfunc
|
||||
AstActive* oldactp = lvertexp->activep(); // nullptr under cfunc
|
||||
if (!lvertexp->consumed() && oldactp) {
|
||||
// Eventually: Move the statement to a new active block
|
||||
// with "tracing-on" sensitivity
|
||||
|
@ -895,7 +895,7 @@ public:
|
|||
|
||||
void GateVisitor::optimizeElimVar(AstVarScope* varscp, AstNode* substp, AstNode* consumerp) {
|
||||
if (debug() >= 5) consumerp->dumpTree(cout, " elimUsePre: ");
|
||||
GateElimVisitor elimVisitor(consumerp, varscp, substp, NULL);
|
||||
GateElimVisitor elimVisitor(consumerp, varscp, substp, nullptr);
|
||||
if (elimVisitor.didReplace()) {
|
||||
if (debug() >= 9) consumerp->dumpTree(cout, " elimUseCns: ");
|
||||
// Caution: Can't let V3Const change our handle to consumerp, such as by
|
||||
|
@ -920,9 +920,9 @@ private:
|
|||
// NODE STATE
|
||||
// Ast*::user2p -> parent AstNodeAssign* for this rhsp
|
||||
// Ast*::user3p -> AstActive* of assign, for isSame() in test for duplicate
|
||||
// Set to NULL if this assign's tree was later replaced
|
||||
// Set to nullptr if this assign's tree was later replaced
|
||||
// Ast*::user5p -> AstNode* of assign if condition, for isSame() in test for duplicate
|
||||
// Set to NULL if this assign's tree was later replaced
|
||||
// Set to nullptr if this assign's tree was later replaced
|
||||
// AstUser1InUse m_inuser1; (Allocated for use in GateVisitor)
|
||||
// AstUser2InUse m_inuser2; (Allocated for use in GateVisitor)
|
||||
AstUser3InUse m_inuser3;
|
||||
|
@ -935,7 +935,7 @@ private:
|
|||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
||||
void hash(AstNode* nodep) {
|
||||
// !NULL && the object is hashable
|
||||
// !nullptr && the object is hashable
|
||||
if (nodep && !nodep->sameHash().isIllegal()) m_hashed.hash(nodep);
|
||||
}
|
||||
bool sameHash(AstNode* node1p, AstNode* node2p) {
|
||||
|
@ -985,7 +985,8 @@ public:
|
|||
}
|
||||
|
||||
AstNodeAssign* hashAndFindDupe(AstNodeAssign* assignp, AstNode* extra1p, AstNode* extra2p) {
|
||||
// Legal for extra1p/2p to be NULL, we'll compare with other assigns with extras also NULL
|
||||
// Legal for extra1p/2p to be nullptr, we'll compare with other assigns with extras also
|
||||
// nullptr
|
||||
AstNode* rhsp = assignp->rhsp();
|
||||
rhsp->user2p(assignp);
|
||||
rhsp->user3p(extra1p);
|
||||
|
@ -1004,7 +1005,7 @@ public:
|
|||
return VN_CAST(m_hashed.iteratorNodep(dupit)->user2p(), NodeAssign);
|
||||
}
|
||||
// Retain new inserted information
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void check() {
|
||||
|
@ -1094,16 +1095,16 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
GateDedupeVarVisitor() {
|
||||
m_assignp = NULL;
|
||||
m_ifCondp = NULL;
|
||||
m_assignp = nullptr;
|
||||
m_ifCondp = nullptr;
|
||||
m_always = false;
|
||||
m_dedupable = true;
|
||||
}
|
||||
~GateDedupeVarVisitor() {}
|
||||
// PUBLIC METHODS
|
||||
AstNodeVarRef* findDupe(AstNode* nodep, AstVarScope* consumerVarScopep, AstActive* activep) {
|
||||
m_assignp = NULL;
|
||||
m_ifCondp = NULL;
|
||||
m_assignp = nullptr;
|
||||
m_ifCondp = nullptr;
|
||||
m_always = false;
|
||||
m_dedupable = true;
|
||||
iterate(nodep);
|
||||
|
@ -1118,7 +1119,7 @@ public:
|
|||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void hashReplace(AstNode* oldp, AstNode* newp) { m_ghash.hashReplace(oldp, newp); }
|
||||
};
|
||||
|
@ -1157,7 +1158,7 @@ private:
|
|||
V3GraphEdge* edgep = vvertexp->inBeginp();
|
||||
GateLogicVertex* lvertexp = static_cast<GateLogicVertex*>(edgep->fromp());
|
||||
UASSERT_OBJ(vvertexp->dedupable(), vvertexp->varScp(),
|
||||
"GateLogicVertex* visit should have returned NULL "
|
||||
"GateLogicVertex* visit should have returned nullptr "
|
||||
"if consumer var vertex is not dedupable.");
|
||||
GateOkVisitor okVisitor(lvertexp->nodep(), false, true);
|
||||
if (okVisitor.isSimple()) {
|
||||
|
@ -1197,7 +1198,7 @@ private:
|
|||
AstNode* lvertexNodep = lvertexp->nodep();
|
||||
lvertexNodep->unlinkFrBack();
|
||||
vvertexp->varScp()->valuep(lvertexNodep);
|
||||
lvertexNodep = NULL;
|
||||
lvertexNodep = nullptr;
|
||||
vvertexp->user(true);
|
||||
lvertexp->user(true);
|
||||
}
|
||||
|
@ -1208,7 +1209,7 @@ private:
|
|||
}
|
||||
|
||||
// Given iterated logic, starting at vu which was consumer's GateVarVertex
|
||||
// Returns a varref that has the same logic input; or NULL if none
|
||||
// Returns a varref that has the same logic input; or nullptr if none
|
||||
virtual VNUser visit(GateLogicVertex* lvertexp, VNUser vu) {
|
||||
lvertexp->iterateInEdges(*this);
|
||||
|
||||
|
@ -1274,18 +1275,18 @@ private:
|
|||
AstVarRef* preVarRefp = VN_CAST(pre->fromp(), VarRef);
|
||||
AstVarRef* curVarRefp = VN_CAST(cur->fromp(), VarRef);
|
||||
if (!preVarRefp || !curVarRefp || !curVarRefp->same(preVarRefp)) {
|
||||
return NULL; // not the same var
|
||||
return nullptr; // not the same var
|
||||
}
|
||||
const AstConst* pstart = VN_CAST(pre->lsbp(), Const);
|
||||
const AstConst* pwidth = VN_CAST(pre->widthp(), Const);
|
||||
const AstConst* cstart = VN_CAST(cur->lsbp(), Const);
|
||||
const AstConst* cwidth = VN_CAST(cur->widthp(), Const);
|
||||
if (!pstart || !pwidth || !cstart || !cwidth) return NULL; // too complicated
|
||||
if (!pstart || !pwidth || !cstart || !cwidth) return nullptr; // too complicated
|
||||
if (cur->lsbConst() + cur->widthConst() == pre->lsbConst()) {
|
||||
return new AstSel(curVarRefp->fileline(), curVarRefp->cloneTree(false),
|
||||
cur->lsbConst(), pre->widthConst() + cur->widthConst());
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1369,9 +1370,9 @@ private:
|
|||
public:
|
||||
explicit GateMergeAssignsGraphVisitor(V3Graph* graphp)
|
||||
: GateGraphBaseVisitor(graphp) {
|
||||
m_assignp = NULL;
|
||||
m_activep = NULL;
|
||||
m_logicvp = NULL;
|
||||
m_assignp = nullptr;
|
||||
m_activep = nullptr;
|
||||
m_logicvp = nullptr;
|
||||
m_numMergedAssigns = 0;
|
||||
m_graphp = graphp;
|
||||
}
|
||||
|
@ -1427,7 +1428,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
GateConcatVisitor() {
|
||||
m_vscp = NULL;
|
||||
m_vscp = nullptr;
|
||||
m_offset = 0;
|
||||
m_found_offset = 0;
|
||||
m_found = false;
|
||||
|
@ -1558,8 +1559,8 @@ public:
|
|||
explicit GateClkDecompGraphVisitor(V3Graph* graphp)
|
||||
: GateGraphBaseVisitor(graphp) {
|
||||
m_seen_clk_vectors = 0;
|
||||
m_clk_vsp = NULL;
|
||||
m_clk_vvertexp = NULL;
|
||||
m_clk_vsp = nullptr;
|
||||
m_clk_vvertexp = nullptr;
|
||||
m_total_seen_clk_vectors = 0;
|
||||
m_total_decomposed_clk_vectors = 0;
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ private:
|
|||
m_activep = nodep;
|
||||
UASSERT_OBJ(nodep->sensesp(), nodep, "Unlinked");
|
||||
iterateChildren(nodep->sensesp()); // iterateAndNext?
|
||||
m_activep = NULL;
|
||||
m_activep = nullptr;
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) override { iterateChildren(nodep); }
|
||||
|
@ -120,8 +120,8 @@ public:
|
|||
// CONSTRUCTORS
|
||||
GenClkRenameVisitor(AstTopScope* nodep, AstNodeModule* topModp) {
|
||||
m_topModp = topModp;
|
||||
m_scopetopp = NULL;
|
||||
m_activep = NULL;
|
||||
m_scopetopp = nullptr;
|
||||
m_activep = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~GenClkRenameVisitor() {}
|
||||
|
@ -199,14 +199,14 @@ private:
|
|||
// UINFO(8, "ASS " << nodep << endl);
|
||||
m_assignp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_assignp = NULL;
|
||||
m_assignp = nullptr;
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
UINFO(8, "ACTIVE " << nodep << endl);
|
||||
m_activep = nodep;
|
||||
UASSERT_OBJ(nodep->sensesp(), nodep, "Unlinked");
|
||||
iterateChildren(nodep->sensesp()); // iterateAndNext?
|
||||
m_activep = NULL;
|
||||
m_activep = nullptr;
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
|
||||
|
@ -217,10 +217,10 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit GenClkReadVisitor(AstNetlist* nodep)
|
||||
: m_activep(NULL)
|
||||
: m_activep(nullptr)
|
||||
, m_tracingCall(false)
|
||||
, m_assignp(NULL)
|
||||
, m_topModp(NULL) {
|
||||
, m_assignp(nullptr)
|
||||
, m_topModp(nullptr) {
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~GenClkReadVisitor() {}
|
||||
|
|
|
@ -36,7 +36,7 @@ AstNetlist* V3Global::makeNetlist() {
|
|||
}
|
||||
|
||||
void V3Global::shutdown() {
|
||||
VL_DO_CLEAR(delete m_hierPlanp, m_hierPlanp = NULL); // delete nullptr is safe
|
||||
VL_DO_CLEAR(delete m_hierPlanp, m_hierPlanp = nullptr); // delete nullptr is safe
|
||||
}
|
||||
|
||||
void V3Global::checkTree() { rootp()->checkTree(); }
|
||||
|
|
|
@ -70,7 +70,7 @@ inline bool operator==(VWidthMinUsage::en lhs, const VWidthMinUsage& rhs) {
|
|||
class V3Global {
|
||||
// Globals
|
||||
AstNetlist* m_rootp; // Root of entire netlist
|
||||
V3HierBlockPlan* m_hierPlanp; // Hierarchical verilation plan, NULL unless hier_block
|
||||
V3HierBlockPlan* m_hierPlanp; // Hierarchical verilation plan, nullptr unless hier_block
|
||||
VWidthMinUsage m_widthMinUsage; // What AstNode::widthMin() is used for
|
||||
|
||||
int m_debugFileNumber; // Number to append to debug files created
|
||||
|
@ -92,8 +92,8 @@ public:
|
|||
|
||||
// CONSTRUCTORS
|
||||
V3Global()
|
||||
: m_rootp(NULL) // created by makeInitNetlist() so static constructors run first
|
||||
, m_hierPlanp(NULL) // Set via hierPlanp(V3HierBlockPlan*) when use hier_block
|
||||
: m_rootp(nullptr) // created by makeInitNetlist() so static constructors run first
|
||||
, m_hierPlanp(nullptr) // Set via hierPlanp(V3HierBlockPlan*) when use hier_block
|
||||
, m_widthMinUsage(VWidthMinUsage::LINT_WIDTH)
|
||||
, m_debugFileNumber(0)
|
||||
, m_assertDTypesResolved(false)
|
||||
|
|
|
@ -36,7 +36,7 @@ V3GraphVertex::V3GraphVertex(V3Graph* graphp, const V3GraphVertex& old)
|
|||
: m_fanout(old.m_fanout)
|
||||
, m_color(old.m_color)
|
||||
, m_rank(old.m_rank) {
|
||||
m_userp = NULL;
|
||||
m_userp = nullptr;
|
||||
verticesPushBack(graphp);
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ V3GraphVertex::V3GraphVertex(V3Graph* graphp)
|
|||
: m_fanout(0)
|
||||
, m_color(0)
|
||||
, m_rank(0) {
|
||||
m_userp = NULL;
|
||||
m_userp = nullptr;
|
||||
verticesPushBack(graphp);
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ void V3GraphVertex::unlinkDelete(V3Graph* graphp) {
|
|||
// Unlink from vertex list
|
||||
m_vertices.unlink(graphp->m_vertices, this);
|
||||
// Delete
|
||||
delete this; // this=NULL;
|
||||
delete this; // this=nullptr;
|
||||
}
|
||||
|
||||
void V3GraphVertex::rerouteEdges(V3Graph* graphp) {
|
||||
|
@ -123,7 +123,7 @@ V3GraphEdge* V3GraphVertex::findConnectingEdgep(GraphWay way, const V3GraphVerte
|
|||
aedgep = aedgep->nextp(way);
|
||||
bedgep = bedgep->nextp(inv);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void V3GraphVertex::v3errorEnd(std::ostringstream& str) const {
|
||||
|
@ -165,7 +165,7 @@ void V3GraphEdge::init(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top
|
|||
m_top = top;
|
||||
m_weight = weight;
|
||||
m_cutable = cutable;
|
||||
m_userp = NULL;
|
||||
m_userp = nullptr;
|
||||
// Link vertices to this edge
|
||||
outPushBack();
|
||||
inPushBack();
|
||||
|
@ -185,7 +185,7 @@ void V3GraphEdge::unlinkDelete() {
|
|||
// Unlink to side
|
||||
m_ins.unlink(m_top->m_ins, this);
|
||||
// Delete
|
||||
delete this; // this=NULL;
|
||||
delete this; // this=nullptr;
|
||||
}
|
||||
|
||||
void V3GraphEdge::outPushBack() {
|
||||
|
@ -239,7 +239,7 @@ void V3Graph::userClearVertices() {
|
|||
// down more than help.
|
||||
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) {
|
||||
vertexp->user(0);
|
||||
vertexp->userp(NULL); // Its a union, but might be different size than user()
|
||||
vertexp->userp(nullptr); // Its a union, but might be different size than user()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ void V3Graph::userClearEdges() {
|
|||
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) {
|
||||
for (V3GraphEdge* edgep = vertexp->outBeginp(); edgep; edgep = edgep->outNextp()) {
|
||||
edgep->user(0);
|
||||
edgep->userp(NULL); // Its a union, but might be different size than user()
|
||||
edgep->userp(nullptr); // Its a union, but might be different size than user()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ public:
|
|||
virtual string dotStyle() const { return ""; }
|
||||
virtual string dotName() const { return ""; }
|
||||
virtual uint32_t rankAdder() const { return 1; }
|
||||
virtual FileLine* fileline() const { return NULL; } // NULL for unknown
|
||||
virtual FileLine* fileline() const { return nullptr; } // nullptr for unknown
|
||||
virtual int sortCmp(const V3GraphVertex* rhsp) const {
|
||||
// LHS goes first if of lower rank, or lower fanout
|
||||
if (m_rank < rhsp->m_rank) return -1;
|
||||
|
@ -250,11 +250,11 @@ public:
|
|||
// ITERATORS
|
||||
V3GraphVertex* verticesNextp() const { return m_vertices.nextp(); }
|
||||
V3GraphEdge* inBeginp() const { return m_ins.begin(); }
|
||||
bool inEmpty() const { return inBeginp() == NULL; }
|
||||
bool inEmpty() const { return inBeginp() == nullptr; }
|
||||
bool inSize1() const;
|
||||
uint32_t inHash() const;
|
||||
V3GraphEdge* outBeginp() const { return m_outs.begin(); }
|
||||
bool outEmpty() const { return outBeginp() == NULL; }
|
||||
bool outEmpty() const { return outBeginp() == nullptr; }
|
||||
bool outSize1() const;
|
||||
uint32_t outHash() const;
|
||||
V3GraphEdge* beginp(GraphWay way) const { return way.forward() ? outBeginp() : inBeginp(); }
|
||||
|
@ -265,7 +265,7 @@ public:
|
|||
/// Edges are routed around this vertex to point from "from" directly to "to"
|
||||
void rerouteEdges(V3Graph* graphp);
|
||||
/// Find the edge connecting ap and bp, where bp is wayward from ap.
|
||||
/// If edge is not found returns NULL. O(edges) performance.
|
||||
/// If edge is not found returns nullptr. O(edges) performance.
|
||||
V3GraphEdge* findConnectingEdgep(GraphWay way, const V3GraphVertex* waywardp);
|
||||
};
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ private:
|
|||
void addOrigEdgep(V3GraphEdge* toEdgep, V3GraphEdge* addEdgep) {
|
||||
// Add addEdge (or it's list) to list of edges that break edge represents
|
||||
// Note addEdge may already have a bunch of similar linked edge representations. Yuk.
|
||||
UASSERT(addEdgep, "Adding NULL");
|
||||
UASSERT(addEdgep, "Adding nullptr");
|
||||
if (!toEdgep->userp()) {
|
||||
OrigEdgeList* oep = new OrigEdgeList;
|
||||
m_origEdgeDelp.push_back(oep);
|
||||
|
@ -382,7 +382,7 @@ void GraphAcyc::simplifyDup(GraphAcycVertex* avertexp) {
|
|||
if (avertexp->isDelete()) return;
|
||||
// Clear marks
|
||||
for (V3GraphEdge* edgep = avertexp->outBeginp(); edgep; edgep = edgep->outNextp()) {
|
||||
edgep->top()->userp(NULL);
|
||||
edgep->top()->userp(nullptr);
|
||||
}
|
||||
// Mark edges and detect duplications
|
||||
for (V3GraphEdge *nextp, *edgep = avertexp->outBeginp(); edgep; edgep = nextp) {
|
||||
|
|
|
@ -81,7 +81,7 @@ private:
|
|||
void vertexIterate(V3GraphVertex* vertexp) {
|
||||
// Clear marks
|
||||
for (V3GraphEdge* edgep = vertexp->outBeginp(); edgep; edgep = edgep->outNextp()) {
|
||||
edgep->top()->userp(NULL);
|
||||
edgep->top()->userp(nullptr);
|
||||
}
|
||||
// Mark edges and detect duplications
|
||||
for (V3GraphEdge *nextp, *edgep = vertexp->outBeginp(); edgep; edgep = nextp) {
|
||||
|
@ -140,13 +140,13 @@ void V3Graph::removeRedundantEdgesSum(V3EdgeFuncP edgeFuncp) {
|
|||
class GraphAlgRemoveTransitiveEdges : GraphAlg<> {
|
||||
public:
|
||||
explicit GraphAlgRemoveTransitiveEdges(V3Graph* graphp)
|
||||
: GraphAlg<>(graphp, NULL) {}
|
||||
: GraphAlg<>(graphp, nullptr) {}
|
||||
void go() {
|
||||
GraphPathChecker checker(m_graphp);
|
||||
for (V3GraphVertex* vxp = m_graphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) {
|
||||
V3GraphEdge* deletep = NULL;
|
||||
V3GraphEdge* deletep = nullptr;
|
||||
for (V3GraphEdge* edgep = vxp->outBeginp(); edgep; edgep = edgep->outNextp()) {
|
||||
if (deletep) VL_DO_CLEAR(deletep->unlinkDelete(), deletep = NULL);
|
||||
if (deletep) VL_DO_CLEAR(deletep->unlinkDelete(), deletep = nullptr);
|
||||
// It should be safe to modify the graph, despite using
|
||||
// the GraphPathChecker, as none of the modifications will
|
||||
// change what can be reached from what, nor should they
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
// Algorithms - find starting node
|
||||
|
||||
DfaVertex* DfaGraph::findStart() {
|
||||
DfaVertex* startp = NULL;
|
||||
DfaVertex* startp = nullptr;
|
||||
for (V3GraphVertex* vertexp = this->verticesBeginp(); vertexp;
|
||||
vertexp = vertexp->verticesNextp()) {
|
||||
if (DfaVertex* vvertexp = dynamic_cast<DfaVertex*>(vertexp)) {
|
||||
|
@ -83,7 +83,7 @@ private:
|
|||
return (nfaState(vertexp) && !(vertexp->user() == m_step));
|
||||
}
|
||||
|
||||
DfaVertex* newDfaVertex(DfaVertex* nfaTemplatep = NULL) {
|
||||
DfaVertex* newDfaVertex(DfaVertex* nfaTemplatep = nullptr) {
|
||||
DfaVertex* vertexp = new DfaVertex(graphp());
|
||||
vertexp->color(1); // Mark as dfa
|
||||
if (nfaTemplatep && nfaTemplatep->start()) vertexp->start(true);
|
||||
|
@ -190,7 +190,7 @@ private:
|
|||
return testp; // Identical
|
||||
}
|
||||
}
|
||||
return NULL; // No match
|
||||
return nullptr; // No match
|
||||
}
|
||||
|
||||
void findNfasWithInput(DfaVertex* dfaStatep, const DfaInput& input, DfaStates& nfasWithInput) {
|
||||
|
@ -545,7 +545,7 @@ private:
|
|||
|
||||
void add_complement_edges() {
|
||||
// Find accepting vertex
|
||||
DfaVertex* acceptp = NULL;
|
||||
DfaVertex* acceptp = nullptr;
|
||||
for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp;
|
||||
vertexp = vertexp->verticesNextp()) {
|
||||
if (DfaVertex* vvertexp = dynamic_cast<DfaVertex*>(vertexp)) {
|
||||
|
@ -602,7 +602,7 @@ public:
|
|||
add_complement_edges();
|
||||
if (debug() >= 6) m_graphp->dumpDotFilePrefixed("comp_preswap");
|
||||
|
||||
VL_DO_CLEAR(m_tempNewerReject->unlinkDelete(graphp()), m_tempNewerReject = NULL);
|
||||
VL_DO_CLEAR(m_tempNewerReject->unlinkDelete(graphp()), m_tempNewerReject = nullptr);
|
||||
if (debug() >= 6) m_graphp->dumpDotFilePrefixed("comp_out");
|
||||
}
|
||||
~DfaGraphComplement() {}
|
||||
|
|
|
@ -69,7 +69,7 @@ GraphPathChecker::~GraphPathChecker() {
|
|||
for (V3GraphVertex* vxp = m_graphp->verticesBeginp(); vxp; vxp = vxp->verticesNextp()) {
|
||||
GraphPCNode* nodep = static_cast<GraphPCNode*>(vxp->userp());
|
||||
VL_DO_DANGLING(delete nodep, nodep);
|
||||
vxp->userp(NULL);
|
||||
vxp->userp(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
|
||||
private:
|
||||
bool pathExistsInternal(const V3GraphVertex* ap, const V3GraphVertex* bp,
|
||||
unsigned* costp = NULL);
|
||||
unsigned* costp = nullptr);
|
||||
void initHalfCriticalPaths(GraphWay way, bool checkOnly);
|
||||
void incGeneration() { ++m_generation; }
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ public:
|
|||
// good locality.) V3Order.cpp relies on this to order the logic
|
||||
// vertices within a given mtask without jumping over domains too much.
|
||||
const V3GraphVertex* nextp() {
|
||||
const V3GraphVertex* resultp = NULL;
|
||||
const V3GraphVertex* resultp = nullptr;
|
||||
|
||||
typename ReadyVertices::iterator curIt;
|
||||
if (m_last == m_readyVertices.end()) {
|
||||
|
|
|
@ -136,7 +136,7 @@ void V3Hashed::erase(iterator it) {
|
|||
UINFO(8, " erase " << nodep << endl);
|
||||
UASSERT_OBJ(nodep->user4p(), nodep, "Called removeNode on non-hashed node");
|
||||
m_hashMmap.erase(it);
|
||||
nodep->user4p(NULL); // So we don't allow removeNode again
|
||||
nodep->user4p(nullptr); // So we don't allow removeNode again
|
||||
}
|
||||
|
||||
void V3Hashed::check() {
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
bool sameNodes(AstNode* node1p, AstNode* node2p); // After hashing, and tell if identical
|
||||
void erase(iterator it); // Remove node from structures
|
||||
// Return duplicate in hash, if any, with optional user check for sameness
|
||||
iterator findDuplicate(AstNode* nodep, V3HashedUserSame* checkp = NULL);
|
||||
iterator findDuplicate(AstNode* nodep, V3HashedUserSame* checkp = nullptr);
|
||||
AstNode* iteratorNodep(iterator it) { return it->second; }
|
||||
void dumpFile(const string& filename, bool tree);
|
||||
void dumpFilePrefixed(const string& nameComment, bool tree = false);
|
||||
|
|
|
@ -294,8 +294,8 @@ class HierBlockUsageCollectVisitor : public AstNVisitor {
|
|||
public:
|
||||
HierBlockUsageCollectVisitor(V3HierBlockPlan* planp, AstNetlist* netlist)
|
||||
: m_planp(planp)
|
||||
, m_modp(NULL)
|
||||
, m_hierBlockp(NULL) {
|
||||
, m_modp(nullptr)
|
||||
, m_hierBlockp(nullptr) {
|
||||
|
||||
iterateChildren(netlist);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ private:
|
|||
if (m_modp->modPublic()) cantInline("modPublic", false);
|
||||
|
||||
iterateChildren(nodep);
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
}
|
||||
virtual void visit(AstClass* nodep) override {
|
||||
// TODO allow inlining of modules that have classes
|
||||
|
@ -148,12 +148,12 @@ private:
|
|||
}
|
||||
virtual void visit(AstVarXRef* nodep) override {
|
||||
// Cleanup link until V3LinkDot can correct it
|
||||
nodep->varp(NULL);
|
||||
nodep->varp(nullptr);
|
||||
}
|
||||
virtual void visit(AstNodeFTaskRef* nodep) override {
|
||||
// Cleanup link until V3LinkDot can correct it
|
||||
// MethodCalls not currently supported by inliner, so keep linked
|
||||
if (!nodep->packagep() && !VN_IS(nodep, MethodCall)) nodep->taskp(NULL);
|
||||
if (!nodep->packagep() && !VN_IS(nodep, MethodCall)) nodep->taskp(nullptr);
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstAlways* nodep) override {
|
||||
|
@ -220,7 +220,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit InlineMarkVisitor(AstNode* nodep) {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~InlineMarkVisitor() {
|
||||
|
@ -517,7 +517,7 @@ private:
|
|||
// The cell has been removed so let's make sure we don't leave a reference to it
|
||||
// This dtype may still be in use by the AstAssignVarScope created earlier
|
||||
// but that'll get cleared up later
|
||||
nodep->cellp(NULL);
|
||||
nodep->cellp(nullptr);
|
||||
}
|
||||
}
|
||||
virtual void visit(AstNodeModule* nodep) override {
|
||||
|
@ -615,7 +615,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit InlineVisitor(AstNode* nodep) {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~InlineVisitor() { //
|
||||
|
|
|
@ -54,7 +54,7 @@ private:
|
|||
// VV***** We reset user1p() on each cell!!!
|
||||
AstNode::user1ClearTree();
|
||||
iterateChildren(nodep);
|
||||
m_cellp = NULL;
|
||||
m_cellp = nullptr;
|
||||
}
|
||||
virtual void visit(AstPin* nodep) override {
|
||||
// PIN(p,expr) -> ASSIGNW(VARXREF(p),expr) (if sub's input)
|
||||
|
@ -132,7 +132,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit InstVisitor(AstNetlist* nodep) {
|
||||
m_cellp = NULL;
|
||||
m_cellp = nullptr;
|
||||
//
|
||||
iterate(nodep);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
if (it != m_modVarNameMap.end()) {
|
||||
return it->second;
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
void dump() {
|
||||
|
@ -199,7 +199,7 @@ class InstDeVisitor : public AstNVisitor {
|
|||
// Find all cells with arrays, and convert to non-arrayed
|
||||
private:
|
||||
// STATE
|
||||
AstRange* m_cellRangep; // Range for arrayed instantiations, NULL for normal instantiations
|
||||
AstRange* m_cellRangep; // Range for arrayed instantiations, nullptr for normal instantiations
|
||||
int m_instSelNum; // Current instantiation count 0..N-1
|
||||
InstDeModVarVisitor m_deModVars; // State of variables for current cell module
|
||||
|
||||
|
@ -211,7 +211,7 @@ private:
|
|||
&& VN_IS(VN_CAST(nodep->dtypep(), UnpackArrayDType)->subDTypep(), IfaceRefDType)) {
|
||||
UINFO(8, " dv-vec-VAR " << nodep << endl);
|
||||
AstUnpackArrayDType* arrdtype = VN_CAST(nodep->dtypep(), UnpackArrayDType);
|
||||
AstNode* prevp = NULL;
|
||||
AstNode* prevp = nullptr;
|
||||
for (int i = arrdtype->lsb(); i <= arrdtype->msb(); ++i) {
|
||||
string varNewName = nodep->name() + "__BRA__" + cvtToStr(i) + "__KET__";
|
||||
UINFO(8, "VAR name insert " << varNewName << " " << nodep << endl);
|
||||
|
@ -219,7 +219,7 @@ private:
|
|||
AstIfaceRefDType* ifaceRefp
|
||||
= VN_CAST(arrdtype->subDTypep(), IfaceRefDType)->cloneTree(false);
|
||||
arrdtype->addNextHere(ifaceRefp);
|
||||
ifaceRefp->cellp(NULL);
|
||||
ifaceRefp->cellp(nullptr);
|
||||
|
||||
AstVar* varNewp = nodep->cloneTree(false);
|
||||
varNewp->name(varNewName);
|
||||
|
@ -279,7 +279,7 @@ private:
|
|||
AstUnpackArrayDType* arrdtype = VN_CAST(ifaceVarp->dtypep(), UnpackArrayDType);
|
||||
AstIfaceRefDType* origIfaceRefp
|
||||
= VN_CAST(arrdtype->subDTypep(), IfaceRefDType);
|
||||
origIfaceRefp->cellp(NULL);
|
||||
origIfaceRefp->cellp(nullptr);
|
||||
AstVar* varNewp = ifaceVarp->cloneTree(false);
|
||||
AstIfaceRefDType* ifaceRefp
|
||||
= VN_CAST(arrdtype->subDTypep(), IfaceRefDType)->cloneTree(false);
|
||||
|
@ -305,7 +305,7 @@ private:
|
|||
}
|
||||
|
||||
// Done. Delete original
|
||||
m_cellRangep = NULL;
|
||||
m_cellRangep = nullptr;
|
||||
if (isIface) {
|
||||
ifaceVarp->unlinkFrBack();
|
||||
VL_DO_DANGLING(pushDeletep(ifaceVarp), ifaceVarp);
|
||||
|
@ -313,7 +313,7 @@ private:
|
|||
nodep->unlinkFrBack();
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
} else {
|
||||
m_cellRangep = NULL;
|
||||
m_cellRangep = nullptr;
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
}
|
||||
|
@ -394,20 +394,20 @@ private:
|
|||
AstUnpackArrayDType* pinArrp = VN_CAST(pinVarp->dtypep(), UnpackArrayDType);
|
||||
if (!pinArrp || !VN_IS(pinArrp->subDTypep(), IfaceRefDType)) return;
|
||||
// Arrayed pin/var attaches to arrayed submodule lower port/var, expand it
|
||||
AstNode* prevp = NULL;
|
||||
AstNode* prevPinp = NULL;
|
||||
AstNode* prevp = nullptr;
|
||||
AstNode* prevPinp = nullptr;
|
||||
// Clone the var referenced by the pin, and clone each var referenced by the varref
|
||||
// Clone pin varp:
|
||||
for (int i = pinArrp->lsb(); i <= pinArrp->msb(); ++i) {
|
||||
string varNewName = pinVarp->name() + "__BRA__" + cvtToStr(i) + "__KET__";
|
||||
AstVar* varNewp = NULL;
|
||||
AstVar* varNewp = nullptr;
|
||||
|
||||
// Only clone the var once for all usages of a given child module
|
||||
if (!pinVarp->backp()) {
|
||||
varNewp = m_deModVars.find(varNewName);
|
||||
} else {
|
||||
AstIfaceRefDType* ifaceRefp = VN_CAST(pinArrp->subDTypep(), IfaceRefDType);
|
||||
ifaceRefp->cellp(NULL);
|
||||
ifaceRefp->cellp(nullptr);
|
||||
varNewp = pinVarp->cloneTree(false);
|
||||
varNewp->name(varNewName);
|
||||
varNewp->origName(varNewp->origName() + "__BRA__" + cvtToStr(i) + "__KET__");
|
||||
|
@ -467,7 +467,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit InstDeVisitor(AstNetlist* nodep) {
|
||||
m_cellRangep = NULL;
|
||||
m_cellRangep = nullptr;
|
||||
m_instSelNum = 0;
|
||||
//
|
||||
iterate(nodep);
|
||||
|
@ -516,14 +516,14 @@ public:
|
|||
&& cellp->modp()->unconnectedDrive().isSetFalse()) {
|
||||
pinp->exprp(new AstConst(pinp->fileline(), AstConst::StringToParse(), "'0"));
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
AstVarRef* connectRefp = VN_CAST(pinp->exprp(), VarRef);
|
||||
AstVarXRef* connectXRefp = VN_CAST(pinp->exprp(), VarXRef);
|
||||
AstBasicDType* pinBasicp = VN_CAST(pinVarp->dtypep(), BasicDType); // Maybe NULL
|
||||
AstBasicDType* connBasicp = NULL;
|
||||
AstAssignW* assignp = NULL;
|
||||
AstBasicDType* pinBasicp = VN_CAST(pinVarp->dtypep(), BasicDType); // Maybe nullptr
|
||||
AstBasicDType* connBasicp = nullptr;
|
||||
AstAssignW* assignp = nullptr;
|
||||
if (connectRefp) connBasicp = VN_CAST(connectRefp->varp()->dtypep(), BasicDType);
|
||||
//
|
||||
if (!alwaysCvt && connectRefp && connectRefp->varp()->dtypep()->sameTree(pinVarp->dtypep())
|
||||
|
|
|
@ -276,7 +276,7 @@ public:
|
|||
InstrCountDumpVisitor(AstNode* nodep, std::ostream* osp)
|
||||
: m_osp(osp)
|
||||
, m_depth(0) {
|
||||
// No check for NULL output, so...
|
||||
// No check for nullptr output, so...
|
||||
UASSERT_OBJ(osp, nodep, "Don't call if not dumping");
|
||||
if (nodep) iterate(nodep);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
// if we see the same node twice (across more than one call to count,
|
||||
// potentially) raises an error.
|
||||
// Optional osp is stream to dump critical path to.
|
||||
static uint32_t count(AstNode* nodep, bool assertNoDups, std::ostream* osp = NULL);
|
||||
static uint32_t count(AstNode* nodep, bool assertNoDups, std::ostream* osp = nullptr);
|
||||
};
|
||||
|
||||
#endif // guard
|
||||
|
|
|
@ -56,7 +56,7 @@ private:
|
|||
inline void V3LanguageWords::Singleton::init() {
|
||||
// C++ keywords
|
||||
// clang-format off
|
||||
addKwd("NULL", "C++ common word");
|
||||
addKwd("nullptr", "C++ common word");
|
||||
addKwd("abort", "C++ common word");
|
||||
addKwd("alignas", "C++11 keyword");
|
||||
addKwd("alignof", "C++11 keyword");
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
// Structure for each variable encountered
|
||||
|
||||
class LifeVarEntry {
|
||||
AstNodeAssign* m_assignp; // Last assignment to this varscope, NULL if no longer relevant
|
||||
AstNodeAssign* m_assignp; // Last assignment to this varscope, nullptr if no longer relevant
|
||||
AstConst* m_constp; // Known constant value
|
||||
// First access was a set (and thus block above may have a set that can be deleted
|
||||
bool m_setBeforeUse;
|
||||
|
@ -77,8 +77,8 @@ class LifeVarEntry {
|
|||
bool m_everSet;
|
||||
|
||||
inline void init(bool setBeforeUse) {
|
||||
m_assignp = NULL;
|
||||
m_constp = NULL;
|
||||
m_assignp = nullptr;
|
||||
m_constp = nullptr;
|
||||
m_setBeforeUse = setBeforeUse;
|
||||
m_everSet = false;
|
||||
}
|
||||
|
@ -103,17 +103,17 @@ public:
|
|||
~LifeVarEntry() {}
|
||||
inline void simpleAssign(AstNodeAssign* assp) { // New simple A=.... assignment
|
||||
m_assignp = assp;
|
||||
m_constp = NULL;
|
||||
m_constp = nullptr;
|
||||
m_everSet = true;
|
||||
if (VN_IS(assp->rhsp(), Const)) m_constp = VN_CAST(assp->rhsp(), Const);
|
||||
}
|
||||
inline void complexAssign() { // A[x]=... or some complicated assignment
|
||||
m_assignp = NULL;
|
||||
m_constp = NULL;
|
||||
m_assignp = nullptr;
|
||||
m_constp = nullptr;
|
||||
m_everSet = true;
|
||||
}
|
||||
inline void consumed() { // Rvalue read of A
|
||||
m_assignp = NULL;
|
||||
m_assignp = nullptr;
|
||||
}
|
||||
AstNodeAssign* assignp() const { return m_assignp; }
|
||||
AstConst* constNodep() const { return m_constp; }
|
||||
|
@ -133,7 +133,7 @@ class LifeBlock {
|
|||
// For each basic block, we'll make a new map of what variables that if/else is changing
|
||||
typedef std::map<AstVarScope*, LifeVarEntry> LifeMap;
|
||||
LifeMap m_map; // Current active lifetime map for current scope
|
||||
LifeBlock* m_aboveLifep; // Upper life, or NULL
|
||||
LifeBlock* m_aboveLifep; // Upper life, or nullptr
|
||||
LifeState* m_statep; // Current global state
|
||||
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
|
@ -297,7 +297,7 @@ private:
|
|||
virtual void visit(AstVarRef* nodep) override {
|
||||
// Consumption/generation of a variable,
|
||||
// it's used so can't elim assignment before this use.
|
||||
UASSERT_OBJ(nodep->varScopep(), nodep, "NULL");
|
||||
UASSERT_OBJ(nodep->varScopep(), nodep, "nullptr");
|
||||
//
|
||||
AstVarScope* vscp = nodep->varScopep();
|
||||
UASSERT_OBJ(vscp, nodep, "Scope not assigned");
|
||||
|
@ -448,13 +448,13 @@ public:
|
|||
m_noopt = false;
|
||||
m_tracingCall = false;
|
||||
{
|
||||
m_lifep = new LifeBlock(NULL, m_statep);
|
||||
m_lifep = new LifeBlock(nullptr, m_statep);
|
||||
iterate(nodep);
|
||||
if (m_lifep) VL_DO_CLEAR(delete m_lifep, m_lifep = NULL);
|
||||
if (m_lifep) VL_DO_CLEAR(delete m_lifep, m_lifep = nullptr);
|
||||
}
|
||||
}
|
||||
virtual ~LifeVisitor() {
|
||||
if (m_lifep) VL_DO_CLEAR(delete m_lifep, m_lifep = NULL);
|
||||
if (m_lifep) VL_DO_CLEAR(delete m_lifep, m_lifep = nullptr);
|
||||
}
|
||||
VL_UNCOPYABLE(LifeVisitor);
|
||||
};
|
||||
|
|
|
@ -107,7 +107,7 @@ struct LifeLocation {
|
|||
|
||||
public:
|
||||
LifeLocation()
|
||||
: mtaskp(NULL)
|
||||
: mtaskp(nullptr)
|
||||
, sequence(0) {}
|
||||
LifeLocation(const ExecMTask* mtaskp_, uint32_t sequence_)
|
||||
: mtaskp(mtaskp_)
|
||||
|
@ -125,7 +125,7 @@ struct LifePostLocation {
|
|||
LifeLocation loc;
|
||||
AstAssignPost* nodep;
|
||||
LifePostLocation()
|
||||
: nodep(NULL) {}
|
||||
: nodep(nullptr) {}
|
||||
LifePostLocation(LifeLocation loc_, AstAssignPost* nodep_)
|
||||
: loc(loc_)
|
||||
, nodep(nodep_) {}
|
||||
|
@ -145,7 +145,7 @@ private:
|
|||
uint32_t m_sequence; // Sequence number of assigns/varrefs,
|
||||
// // local to the current MTask.
|
||||
const ExecMTask* m_execMTaskp; // Current ExecMTask being processed,
|
||||
// // or NULL for serial code.
|
||||
// // or nullptr for serial code.
|
||||
VDouble0 m_statAssnDel; // Statistic tracking
|
||||
bool m_tracingCall; // Currently tracing a CCall to a CFunc
|
||||
|
||||
|
@ -334,7 +334,7 @@ private:
|
|||
m_sequence = 0;
|
||||
iterate(mtaskp->bodyp());
|
||||
}
|
||||
m_execMTaskp = NULL;
|
||||
m_execMTaskp = nullptr;
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) override {
|
||||
if (!m_tracingCall && !nodep->entryPoint()) return;
|
||||
|
@ -349,9 +349,9 @@ public:
|
|||
// CONSTRUCTORS
|
||||
explicit LifePostDlyVisitor(AstNetlist* nodep)
|
||||
: m_sequence(0)
|
||||
, m_execMTaskp(NULL)
|
||||
, m_execMTaskp(nullptr)
|
||||
, m_tracingCall(false)
|
||||
, m_mtasksGraphp(NULL) {
|
||||
, m_mtasksGraphp(nullptr) {
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~LifePostDlyVisitor() {
|
||||
|
|
|
@ -129,7 +129,7 @@ private:
|
|||
AstNodeModule* findModuleSym(const string& modName) {
|
||||
VSymEnt* foundp = m_mods.rootp()->findIdFallback(modName);
|
||||
if (!foundp) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} else {
|
||||
return VN_CAST(foundp->nodep(), NodeModule);
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ private:
|
|||
AstNodeModule* modp = vvertexp->modp();
|
||||
modp->level(vvertexp->rank() + 1);
|
||||
if (vvertexp == m_topVertexp && modp->level() != 2) {
|
||||
AstNodeModule* abovep = NULL;
|
||||
AstNodeModule* abovep = nullptr;
|
||||
if (V3GraphEdge* edgep = vvertexp->inBeginp()) {
|
||||
if (LinkCellsVertex* eFromVertexp
|
||||
= dynamic_cast<LinkCellsVertex*>(edgep->fromp())) {
|
||||
|
@ -325,7 +325,7 @@ private:
|
|||
if (!otherModp) {
|
||||
otherModp = cellmodp->cloneTree(false);
|
||||
otherModp->name(otherModp->name() + "__Vrcm");
|
||||
otherModp->user1p(NULL); // Need new vertex
|
||||
otherModp->user1p(nullptr); // Need new vertex
|
||||
otherModp->user2p(cellmodp);
|
||||
otherModp->recursiveClone(true);
|
||||
// user1 etc will retain its pre-clone value
|
||||
|
@ -349,7 +349,7 @@ private:
|
|||
}
|
||||
}
|
||||
}
|
||||
// Remove AstCell(AstPin("",NULL)), it's a side effect of how we parse "()"
|
||||
// Remove AstCell(AstPin("",nullptr)), it's a side effect of how we parse "()"
|
||||
// the empty middle is identical to the empty rule that must find pins in "(,)".
|
||||
if (nodep->pinsp() && !nodep->pinsp()->nextp() && nodep->pinsp()->name() == ""
|
||||
&& !nodep->pinsp()->exprp()) {
|
||||
|
@ -407,16 +407,17 @@ private:
|
|||
if (pinStar) {
|
||||
UINFO(9, " need .* PORT " << portp << endl);
|
||||
// Create any not already connected
|
||||
AstPin* newp = new AstPin(nodep->fileline(), 0, portp->name(),
|
||||
new AstParseRef(nodep->fileline(),
|
||||
VParseRefExp::PX_TEXT,
|
||||
portp->name(), NULL, NULL));
|
||||
AstPin* newp = new AstPin(
|
||||
nodep->fileline(), 0, portp->name(),
|
||||
new AstParseRef(nodep->fileline(), VParseRefExp::PX_TEXT,
|
||||
portp->name(), nullptr, nullptr));
|
||||
newp->svImplicit(true);
|
||||
nodep->addPinsp(newp);
|
||||
} else { // warn on the CELL that needs it, not the port
|
||||
nodep->v3warn(PINMISSING,
|
||||
"Cell has missing pin: " << portp->prettyNameQ());
|
||||
AstPin* newp = new AstPin(nodep->fileline(), 0, portp->name(), NULL);
|
||||
AstPin* newp
|
||||
= new AstPin(nodep->fileline(), 0, portp->name(), nullptr);
|
||||
nodep->addPinsp(newp);
|
||||
}
|
||||
}
|
||||
|
@ -434,7 +435,7 @@ private:
|
|||
string varName = nodep->name() + "__Viftop"; // V3LinkDot looks for this naming
|
||||
AstIfaceRefDType* idtypep = new AstIfaceRefDType(nodep->fileline(), nodep->name(),
|
||||
nodep->modp()->name());
|
||||
idtypep->ifacep(NULL); // cellp overrides
|
||||
idtypep->ifacep(nullptr); // cellp overrides
|
||||
// In the case of arrayed interfaces, we replace cellp when de-arraying in V3Inst
|
||||
idtypep->cellp(nodep); // Only set when real parent cell known.
|
||||
AstVar* varp;
|
||||
|
@ -503,9 +504,9 @@ public:
|
|||
: m_mods(nodep) {
|
||||
m_filterp = filterp;
|
||||
m_parseSymp = parseSymp;
|
||||
m_modp = NULL;
|
||||
m_libVertexp = NULL;
|
||||
m_topVertexp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_libVertexp = nullptr;
|
||||
m_topVertexp = nullptr;
|
||||
if (v3Global.opt.hierChild()) {
|
||||
const V3HierBlockOptSet& hierBlocks = v3Global.opt.hierBlocks();
|
||||
UASSERT(!v3Global.opt.topModule().empty(),
|
||||
|
|
|
@ -203,13 +203,13 @@ public:
|
|||
m_forPrimary = (step == LDS_PRIMARY);
|
||||
m_forPrearray = (step == LDS_PARAMED || step == LDS_PRIMARY);
|
||||
m_forScopeCreation = (step == LDS_SCOPED);
|
||||
m_dunitEntp = NULL;
|
||||
m_dunitEntp = nullptr;
|
||||
s_errorThisp = this;
|
||||
V3Error::errorExitCb(preErrorDumpHandler); // If get error, dump self
|
||||
}
|
||||
~LinkDotState() {
|
||||
V3Error::errorExitCb(NULL);
|
||||
s_errorThisp = NULL;
|
||||
V3Error::errorExitCb(nullptr);
|
||||
s_errorThisp = nullptr;
|
||||
}
|
||||
|
||||
// ACCESSORS
|
||||
|
@ -249,7 +249,7 @@ public:
|
|||
// Note we only check for conflicts at the same level; it's ok if one block hides another
|
||||
// We also wouldn't want to not insert it even though it's lower down
|
||||
VSymEnt* foundp = lookupSymp->findIdFlat(name);
|
||||
AstNode* fnodep = foundp ? foundp->nodep() : NULL;
|
||||
AstNode* fnodep = foundp ? foundp->nodep() : nullptr;
|
||||
if (!fnodep) {
|
||||
// Not found, will add in a moment.
|
||||
} else if (nodep == fnodep) { // Already inserted.
|
||||
|
@ -286,7 +286,7 @@ public:
|
|||
VSymEnt* symp = new VSymEnt(&m_syms, nodep);
|
||||
UINFO(9, " INSERTdunit se" << cvtToHex(symp) << endl);
|
||||
symp->parentp(rootEntp()); // Needed so backward search can find name of top module
|
||||
symp->fallbackp(NULL);
|
||||
symp->fallbackp(nullptr);
|
||||
rootEntp()->insert("$unit ", symp); // Space so can never name conflict with user code
|
||||
//
|
||||
UASSERT_OBJ(!m_dunitEntp, nodep, "Call insertDUnit only once");
|
||||
|
@ -387,7 +387,7 @@ public:
|
|||
abovep->reinsert(name, symp);
|
||||
return symp;
|
||||
}
|
||||
static bool existsModScope(AstNodeModule* nodep) { return nodep->user1p() != NULL; }
|
||||
static bool existsModScope(AstNodeModule* nodep) { return nodep->user1p() != nullptr; }
|
||||
static VSymEnt* getNodeSym(AstNode* nodep) {
|
||||
// Don't use this in ResolveVisitor, as we need to pick up the proper
|
||||
// reference under each SCOPE
|
||||
|
@ -441,7 +441,7 @@ public:
|
|||
for (IfaceVarSyms::iterator it = m_ifaceVarSyms.begin(); it != m_ifaceVarSyms.end();
|
||||
++it) {
|
||||
VSymEnt* varSymp = *it;
|
||||
AstVar* varp = varSymp ? VN_CAST(varSymp->nodep(), Var) : NULL;
|
||||
AstVar* varp = varSymp ? VN_CAST(varSymp->nodep(), Var) : nullptr;
|
||||
UINFO(9, " insAllIface se" << cvtToHex(varSymp) << " " << varp << endl);
|
||||
AstIfaceRefDType* ifacerefp = ifaceRefFromArray(varp->subDTypep());
|
||||
UASSERT_OBJ(ifacerefp, varp, "Non-ifacerefs on list!");
|
||||
|
@ -576,10 +576,10 @@ public:
|
|||
// then look up (inst name or modname)
|
||||
if (firstId) {
|
||||
// Check this module - subcellnames
|
||||
AstCell* cellp
|
||||
= lookupSymp ? VN_CAST(lookupSymp->nodep(), Cell) : NULL; // Replicated below
|
||||
AstCell* cellp = lookupSymp ? VN_CAST(lookupSymp->nodep(), Cell)
|
||||
: nullptr; // Replicated below
|
||||
AstCellInline* inlinep = lookupSymp ? VN_CAST(lookupSymp->nodep(), CellInline)
|
||||
: NULL; // Replicated below
|
||||
: nullptr; // Replicated below
|
||||
if (VSymEnt* findSymp = findWithAltFallback(lookupSymp, ident, altIdent)) {
|
||||
lookupSymp = findSymp;
|
||||
}
|
||||
|
@ -605,9 +605,9 @@ public:
|
|||
while (lookupSymp) {
|
||||
lookupSymp = lookupSymp->parentp();
|
||||
cellp = lookupSymp ? VN_CAST(lookupSymp->nodep(), Cell)
|
||||
: NULL; // Replicated above
|
||||
: nullptr; // Replicated above
|
||||
inlinep = lookupSymp ? VN_CAST(lookupSymp->nodep(), CellInline)
|
||||
: NULL; // Replicated above
|
||||
: nullptr; // Replicated above
|
||||
if (lookupSymp) {
|
||||
UINFO(9, " Up to " << lookupSymp << endl);
|
||||
if (cellp || inlinep) crossedCell = true;
|
||||
|
@ -620,20 +620,20 @@ public:
|
|||
if (crossedCell && VN_IS(lookupSymp->nodep(), Var)) {
|
||||
UINFO(9, " Not found but matches var name in parent "
|
||||
<< lookupSymp << endl);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (!lookupSymp) return NULL; // Not found
|
||||
if (!lookupSymp) return nullptr; // Not found
|
||||
}
|
||||
} else { // Searching for middle submodule, must be a cell name
|
||||
if (VSymEnt* findSymp = findWithAltFallback(lookupSymp, ident, altIdent)) {
|
||||
lookupSymp = findSymp;
|
||||
} else {
|
||||
return NULL; // Not found
|
||||
return nullptr; // Not found
|
||||
}
|
||||
}
|
||||
if (lookupSymp) {
|
||||
|
@ -663,17 +663,17 @@ public:
|
|||
|
||||
VSymEnt* findSymPrefixed(VSymEnt* lookupSymp, const string& dotname, string& baddot) {
|
||||
// Find symbol in given point in hierarchy, allowing prefix (post-Inline)
|
||||
// For simplicity lookupSymp may be passed NULL result from findDotted
|
||||
if (!lookupSymp) return NULL;
|
||||
// For simplicity lookupSymp may be passed nullptr result from findDotted
|
||||
if (!lookupSymp) return nullptr;
|
||||
UINFO(8, " findSymPrefixed "
|
||||
<< dotname << " under se" << cvtToHex(lookupSymp)
|
||||
<< ((lookupSymp->symPrefix() == "") ? "" : " as ")
|
||||
<< ((lookupSymp->symPrefix() == "") ? "" : lookupSymp->symPrefix() + dotname)
|
||||
<< " at se" << lookupSymp << endl);
|
||||
string prefix = lookupSymp->symPrefix();
|
||||
VSymEnt* foundp = NULL;
|
||||
VSymEnt* foundp = nullptr;
|
||||
while (!foundp) {
|
||||
foundp = lookupSymp->findIdFallback(prefix + dotname); // Might be NULL
|
||||
foundp = lookupSymp->findIdFallback(prefix + dotname); // Might be nullptr
|
||||
if (prefix.empty()) break;
|
||||
string nextPrefix = removeLastInlineScope(prefix);
|
||||
if (prefix == nextPrefix) break;
|
||||
|
@ -685,7 +685,7 @@ public:
|
|||
const VNodeMatcher& matcher) {
|
||||
// Suggest alternative symbol in given point in hierarchy
|
||||
// Does not support inline, as we find user-level errors before inlining
|
||||
// For simplicity lookupSymp may be passed NULL result from findDotted
|
||||
// For simplicity lookupSymp may be passed nullptr result from findDotted
|
||||
if (!lookupSymp) return "";
|
||||
VSpellCheck speller;
|
||||
lookupSymp->candidateIdFallback(&speller, &matcher);
|
||||
|
@ -699,7 +699,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
LinkDotState* LinkDotState::s_errorThisp = NULL;
|
||||
LinkDotState* LinkDotState::s_errorThisp = nullptr;
|
||||
|
||||
//======================================================================
|
||||
|
||||
|
@ -722,7 +722,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
int debug() { return LinkDotState::debug(); }
|
||||
|
||||
void makeImplicitNew(AstClass* nodep) {
|
||||
AstFunc* newp = new AstFunc(nodep->fileline(), "new", NULL, NULL);
|
||||
AstFunc* newp = new AstFunc(nodep->fileline(), "new", nullptr, nullptr);
|
||||
newp->isConstructor(true);
|
||||
nodep->addMembersp(newp);
|
||||
UINFO(8, "Made implicit new for " << nodep->name() << ": " << nodep << endl);
|
||||
|
@ -760,7 +760,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
m_curSymp = m_modSymp = m_statep->insertTopCell(modp, m_scope);
|
||||
{ iterate(modp); }
|
||||
m_scope = "";
|
||||
m_curSymp = m_modSymp = NULL;
|
||||
m_curSymp = m_modSymp = nullptr;
|
||||
}
|
||||
}
|
||||
virtual void visit(AstTypeTable*) override {}
|
||||
|
@ -768,7 +768,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
// Called on top module from Netlist, other modules from the cell creating them,
|
||||
// and packages
|
||||
UINFO(8, " " << nodep << endl);
|
||||
// m_curSymp/m_modSymp maybe NULL for packages and non-top modules
|
||||
// m_curSymp/m_modSymp maybe nullptr for packages and non-top modules
|
||||
// Packages will be under top after the initial phases, but until then
|
||||
// need separate handling
|
||||
bool standalonePkg = !m_modSymp && (m_statep->forPrearray() && VN_IS(nodep, Package));
|
||||
|
@ -835,7 +835,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
m_blockNum = oldBlockNum;
|
||||
m_modBlockNum = oldModBlockNum;
|
||||
// Prep for next
|
||||
m_packagep = NULL;
|
||||
m_packagep = nullptr;
|
||||
}
|
||||
virtual void visit(AstClass* nodep) override {
|
||||
UASSERT_OBJ(m_curSymp, nodep, "Class not under module/package/$unit");
|
||||
|
@ -907,7 +907,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
{
|
||||
m_scope = m_scope + "." + nodep->name();
|
||||
m_curSymp = m_modSymp = m_statep->insertCell(aboveSymp, m_modSymp, nodep, m_scope);
|
||||
m_blockp = NULL;
|
||||
m_blockp = nullptr;
|
||||
m_inRecursion = nodep->recursive();
|
||||
// We don't report NotFoundModule, as may be a unused module in a generate
|
||||
if (nodep->modp()) iterate(nodep->modp());
|
||||
|
@ -1018,11 +1018,11 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
newvarp->attrIsolateAssign(nodep->attrIsolateAssign());
|
||||
nodep->addFvarp(newvarp);
|
||||
// Explicit insert required, as the var name shadows the upper level's task name
|
||||
m_statep->insertSym(m_curSymp, newvarp->name(), newvarp, NULL /*packagep*/);
|
||||
m_statep->insertSym(m_curSymp, newvarp->name(), newvarp, nullptr /*packagep*/);
|
||||
}
|
||||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
m_curSymp = oldCurSymp;
|
||||
}
|
||||
|
@ -1041,7 +1041,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
if (!foundp && m_modSymp && nodep->name() == m_modSymp->nodep()->name()) {
|
||||
foundp = m_modSymp; // Conflicts with modname?
|
||||
}
|
||||
AstVar* findvarp = foundp ? VN_CAST(foundp->nodep(), Var) : NULL;
|
||||
AstVar* findvarp = foundp ? VN_CAST(foundp->nodep(), Var) : nullptr;
|
||||
bool ins = false;
|
||||
if (!foundp) {
|
||||
ins = true;
|
||||
|
@ -1179,7 +1179,7 @@ class LinkDotFindVisitor : public AstNVisitor {
|
|||
if (!foundp && m_modSymp && nodep->name() == m_modSymp->nodep()->name()) {
|
||||
foundp = m_modSymp; // Conflicts with modname?
|
||||
}
|
||||
AstEnumItem* findvarp = foundp ? VN_CAST(foundp->nodep(), EnumItem) : NULL;
|
||||
AstEnumItem* findvarp = foundp ? VN_CAST(foundp->nodep(), EnumItem) : nullptr;
|
||||
bool ins = false;
|
||||
if (!foundp) {
|
||||
ins = true;
|
||||
|
@ -1254,11 +1254,11 @@ public:
|
|||
// CONSTRUCTORS
|
||||
LinkDotFindVisitor(AstNetlist* rootp, LinkDotState* statep) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
m_packagep = NULL;
|
||||
m_curSymp = m_modSymp = NULL;
|
||||
m_packagep = nullptr;
|
||||
m_curSymp = m_modSymp = nullptr;
|
||||
m_statep = statep;
|
||||
m_blockp = NULL;
|
||||
m_ftaskp = NULL;
|
||||
m_blockp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
m_inRecursion = false;
|
||||
m_paramNum = 0;
|
||||
m_blockNum = 0;
|
||||
|
@ -1324,7 +1324,7 @@ private:
|
|||
} else {
|
||||
m_modp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
}
|
||||
}
|
||||
virtual void visit(AstPin* nodep) override {
|
||||
|
@ -1341,7 +1341,7 @@ private:
|
|||
nodep->v3warn(DEFPARAM, "Suggest replace defparam assignment with Verilog 2001 #(."
|
||||
<< nodep->prettyName() << "(...etc...))");
|
||||
VSymEnt* foundp = m_statep->getNodeSym(nodep)->findIdFallback(nodep->path());
|
||||
AstCell* cellp = foundp ? VN_CAST(foundp->nodep(), Cell) : NULL;
|
||||
AstCell* cellp = foundp ? VN_CAST(foundp->nodep(), Cell) : nullptr;
|
||||
if (!cellp) {
|
||||
nodep->v3error("In defparam, cell " << nodep->path() << " never declared");
|
||||
} else {
|
||||
|
@ -1361,7 +1361,7 @@ private:
|
|||
// Need to set pin numbers after varnames are created
|
||||
// But before we do the final resolution based on names
|
||||
VSymEnt* foundp = m_statep->getNodeSym(m_modp)->findIdFlat(nodep->name());
|
||||
AstVar* refp = foundp ? VN_CAST(foundp->nodep(), Var) : NULL;
|
||||
AstVar* refp = foundp ? VN_CAST(foundp->nodep(), Var) : nullptr;
|
||||
if (!refp) {
|
||||
nodep->v3error(
|
||||
"Input/output/inout declaration not found for port: " << nodep->prettyNameQ());
|
||||
|
@ -1378,7 +1378,7 @@ private:
|
|||
refp->user4(true);
|
||||
VSymEnt* symp = m_statep->insertSym(m_statep->getNodeSym(m_modp),
|
||||
"__pinNumber" + cvtToStr(nodep->pinNum()), refp,
|
||||
NULL /*packagep*/);
|
||||
nullptr /*packagep*/);
|
||||
symp->exported(false);
|
||||
}
|
||||
// Ports not needed any more
|
||||
|
@ -1430,7 +1430,7 @@ public:
|
|||
LinkDotParamVisitor(AstNetlist* rootp, LinkDotState* statep) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
m_statep = statep;
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
//
|
||||
iterate(rootp);
|
||||
}
|
||||
|
@ -1462,12 +1462,13 @@ class LinkDotScopeVisitor : public AstNVisitor {
|
|||
m_modSymp = m_statep->getScopeSym(nodep);
|
||||
m_scopep = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_modSymp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_modSymp = nullptr;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstVarScope* nodep) override {
|
||||
if (!nodep->varp()->isFuncLocal() && !nodep->varp()->isClassMember()) {
|
||||
VSymEnt* varSymp = m_statep->insertSym(m_modSymp, nodep->varp()->name(), nodep, NULL);
|
||||
VSymEnt* varSymp
|
||||
= m_statep->insertSym(m_modSymp, nodep->varp()->name(), nodep, nullptr);
|
||||
if (nodep->varp()->isIfaceRef() && nodep->varp()->isIfaceParent()) {
|
||||
UINFO(9, "Iface parent ref var " << nodep->varp()->name() << " " << nodep << endl);
|
||||
// Find the interface cell the var references
|
||||
|
@ -1502,7 +1503,7 @@ class LinkDotScopeVisitor : public AstNVisitor {
|
|||
}
|
||||
}
|
||||
virtual void visit(AstNodeFTask* nodep) override {
|
||||
VSymEnt* symp = m_statep->insertBlock(m_modSymp, nodep->name(), nodep, NULL);
|
||||
VSymEnt* symp = m_statep->insertBlock(m_modSymp, nodep->name(), nodep, nullptr);
|
||||
symp->fallbackp(m_modSymp);
|
||||
// No recursion, we don't want to pick up variables
|
||||
}
|
||||
|
@ -1528,7 +1529,7 @@ class LinkDotScopeVisitor : public AstNVisitor {
|
|||
string inl
|
||||
= ((xrefp && xrefp->inlinedDots().size()) ? (xrefp->inlinedDots() + "__DOT__")
|
||||
: "");
|
||||
VSymEnt* symp = NULL;
|
||||
VSymEnt* symp = nullptr;
|
||||
string scopename;
|
||||
while (!symp) {
|
||||
scopename
|
||||
|
@ -1583,8 +1584,8 @@ public:
|
|||
// CONSTRUCTORS
|
||||
LinkDotScopeVisitor(AstNetlist* rootp, LinkDotState* statep) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
m_modSymp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_modSymp = nullptr;
|
||||
m_scopep = nullptr;
|
||||
m_statep = statep;
|
||||
//
|
||||
iterate(rootp);
|
||||
|
@ -1610,7 +1611,7 @@ class LinkDotIfaceVisitor : public AstNVisitor {
|
|||
VSymEnt* oldCurSymp = m_curSymp;
|
||||
{
|
||||
// Create symbol table for the vars
|
||||
m_curSymp = m_statep->insertBlock(m_curSymp, nodep->name(), nodep, NULL);
|
||||
m_curSymp = m_statep->insertBlock(m_curSymp, nodep->name(), nodep, nullptr);
|
||||
m_curSymp->fallbackp(oldCurSymp);
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
|
@ -1627,7 +1628,7 @@ class LinkDotIfaceVisitor : public AstNVisitor {
|
|||
// Make symbol under modport that points at the _interface_'s var, not the modport.
|
||||
nodep->ftaskp(ftaskp);
|
||||
VSymEnt* subSymp
|
||||
= m_statep->insertSym(m_curSymp, nodep->name(), ftaskp, NULL /*package*/);
|
||||
= m_statep->insertSym(m_curSymp, nodep->name(), ftaskp, nullptr /*package*/);
|
||||
m_statep->insertScopeAlias(LinkDotState::SAMN_MODPORT, subSymp, symp);
|
||||
} else {
|
||||
nodep->v3error("Modport item is not a function/task: " << nodep->prettyNameQ());
|
||||
|
@ -1649,11 +1650,11 @@ class LinkDotIfaceVisitor : public AstNVisitor {
|
|||
// Make symbol under modport that points at the _interface_'s var via the modport.
|
||||
// (Need modport still to test input/output markings)
|
||||
nodep->varp(varp);
|
||||
m_statep->insertSym(m_curSymp, nodep->name(), nodep, NULL /*package*/);
|
||||
m_statep->insertSym(m_curSymp, nodep->name(), nodep, nullptr /*package*/);
|
||||
} else if (AstVarScope* vscp = VN_CAST(symp->nodep(), VarScope)) {
|
||||
// Make symbol under modport that points at the _interface_'s var, not the modport.
|
||||
nodep->varp(vscp->varp());
|
||||
m_statep->insertSym(m_curSymp, nodep->name(), vscp, NULL /*package*/);
|
||||
m_statep->insertSym(m_curSymp, nodep->name(), vscp, nullptr /*package*/);
|
||||
} else {
|
||||
nodep->v3error("Modport item is not a variable: " << nodep->prettyNameQ());
|
||||
}
|
||||
|
@ -1728,16 +1729,16 @@ private:
|
|||
AstNode* m_unlinkedScope; // Unresolved scope, needs corresponding VarXRef
|
||||
bool m_dotErr; // Error found in dotted resolution, ignore upwards
|
||||
string m_dotText; // String of dotted names found in below parseref
|
||||
DotStates() { init(NULL); }
|
||||
DotStates() { init(nullptr); }
|
||||
~DotStates() {}
|
||||
void init(VSymEnt* curSymp) {
|
||||
m_dotPos = DP_NONE;
|
||||
m_dotSymp = curSymp;
|
||||
m_dotp = NULL;
|
||||
m_dotp = nullptr;
|
||||
m_dotErr = false;
|
||||
m_dotText = "";
|
||||
m_unresolved = false;
|
||||
m_unlinkedScope = NULL;
|
||||
m_unlinkedScope = nullptr;
|
||||
}
|
||||
string ascii() const {
|
||||
static const char* const names[] = {"NONE", "PACKAGE", "SCOPE", "FINAL", "MEMBER"};
|
||||
|
@ -1785,13 +1786,13 @@ private:
|
|||
modp->addStmtp(newp);
|
||||
// Link it to signal list, must add the variable under the module;
|
||||
// current scope might be lower now
|
||||
m_statep->insertSym(moduleSymp, newp->name(), newp, NULL /*packagep*/);
|
||||
m_statep->insertSym(moduleSymp, newp->name(), newp, nullptr /*packagep*/);
|
||||
}
|
||||
}
|
||||
AstVar* foundToVarp(const VSymEnt* symp, AstNode* nodep, bool lvalue) {
|
||||
// Return a variable if possible, auto converting a modport to variable
|
||||
if (!symp) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} else if (VN_IS(symp->nodep(), Var)) {
|
||||
return VN_CAST(symp->nodep(), Var);
|
||||
} else if (VN_IS(symp->nodep(), ModportVarRef)) {
|
||||
|
@ -1802,7 +1803,7 @@ private:
|
|||
} // else other simulators don't warn about reading, and IEEE doesn't say illegal
|
||||
return varp;
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
void taskFuncSwapCheck(AstNodeFTaskRef* nodep) {
|
||||
|
@ -1857,12 +1858,12 @@ private:
|
|||
m_ds.init(m_curSymp);
|
||||
m_ds.m_dotSymp = m_curSymp = m_modSymp
|
||||
= m_statep->getNodeSym(nodep); // Until overridden by a SCOPE
|
||||
m_cellp = NULL;
|
||||
m_cellp = nullptr;
|
||||
m_modp = nodep;
|
||||
m_modportNum = 0;
|
||||
iterateChildren(nodep);
|
||||
m_modp = NULL;
|
||||
m_ds.m_dotSymp = m_curSymp = m_modSymp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_ds.m_dotSymp = m_curSymp = m_modSymp = nullptr;
|
||||
}
|
||||
virtual void visit(AstScope* nodep) override {
|
||||
UINFO(8, " " << nodep << endl);
|
||||
|
@ -1871,7 +1872,7 @@ private:
|
|||
checkNoDot(nodep);
|
||||
m_ds.m_dotSymp = m_curSymp = m_modSymp = m_statep->getScopeSym(nodep);
|
||||
iterateChildren(nodep);
|
||||
m_ds.m_dotSymp = m_curSymp = m_modSymp = NULL;
|
||||
m_ds.m_dotSymp = m_curSymp = m_modSymp = nullptr;
|
||||
m_modSymp = oldModSymp;
|
||||
m_curSymp = oldCurSymp;
|
||||
}
|
||||
|
@ -1904,10 +1905,10 @@ private:
|
|||
// if (debug()) nodep->dumpTree(cout, "linkcell:");
|
||||
// if (debug()) nodep->modp()->dumpTree(cout, "linkcemd:");
|
||||
iterateChildren(nodep);
|
||||
m_pinSymp = NULL;
|
||||
m_pinSymp = nullptr;
|
||||
}
|
||||
}
|
||||
m_cellp = NULL;
|
||||
m_cellp = nullptr;
|
||||
// Parent module inherits child's publicity
|
||||
// This is done bottom up in the LinkBotupVisitor stage
|
||||
}
|
||||
|
@ -2022,7 +2023,7 @@ private:
|
|||
UINFO(9, " linkPARSEREF " << m_ds.ascii() << " n=" << nodep << endl);
|
||||
// m_curSymp is symbol table of outer expression
|
||||
// m_ds.m_dotSymp is symbol table relative to "."'s above now
|
||||
UASSERT_OBJ(m_ds.m_dotSymp, nodep, "NULL lookup symbol table");
|
||||
UASSERT_OBJ(m_ds.m_dotSymp, nodep, "nullptr lookup symbol table");
|
||||
// Generally resolved during Primay, but might be at param time under AstUnlinkedRef
|
||||
UASSERT_OBJ(m_statep->forPrimary() || m_statep->forPrearray(), nodep,
|
||||
"ParseRefs should no longer exist");
|
||||
|
@ -2035,7 +2036,7 @@ private:
|
|||
bool start = (m_ds.m_dotPos == DP_NONE); // Save, as m_dotp will be changed
|
||||
if (start) {
|
||||
m_ds.init(m_curSymp);
|
||||
// Note m_ds.m_dot remains NULL; this is a reference not under a dot
|
||||
// Note m_ds.m_dot remains nullptr; this is a reference not under a dot
|
||||
}
|
||||
if (nodep->name() == "this") {
|
||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: this");
|
||||
|
@ -2061,7 +2062,7 @@ private:
|
|||
bool allowVar = false;
|
||||
if (m_ds.m_dotPos == DP_PACKAGE) {
|
||||
// {package}::{a}
|
||||
AstNodeModule* packagep = NULL;
|
||||
AstNodeModule* packagep = nullptr;
|
||||
expectWhat = "scope/variable";
|
||||
allowScope = true;
|
||||
allowVar = true;
|
||||
|
@ -2094,10 +2095,10 @@ private:
|
|||
// Lookup
|
||||
VSymEnt* foundp;
|
||||
string baddot;
|
||||
VSymEnt* okSymp = NULL;
|
||||
VSymEnt* okSymp = nullptr;
|
||||
if (allowScope) {
|
||||
foundp = m_statep->findDotted(nodep->fileline(), m_ds.m_dotSymp, nodep->name(),
|
||||
baddot, okSymp); // Maybe NULL
|
||||
baddot, okSymp); // Maybe nullptr
|
||||
} else {
|
||||
foundp = m_ds.m_dotSymp->findIdFallback(nodep->name());
|
||||
}
|
||||
|
@ -2128,7 +2129,8 @@ private:
|
|||
// generate begin
|
||||
string findName = nodep->name() + "__Viftop";
|
||||
VSymEnt* ifaceSymp = parentEntp->findIdFallback(findName);
|
||||
AstVar* ifaceRefVarp = ifaceSymp ? VN_CAST(ifaceSymp->nodep(), Var) : NULL;
|
||||
AstVar* ifaceRefVarp
|
||||
= ifaceSymp ? VN_CAST(ifaceSymp->nodep(), Var) : nullptr;
|
||||
UASSERT_OBJ(ifaceRefVarp, nodep,
|
||||
"Can't find interface var ref: " << findName);
|
||||
//
|
||||
|
@ -2187,7 +2189,7 @@ private:
|
|||
newp = new AstUnlinkedRef(nodep->fileline(),
|
||||
VN_CAST(refp, VarXRef), refp->name(),
|
||||
m_ds.m_unlinkedScope->unlinkFrBack());
|
||||
m_ds.m_unlinkedScope = NULL;
|
||||
m_ds.m_unlinkedScope = nullptr;
|
||||
m_ds.m_unresolved = false;
|
||||
}
|
||||
} else {
|
||||
|
@ -2297,9 +2299,9 @@ private:
|
|||
iterateChildren(nodep);
|
||||
if (!nodep->varp()) {
|
||||
UINFO(9, " linkVarRef se" << cvtToHex(m_curSymp) << " n=" << nodep << endl);
|
||||
UASSERT_OBJ(m_curSymp, nodep, "NULL lookup symbol table");
|
||||
UASSERT_OBJ(m_curSymp, nodep, "nullptr lookup symbol table");
|
||||
VSymEnt* foundp = m_curSymp->findIdFallback(nodep->name());
|
||||
if (AstVar* varp = foundp ? foundToVarp(foundp, nodep, nodep->lvalue()) : NULL) {
|
||||
if (AstVar* varp = foundp ? foundToVarp(foundp, nodep, nodep->lvalue()) : nullptr) {
|
||||
nodep->varp(varp);
|
||||
// Generally set by parse, but might be an import
|
||||
nodep->packagep(foundp->packagep());
|
||||
|
@ -2319,7 +2321,7 @@ private:
|
|||
if (!m_modSymp) {
|
||||
// Module that is not in hierarchy. We'll be dead code eliminating it later.
|
||||
UINFO(9, "Dead module for " << nodep << endl);
|
||||
nodep->varp(NULL);
|
||||
nodep->varp(nullptr);
|
||||
} else {
|
||||
string baddot;
|
||||
VSymEnt* okSymp;
|
||||
|
@ -2336,10 +2338,10 @@ private:
|
|||
<< " in: " << nodep->inlinedDots());
|
||||
}
|
||||
dotSymp = m_statep->findDotted(nodep->fileline(), dotSymp, nodep->dotted(), baddot,
|
||||
okSymp); // Maybe NULL
|
||||
okSymp); // Maybe nullptr
|
||||
if (!m_statep->forScopeCreation()) {
|
||||
VSymEnt* foundp = m_statep->findSymPrefixed(dotSymp, nodep->name(), baddot);
|
||||
AstVar* varp = foundp ? foundToVarp(foundp, nodep, nodep->lvalue()) : NULL;
|
||||
AstVar* varp = foundp ? foundToVarp(foundp, nodep, nodep->lvalue()) : nullptr;
|
||||
nodep->varp(varp);
|
||||
UINFO(7, " Resolved " << nodep << endl); // Also prints varp
|
||||
if (!nodep->varp()) {
|
||||
|
@ -2362,7 +2364,7 @@ private:
|
|||
}
|
||||
} else {
|
||||
VSymEnt* foundp = m_statep->findSymPrefixed(dotSymp, nodep->name(), baddot);
|
||||
AstVarScope* vscp = foundp ? VN_CAST(foundp->nodep(), VarScope) : NULL;
|
||||
AstVarScope* vscp = foundp ? VN_CAST(foundp->nodep(), VarScope) : nullptr;
|
||||
if (!vscp) {
|
||||
nodep->v3error("Can't find varpin scope of "
|
||||
<< AstNode::prettyNameQ(baddot) << " in dotted signal: '"
|
||||
|
@ -2438,14 +2440,14 @@ private:
|
|||
m_ds.m_dotp->lhsp(), "Bad package link");
|
||||
nodep->packagep(VN_CAST(m_ds.m_dotp->lhsp(), ClassOrPackageRef)->packagep());
|
||||
m_ds.m_dotPos = DP_SCOPE;
|
||||
m_ds.m_dotp = NULL;
|
||||
m_ds.m_dotp = nullptr;
|
||||
} else if (m_ds.m_dotp && m_ds.m_dotPos == DP_FINAL) {
|
||||
if (m_ds.m_unresolved && m_ds.m_unlinkedScope) {
|
||||
AstNodeFTaskRef* newftaskp = nodep->cloneTree(false);
|
||||
newftaskp->dotted(m_ds.m_dotText);
|
||||
AstNode* newp = new AstUnlinkedRef(nodep->fileline(), newftaskp, nodep->name(),
|
||||
m_ds.m_unlinkedScope->unlinkFrBack());
|
||||
m_ds.m_unlinkedScope = NULL;
|
||||
m_ds.m_unlinkedScope = nullptr;
|
||||
m_ds.m_unresolved = false;
|
||||
nodep->replaceWith(newp);
|
||||
return;
|
||||
|
@ -2456,7 +2458,7 @@ private:
|
|||
// Found a Var, everything following is method call.
|
||||
// {scope}.{var}.HERE {method} ( ARGS )
|
||||
AstNode* varEtcp = m_ds.m_dotp->lhsp()->unlinkFrBack();
|
||||
AstNode* argsp = NULL;
|
||||
AstNode* argsp = nullptr;
|
||||
if (nodep->pinsp()) argsp = nodep->pinsp()->unlinkFrBackWithNext();
|
||||
AstNode* newp = new AstMethodCall(nodep->fileline(), varEtcp, VFlagChildDType(),
|
||||
nodep->name(), argsp);
|
||||
|
@ -2471,13 +2473,13 @@ private:
|
|||
} else if (!m_modSymp) {
|
||||
// Module that is not in hierarchy. We'll be dead code eliminating it later.
|
||||
UINFO(9, "Dead module for " << nodep << endl);
|
||||
nodep->taskp(NULL);
|
||||
nodep->taskp(nullptr);
|
||||
} else if (nodep->dotted() == "" && nodep->taskp()) {
|
||||
// Earlier should have setup the links
|
||||
// Might be under a BEGIN we're not processing, so don't relink it
|
||||
} else {
|
||||
string baddot;
|
||||
VSymEnt* okSymp = NULL;
|
||||
VSymEnt* okSymp = nullptr;
|
||||
VSymEnt* dotSymp = m_curSymp; // Start search at module, as a variable
|
||||
// of same name under a subtask isn't a relevant hit however a
|
||||
// function under a begin/end is. So we want begins, but not
|
||||
|
@ -2502,11 +2504,11 @@ private:
|
|||
}
|
||||
}
|
||||
dotSymp = m_statep->findDotted(nodep->fileline(), dotSymp, nodep->dotted(), baddot,
|
||||
okSymp); // Maybe NULL
|
||||
okSymp); // Maybe nullptr
|
||||
}
|
||||
VSymEnt* foundp = m_statep->findSymPrefixed(dotSymp, nodep->name(), baddot);
|
||||
AstNodeFTask* taskp
|
||||
= foundp ? VN_CAST(foundp->nodep(), NodeFTask) : NULL; // Maybe NULL
|
||||
= foundp ? VN_CAST(foundp->nodep(), NodeFTask) : nullptr; // Maybe nullptr
|
||||
if (taskp) {
|
||||
nodep->taskp(taskp);
|
||||
nodep->packagep(foundp->packagep());
|
||||
|
@ -2531,7 +2533,7 @@ private:
|
|||
newp = new AstConst(nodep->fileline(), AstConst::StringToParse(),
|
||||
"'0");
|
||||
} else {
|
||||
AstNode* outp = NULL;
|
||||
AstNode* outp = nullptr;
|
||||
while (nodep->pinsp()) {
|
||||
AstNode* pinp = nodep->pinsp()->unlinkFrBack();
|
||||
AstNode* addp = pinp;
|
||||
|
@ -2657,7 +2659,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
}
|
||||
m_ds.m_dotSymp = m_curSymp = oldCurSymp;
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
virtual void visit(AstClass* nodep) override {
|
||||
UINFO(5, " " << nodep << endl);
|
||||
|
@ -2725,7 +2727,7 @@ private:
|
|||
m_ds.m_dotp->lhsp(), "Bad package link");
|
||||
nodep->packagep(VN_CAST(m_ds.m_dotp->lhsp(), ClassOrPackageRef)->packagep());
|
||||
m_ds.m_dotPos = DP_SCOPE;
|
||||
m_ds.m_dotp = NULL;
|
||||
m_ds.m_dotp = nullptr;
|
||||
} else {
|
||||
checkNoDot(nodep);
|
||||
}
|
||||
|
@ -2737,14 +2739,14 @@ private:
|
|||
} else {
|
||||
foundp = m_curSymp->findIdFallback(nodep->name());
|
||||
}
|
||||
if (AstTypedef* defp = foundp ? VN_CAST(foundp->nodep(), Typedef) : NULL) {
|
||||
if (AstTypedef* defp = foundp ? VN_CAST(foundp->nodep(), Typedef) : nullptr) {
|
||||
nodep->typedefp(defp);
|
||||
nodep->packagep(foundp->packagep());
|
||||
} else if (AstParamTypeDType* defp
|
||||
= foundp ? VN_CAST(foundp->nodep(), ParamTypeDType) : NULL) {
|
||||
= foundp ? VN_CAST(foundp->nodep(), ParamTypeDType) : nullptr) {
|
||||
nodep->refDTypep(defp);
|
||||
nodep->packagep(foundp->packagep());
|
||||
} else if (AstClass* defp = foundp ? VN_CAST(foundp->nodep(), Class) : NULL) {
|
||||
} else if (AstClass* defp = foundp ? VN_CAST(foundp->nodep(), Class) : nullptr) {
|
||||
AstClassRefDType* newp = new AstClassRefDType(nodep->fileline(), defp);
|
||||
newp->packagep(foundp->packagep());
|
||||
nodep->replaceWith(newp);
|
||||
|
@ -2762,7 +2764,7 @@ private:
|
|||
iterateChildren(nodep);
|
||||
checkNoDot(nodep);
|
||||
VSymEnt* foundp = m_curSymp->findIdFallback(nodep->name());
|
||||
AstNodeFTask* taskp = foundp ? VN_CAST(foundp->nodep(), NodeFTask) : NULL;
|
||||
AstNodeFTask* taskp = foundp ? VN_CAST(foundp->nodep(), NodeFTask) : nullptr;
|
||||
if (!taskp) {
|
||||
nodep->v3error(
|
||||
"Can't find definition of exported task/function: " << nodep->prettyNameQ());
|
||||
|
@ -2813,12 +2815,12 @@ public:
|
|||
LinkDotResolveVisitor(AstNetlist* rootp, LinkDotState* statep) {
|
||||
UINFO(4, __FUNCTION__ << ": " << endl);
|
||||
m_statep = statep;
|
||||
m_modSymp = NULL;
|
||||
m_curSymp = NULL;
|
||||
m_pinSymp = NULL;
|
||||
m_cellp = NULL;
|
||||
m_modp = NULL;
|
||||
m_ftaskp = NULL;
|
||||
m_modSymp = nullptr;
|
||||
m_curSymp = nullptr;
|
||||
m_pinSymp = nullptr;
|
||||
m_cellp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
m_modportNum = 0;
|
||||
//
|
||||
iterate(rootp);
|
||||
|
|
|
@ -95,26 +95,26 @@ private:
|
|||
// Special, as statements need to be put in different places
|
||||
// Preconditions insert first just before themselves (the normal
|
||||
// rule for other statement types)
|
||||
m_insStmtp = NULL; // First thing should be new statement
|
||||
m_insStmtp = nullptr; // First thing should be new statement
|
||||
iterateAndNextNull(nodep->precondsp());
|
||||
// Conditions insert first at end of precondsp.
|
||||
m_insMode = IM_WHILE_PRECOND;
|
||||
m_insStmtp = nodep;
|
||||
iterateAndNextNull(nodep->condp());
|
||||
// Body insert just before themselves
|
||||
m_insStmtp = NULL; // First thing should be new statement
|
||||
m_insStmtp = nullptr; // First thing should be new statement
|
||||
iterateAndNextNull(nodep->bodysp());
|
||||
iterateAndNextNull(nodep->incsp());
|
||||
// Done the loop
|
||||
m_insStmtp = NULL; // Next thing should be new statement
|
||||
m_insStmtp = nullptr; // Next thing should be new statement
|
||||
}
|
||||
virtual void visit(AstNodeIf* nodep) override {
|
||||
m_insStmtp = nodep;
|
||||
iterateAndNextNull(nodep->condp());
|
||||
m_insStmtp = NULL;
|
||||
m_insStmtp = nullptr;
|
||||
iterateAndNextNull(nodep->ifsp());
|
||||
iterateAndNextNull(nodep->elsesp());
|
||||
m_insStmtp = NULL;
|
||||
m_insStmtp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeFor* nodep) override { // LCOV_EXCL_LINE
|
||||
nodep->v3fatalSrc(
|
||||
|
@ -128,7 +128,7 @@ private:
|
|||
m_insMode = IM_BEFORE;
|
||||
m_insStmtp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_insStmtp = NULL; // Next thing should be new statement
|
||||
m_insStmtp = nullptr; // Next thing should be new statement
|
||||
}
|
||||
void unsupported_visit(AstNode* nodep) {
|
||||
m_unsupportedHere = true;
|
||||
|
@ -237,7 +237,7 @@ public:
|
|||
explicit LinkIncVisitor(AstNetlist* nodep) {
|
||||
m_modIncrementsNum = 0;
|
||||
m_insMode = IM_BEFORE;
|
||||
m_insStmtp = NULL;
|
||||
m_insStmtp = nullptr;
|
||||
m_unsupportedHere = false;
|
||||
iterate(nodep);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
UINFO(4, "Create label for " << nodep << endl);
|
||||
if (VN_IS(nodep, JumpLabel)) return VN_CAST(nodep, JumpLabel); // Done
|
||||
|
||||
AstNode* underp = NULL;
|
||||
AstNode* underp = nullptr;
|
||||
bool under_and_next = true;
|
||||
if (VN_IS(nodep, NodeBlock)) {
|
||||
underp = VN_CAST(nodep, NodeBlock)->stmtsp();
|
||||
|
@ -80,7 +80,7 @@ private:
|
|||
}
|
||||
} else {
|
||||
nodep->v3fatalSrc("Unknown jump point for break/disable/continue");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// Skip over variables as we'll just move them in a moment
|
||||
// Also this would otherwise prevent us from using a label twice
|
||||
|
@ -92,7 +92,7 @@ private:
|
|||
if (VN_IS(underp, JumpLabel)) {
|
||||
return VN_CAST(underp, JumpLabel);
|
||||
} else { // Move underp stuff to be under a new label
|
||||
AstJumpBlock* blockp = new AstJumpBlock(nodep->fileline(), NULL);
|
||||
AstJumpBlock* blockp = new AstJumpBlock(nodep->fileline(), nullptr);
|
||||
AstJumpLabel* labelp = new AstJumpLabel(nodep->fileline(), blockp);
|
||||
blockp->labelp(labelp);
|
||||
|
||||
|
@ -132,7 +132,7 @@ private:
|
|||
virtual void visit(AstNodeFTask* nodep) override {
|
||||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeBlock* nodep) override {
|
||||
UINFO(8, " " << nodep << endl);
|
||||
|
@ -254,7 +254,7 @@ private:
|
|||
virtual void visit(AstDisable* nodep) override {
|
||||
UINFO(8, " DISABLE " << nodep << endl);
|
||||
iterateChildren(nodep);
|
||||
AstNodeBlock* blockp = NULL;
|
||||
AstNodeBlock* blockp = nullptr;
|
||||
for (BlockStack::reverse_iterator it = m_blockStack.rbegin(); it != m_blockStack.rend();
|
||||
++it) {
|
||||
UINFO(9, " UNDERBLK " << *it << endl);
|
||||
|
@ -286,10 +286,10 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit LinkJumpVisitor(AstNetlist* nodep) {
|
||||
m_modp = NULL;
|
||||
m_ftaskp = NULL;
|
||||
m_modp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
m_inFork = false;
|
||||
m_loopp = NULL;
|
||||
m_loopp = nullptr;
|
||||
m_loopInc = false;
|
||||
m_modRepeatNum = 0;
|
||||
iterate(nodep);
|
||||
|
|
|
@ -270,7 +270,7 @@ private:
|
|||
virtual void visit(AstNodeFTask* nodep) override {
|
||||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
virtual void visit(AstNodeFTaskRef* nodep) override {
|
||||
AstNode* pinp = nodep->pinsp();
|
||||
|
@ -300,7 +300,7 @@ public:
|
|||
// CONSTRUCTORS
|
||||
LinkLValueVisitor(AstNode* nodep, bool start) {
|
||||
m_setRefLvalue = start;
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~LinkLValueVisitor() {}
|
||||
|
|
|
@ -91,7 +91,7 @@ void V3LinkLevel::modSortByLevel() {
|
|||
|
||||
void V3LinkLevel::timescaling(const ModVec& mods) {
|
||||
// Timescale determination
|
||||
AstNodeModule* modTimedp = NULL;
|
||||
AstNodeModule* modTimedp = nullptr;
|
||||
VTimescale unit(VTimescale::NONE);
|
||||
// Use highest level module as default unit - already sorted in proper order
|
||||
for (ModVec::const_iterator it = mods.begin(); it != mods.end(); ++it) {
|
||||
|
@ -160,7 +160,7 @@ void V3LinkLevel::wrapTop(AstNetlist* rootp) {
|
|||
AstCell* cellp = new AstCell(modp->fileline(), modp->fileline(),
|
||||
// Could add __03a__03a="::" to prevent conflict
|
||||
// with module names/"v"
|
||||
modp->name(), modp->name(), NULL, NULL, NULL);
|
||||
modp->name(), modp->name(), nullptr, nullptr, nullptr);
|
||||
cellp->modp(modp);
|
||||
newmodp->addStmtp(cellp);
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) {
|
|||
AstCell* cellp = new AstCell(
|
||||
newmodp->fileline(), newmodp->fileline(),
|
||||
(!v3Global.opt.l2Name().empty() ? v3Global.opt.l2Name() : oldmodp->name()),
|
||||
oldmodp->name(), NULL, NULL, NULL);
|
||||
oldmodp->name(), nullptr, nullptr, nullptr);
|
||||
cellp->modp(oldmodp);
|
||||
newmodp->addStmtp(cellp);
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ private:
|
|||
cleanFileline(nodep);
|
||||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
}
|
||||
virtual void visit(AstNodeFTaskRef* nodep) override {
|
||||
|
@ -117,7 +117,7 @@ private:
|
|||
cleanFileline(nodep);
|
||||
UINFO(5, " " << nodep << endl);
|
||||
AstNodeModule* upperValueModp = m_valueModp;
|
||||
m_valueModp = NULL;
|
||||
m_valueModp = nullptr;
|
||||
iterateChildren(nodep);
|
||||
m_valueModp = upperValueModp;
|
||||
}
|
||||
|
@ -148,15 +148,15 @@ private:
|
|||
int lsb = nodep->rangep()->lsbConst();
|
||||
int increment = (msb > lsb) ? -1 : 1;
|
||||
int offset_from_init = 0;
|
||||
AstNode* addp = NULL;
|
||||
AstNode* addp = nullptr;
|
||||
for (int i = msb; i != (lsb + increment); i += increment, offset_from_init++) {
|
||||
string name = nodep->name() + cvtToStr(i);
|
||||
AstNode* valuep = NULL;
|
||||
AstNode* valuep = nullptr;
|
||||
if (nodep->valuep())
|
||||
valuep = new AstAdd(
|
||||
nodep->fileline(), nodep->valuep()->cloneTree(true),
|
||||
new AstConst(nodep->fileline(), AstConst::Unsized32(), offset_from_init));
|
||||
AstNode* newp = new AstEnumItem(nodep->fileline(), name, NULL, valuep);
|
||||
AstNode* newp = new AstEnumItem(nodep->fileline(), name, nullptr, valuep);
|
||||
if (addp) {
|
||||
addp = addp->addNextNull(newp);
|
||||
} else {
|
||||
|
@ -213,7 +213,7 @@ private:
|
|||
m_varp = nodep;
|
||||
|
||||
iterateChildren(nodep);
|
||||
m_varp = NULL;
|
||||
m_varp = nullptr;
|
||||
// temporaries under an always aren't expected to be blocking
|
||||
if (m_inAlways) nodep->fileline()->modifyWarnOff(V3ErrorCode::BLKSEQ, true);
|
||||
if (nodep->valuep()) {
|
||||
|
@ -347,7 +347,7 @@ private:
|
|||
// so that for "var enum {...} a,b" a & b will share a common typedef
|
||||
// Unique name space under each containerp() so that an addition of
|
||||
// a new type won't change every verilated module.
|
||||
AstTypedef* defp = NULL;
|
||||
AstTypedef* defp = nullptr;
|
||||
ImplTypedefMap::iterator it
|
||||
= m_implTypedef.find(make_pair(nodep->containerp(), nodep->name()));
|
||||
if (it != m_implTypedef.end()) {
|
||||
|
@ -370,7 +370,7 @@ private:
|
|||
VL_DO_DANGLING(nodep->deleteTree(), nodep);
|
||||
return;
|
||||
} else {
|
||||
defp = new AstTypedef(nodep->fileline(), nodep->name(), NULL, VFlagChildDType(),
|
||||
defp = new AstTypedef(nodep->fileline(), nodep->name(), nullptr, VFlagChildDType(),
|
||||
dtypep);
|
||||
m_implTypedef.insert(
|
||||
make_pair(make_pair(nodep->containerp(), defp->name()), defp));
|
||||
|
@ -402,7 +402,7 @@ private:
|
|||
// 3. ASTSELLOOPVARS(first, var0..var1))
|
||||
// 4. DOT(DOT(first, second), ASTSELBIT(third, var0))
|
||||
AstNode* bracketp = nodep->arrayp();
|
||||
AstNode* firstVarsp = NULL;
|
||||
AstNode* firstVarsp = nullptr;
|
||||
while (AstDot* dotp = VN_CAST(bracketp, Dot)) { bracketp = dotp->rhsp(); }
|
||||
if (AstSelBit* selp = VN_CAST(bracketp, SelBit)) {
|
||||
firstVarsp = selp->rhsp()->unlinkFrBackWithNext();
|
||||
|
@ -499,7 +499,7 @@ private:
|
|||
cleanFileline(nodep);
|
||||
//
|
||||
AstNodeModule* upperValueModp = m_valueModp;
|
||||
m_valueModp = NULL;
|
||||
m_valueModp = nullptr;
|
||||
iterateChildren(nodep);
|
||||
m_valueModp = upperValueModp;
|
||||
}
|
||||
|
@ -596,12 +596,12 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit LinkParseVisitor(AstNetlist* rootp) {
|
||||
m_varp = NULL;
|
||||
m_modp = NULL;
|
||||
m_ftaskp = NULL;
|
||||
m_dtypep = NULL;
|
||||
m_varp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
m_dtypep = nullptr;
|
||||
m_inAlways = false;
|
||||
m_valueModp = NULL;
|
||||
m_valueModp = nullptr;
|
||||
iterate(rootp);
|
||||
}
|
||||
virtual ~LinkParseVisitor() {}
|
||||
|
|
|
@ -103,7 +103,7 @@ private:
|
|||
if (m_assertp) nodep->v3error("Assert not allowed under another assert");
|
||||
m_assertp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_assertp = NULL;
|
||||
m_assertp = nullptr;
|
||||
}
|
||||
virtual void visit(AstVar* nodep) override {
|
||||
iterateChildren(nodep);
|
||||
|
@ -141,7 +141,7 @@ private:
|
|||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
m_lifetime = origLifetime;
|
||||
if (nodep->dpiExport()) { nodep->scopeNamep(new AstScopeName(nodep->fileline())); }
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ private:
|
|||
// From {...}[...] syntax in IEEE 2017
|
||||
if (basefromp) { UINFO(1, " Related node: " << basefromp << endl); }
|
||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Select of concatenation");
|
||||
nodep = NULL;
|
||||
nodep = nullptr;
|
||||
} else {
|
||||
if (basefromp) { UINFO(1, " Related node: " << basefromp << endl); }
|
||||
nodep->v3fatalSrc("Illegal bit select; no signal/member being extracted from");
|
||||
|
@ -478,7 +478,7 @@ private:
|
|||
// never used won't result in any warnings.
|
||||
} else {
|
||||
// Massive hack, just tie off all outputs so our analysis can proceed
|
||||
AstVar* varoutp = NULL;
|
||||
AstVar* varoutp = nullptr;
|
||||
for (AstNode* stmtp = m_modp->stmtsp(); stmtp; stmtp = stmtp->nextp()) {
|
||||
if (AstVar* varp = VN_CAST(stmtp, Var)) {
|
||||
if (varp->isReadOnly()) {
|
||||
|
@ -523,10 +523,10 @@ public:
|
|||
// CONSTRUCTORS
|
||||
explicit LinkResolveVisitor(AstNetlist* rootp)
|
||||
: m_lifetime(VLifetime::STATIC) { // Static outside a module/class
|
||||
m_classp = NULL;
|
||||
m_ftaskp = NULL;
|
||||
m_modp = NULL;
|
||||
m_assertp = NULL;
|
||||
m_classp = nullptr;
|
||||
m_ftaskp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_assertp = nullptr;
|
||||
m_senitemCvtNum = 0;
|
||||
iterate(rootp);
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit LinkBotupVisitor(AstNetlist* rootp) {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
//
|
||||
iterate(rootp);
|
||||
}
|
||||
|
|
26
src/V3List.h
26
src/V3List.h
|
@ -37,16 +37,16 @@ private:
|
|||
|
||||
public:
|
||||
V3List()
|
||||
: m_headp(NULL)
|
||||
, m_tailp(NULL) {}
|
||||
: m_headp(nullptr)
|
||||
, m_tailp(nullptr) {}
|
||||
~V3List() {}
|
||||
// METHODS
|
||||
T begin() const { return m_headp; }
|
||||
T end() const { return NULL; }
|
||||
bool empty() const { return m_headp == NULL; }
|
||||
T end() const { return nullptr; }
|
||||
bool empty() const { return m_headp == nullptr; }
|
||||
void reset() { // clear() without walking the list
|
||||
m_headp = NULL;
|
||||
m_tailp = NULL;
|
||||
m_headp = nullptr;
|
||||
m_tailp = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -56,8 +56,8 @@ template <class T> class V3ListEnt {
|
|||
// List entry for linked list of elements of type *T (T is a pointer type)
|
||||
private:
|
||||
// MEMBERS
|
||||
T m_nextp; // Pointer to next element, NULL=end
|
||||
T m_prevp; // Pointer to previous element, NULL=beginning
|
||||
T m_nextp; // Pointer to next element, nullptr=end
|
||||
T m_prevp; // Pointer to previous element, nullptr=beginning
|
||||
friend class V3List<T>;
|
||||
static V3ListEnt* baseToListEnt(void* newbasep, size_t offset) {
|
||||
// "this" must be a element inside of *basep
|
||||
|
@ -68,8 +68,8 @@ private:
|
|||
|
||||
public:
|
||||
V3ListEnt()
|
||||
: m_nextp(NULL)
|
||||
, m_prevp(NULL) {}
|
||||
: m_nextp(nullptr)
|
||||
, m_prevp(nullptr) {}
|
||||
~V3ListEnt() {
|
||||
#ifdef VL_DEBUG
|
||||
// Load bogus pointers so we can catch deletion bugs
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
// "this" must be a element inside of *newp
|
||||
// cppcheck-suppress thisSubtraction
|
||||
size_t offset = (size_t)(vluint8_t*)(this) - (size_t)(vluint8_t*)(newp);
|
||||
m_nextp = NULL;
|
||||
m_nextp = nullptr;
|
||||
if (!listr.m_headp) listr.m_headp = newp;
|
||||
m_prevp = listr.m_tailp;
|
||||
if (m_prevp) baseToListEnt(m_prevp, offset)->m_nextp = newp;
|
||||
|
@ -96,7 +96,7 @@ public:
|
|||
m_nextp = listr.m_headp;
|
||||
if (m_nextp) baseToListEnt(m_nextp, offset)->m_prevp = newp;
|
||||
listr.m_headp = newp;
|
||||
m_prevp = NULL;
|
||||
m_prevp = nullptr;
|
||||
if (!listr.m_tailp) listr.m_tailp = newp;
|
||||
}
|
||||
// Unlink from side
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
} else {
|
||||
listr.m_headp = m_nextp;
|
||||
}
|
||||
m_prevp = m_nextp = NULL;
|
||||
m_prevp = m_nextp = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ private:
|
|||
searchFuncStmts(nodep->stmtsp());
|
||||
searchFuncStmts(nodep->finalsp());
|
||||
iterateChildren(nodep);
|
||||
m_cfuncp = NULL;
|
||||
m_cfuncp = nullptr;
|
||||
}
|
||||
void searchFuncStmts(AstNode* nodep) {
|
||||
// Search for basic assignments to allow moving non-blocktemps
|
||||
|
@ -211,7 +211,7 @@ private:
|
|||
AstVarRef* firstasn = static_cast<AstVarRef*>(nodep->varp()->user4p());
|
||||
if (firstasn && nodep != firstasn) {
|
||||
clearStdOptimizable(nodep->varp(), "notFirstAsn");
|
||||
nodep->varp()->user4p(NULL);
|
||||
nodep->varp()->user4p(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit LocalizeVisitor(AstNetlist* nodep) {
|
||||
m_cfuncp = NULL;
|
||||
m_cfuncp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~LocalizeVisitor() {
|
||||
|
|
|
@ -150,7 +150,7 @@ private:
|
|||
if (VN_IS(andp->lhsp(), Const)) { return condp; }
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Apply (_ & 1'b1). This is necessary because this pass is after V3Clean,
|
||||
|
@ -204,7 +204,7 @@ private:
|
|||
|
||||
// Create equivalent 'if' statement and insert it before the first node
|
||||
AstIf* const ifp
|
||||
= new AstIf(m_mgCondp->fileline(), m_mgCondp->unlinkFrBack(), NULL, NULL);
|
||||
= new AstIf(m_mgCondp->fileline(), m_mgCondp->unlinkFrBack(), nullptr, nullptr);
|
||||
m_mgFirstp->replaceWith(ifp);
|
||||
ifp->addNextHere(m_mgFirstp);
|
||||
// Unzip the list and insert under branches
|
||||
|
@ -212,7 +212,7 @@ private:
|
|||
do {
|
||||
// Grab next pointer and unlink
|
||||
AstNode* const currp = nextp;
|
||||
nextp = currp != m_mgLastp ? currp->nextp() : NULL;
|
||||
nextp = currp != m_mgLastp ? currp->nextp() : nullptr;
|
||||
currp->unlinkFrBack();
|
||||
// Skip over comments
|
||||
if (VN_IS(currp, Comment)) {
|
||||
|
@ -235,10 +235,10 @@ private:
|
|||
} while (nextp);
|
||||
}
|
||||
// Reset state
|
||||
m_mgFirstp = NULL;
|
||||
m_mgCondp = NULL;
|
||||
m_mgLastp = NULL;
|
||||
m_mgNextp = NULL;
|
||||
m_mgFirstp = nullptr;
|
||||
m_mgCondp = nullptr;
|
||||
m_mgLastp = nullptr;
|
||||
m_mgNextp = nullptr;
|
||||
m_markVars.clear();
|
||||
}
|
||||
|
||||
|
@ -292,13 +292,13 @@ private:
|
|||
// Is it a 'lhs = cond & value' or 'lhs = value & cond'?
|
||||
if (AstAnd* const andp = VN_CAST(rhsp, And)) {
|
||||
if (andp->lhsp()->sameTree(m_mgCondp) || andp->rhsp()->sameTree(m_mgCondp)) {
|
||||
addToList(nodep, NULL);
|
||||
addToList(nodep, nullptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Is it simply 'lhs = cond'?
|
||||
if (rhsp->sameTree(m_mgCondp)) {
|
||||
addToList(nodep, NULL);
|
||||
addToList(nodep, nullptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -321,10 +321,10 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit MergeCondVisitor(AstNetlist* nodep) {
|
||||
m_mgFirstp = NULL;
|
||||
m_mgCondp = NULL;
|
||||
m_mgLastp = NULL;
|
||||
m_mgNextp = NULL;
|
||||
m_mgFirstp = nullptr;
|
||||
m_mgCondp = nullptr;
|
||||
m_mgLastp = nullptr;
|
||||
m_mgNextp = nullptr;
|
||||
m_listLenght = 0;
|
||||
m_markVars.clear();
|
||||
iterate(nodep);
|
||||
|
|
|
@ -137,7 +137,7 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
explicit NameVisitor(AstNetlist* nodep) {
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
iterate(nodep);
|
||||
}
|
||||
virtual ~NameVisitor() {}
|
||||
|
|
|
@ -1451,7 +1451,7 @@ V3Number& V3Number::opAtoN(const V3Number& lhs, int base) {
|
|||
str.erase(std::remove(str.begin(), str.end(), '_'), str.end());
|
||||
|
||||
errno = 0;
|
||||
long v = std::strtol(str.c_str(), NULL, base);
|
||||
long v = std::strtol(str.c_str(), nullptr, base);
|
||||
if (errno != 0) v = 0;
|
||||
return setLongS(static_cast<vlsint32_t>(v));
|
||||
}
|
||||
|
|
|
@ -164,9 +164,11 @@ public:
|
|||
opCleanThis();
|
||||
}
|
||||
// Create from a verilog 32'hxxxx number.
|
||||
V3Number(AstNode* nodep, const char* sourcep) { V3NumberCreate(nodep, sourcep, NULL); }
|
||||
V3Number(AstNode* nodep, const char* sourcep) { V3NumberCreate(nodep, sourcep, nullptr); }
|
||||
class FileLined {}; // Fileline based errors, for parsing only, otherwise pass nodep
|
||||
V3Number(FileLined, FileLine* fl, const char* sourcep) { V3NumberCreate(NULL, sourcep, fl); }
|
||||
V3Number(FileLined, FileLine* fl, const char* sourcep) {
|
||||
V3NumberCreate(nullptr, sourcep, fl);
|
||||
}
|
||||
class VerilogStringLiteral {}; // For creator type-overload selection
|
||||
V3Number(VerilogStringLiteral, AstNode* nodep, const string& str);
|
||||
class String {};
|
||||
|
@ -175,11 +177,11 @@ public:
|
|||
setString(value);
|
||||
}
|
||||
explicit V3Number(const V3Number* nump, int width = 1) {
|
||||
init(NULL, width);
|
||||
init(nullptr, width);
|
||||
m_fileline = nump->fileline();
|
||||
}
|
||||
V3Number(const V3Number* nump, int width, uint32_t value) {
|
||||
init(NULL, width);
|
||||
init(nullptr, width);
|
||||
m_value[0] = value;
|
||||
opCleanThis();
|
||||
m_fileline = nump->fileline();
|
||||
|
|
|
@ -827,7 +827,7 @@ string V3Options::protectKeyDefaulted() {
|
|||
void V3Options::throwSigsegv() { // LCOV_EXCL_START
|
||||
#if !(defined(VL_CPPCHECK) || defined(__clang_analyzer__))
|
||||
// clang-format off
|
||||
{ char* zp = NULL; *zp = 0; } // Intentional core dump, ignore warnings here
|
||||
{ char* zp = nullptr; *zp = 0; } // Intentional core dump, ignore warnings here
|
||||
// clang-format on
|
||||
#endif
|
||||
} // LCOV_EXCL_STOP
|
||||
|
@ -1711,7 +1711,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
|
|||
for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it) {
|
||||
argv.push_back(const_cast<char*>(it->c_str()));
|
||||
}
|
||||
argv.push_back(NULL); // argv is NULL-terminated
|
||||
argv.push_back(nullptr); // argv is nullptr-terminated
|
||||
parseOptsList(fl, optdir, static_cast<int>(argv.size() - 1), argv.data());
|
||||
}
|
||||
|
||||
|
@ -1904,7 +1904,7 @@ V3Options::V3Options() {
|
|||
addIncDirFallback("."); // Looks better than {long_cwd_path}/...
|
||||
}
|
||||
|
||||
V3Options::~V3Options() { VL_DO_CLEAR(delete m_impp, m_impp = NULL); }
|
||||
V3Options::~V3Options() { VL_DO_CLEAR(delete m_impp, m_impp = nullptr); }
|
||||
|
||||
void V3Options::setDebugMode(int level) {
|
||||
V3Error::debugDefault(level);
|
||||
|
|
113
src/V3Order.cpp
113
src/V3Order.cpp
|
@ -189,11 +189,11 @@ class OrderUser {
|
|||
// Stored in AstVarScope::user1p, a list of all the various vertices
|
||||
// that can exist for one given variable
|
||||
private:
|
||||
OrderVarVertex* m_vertexp[WV_MAX]; // Vertex of each type (if non NULL)
|
||||
OrderVarVertex* m_vertexp[WV_MAX]; // Vertex of each type (if non nullptr)
|
||||
public:
|
||||
// METHODS
|
||||
OrderVarVertex* newVarUserVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varscp,
|
||||
WhichVertex type, bool* createdp = NULL) {
|
||||
WhichVertex type, bool* createdp = nullptr) {
|
||||
UASSERT_OBJ(type < WV_MAX, varscp, "Bad case");
|
||||
OrderVarVertex* vertexp = m_vertexp[type];
|
||||
if (!vertexp) {
|
||||
|
@ -217,7 +217,7 @@ public:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
OrderUser() {
|
||||
for (int i = 0; i < WV_MAX; i++) m_vertexp[i] = NULL;
|
||||
for (int i = 0; i < WV_MAX; i++) m_vertexp[i] = nullptr;
|
||||
}
|
||||
~OrderUser() {}
|
||||
};
|
||||
|
@ -441,7 +441,7 @@ public:
|
|||
public:
|
||||
// Clients of ProcessMoveBuildGraph must supply MoveVertexMaker
|
||||
// which creates new T_MoveVertex's. Each new vertex wraps lvertexp
|
||||
// (which may be NULL.)
|
||||
// (which may be nullptr.)
|
||||
virtual T_MoveVertex* makeVertexp( //
|
||||
OrderLogicVertex* lvertexp, const OrderEitherVertex* varVertexp,
|
||||
const AstScope* scopep, const AstSenTree* domainp)
|
||||
|
@ -484,8 +484,8 @@ public:
|
|||
// For each logic node, make a T_MoveVertex
|
||||
for (V3GraphVertex* itp = m_graphp->verticesBeginp(); itp; itp = itp->verticesNextp()) {
|
||||
if (OrderLogicVertex* lvertexp = dynamic_cast<OrderLogicVertex*>(itp)) {
|
||||
T_MoveVertex* moveVxp = m_vxMakerp->makeVertexp(lvertexp, NULL, lvertexp->scopep(),
|
||||
lvertexp->domainp());
|
||||
T_MoveVertex* moveVxp = m_vxMakerp->makeVertexp(
|
||||
lvertexp, nullptr, lvertexp->scopep(), lvertexp->domainp());
|
||||
if (moveVxp) {
|
||||
// Cross link so we can find it later
|
||||
m_logic2move[lvertexp] = moveVxp;
|
||||
|
@ -532,14 +532,14 @@ private:
|
|||
const OrderEitherVertex* eithp
|
||||
= dynamic_cast<const OrderEitherVertex*>(nonLogicVxp);
|
||||
T_MoveVertex* newMoveVxp
|
||||
= m_vxMakerp->makeVertexp(NULL, eithp, eithp->scopep(), domainp);
|
||||
= m_vxMakerp->makeVertexp(nullptr, eithp, eithp->scopep(), domainp);
|
||||
m_var2move[key] = newMoveVxp;
|
||||
|
||||
// Find downstream logics that depend on (var, domain)
|
||||
if (!iterate(newMoveVxp, edgep->top(), domainp)) {
|
||||
// No downstream dependencies, so remove this
|
||||
// intermediate vertex.
|
||||
m_var2move[key] = NULL;
|
||||
m_var2move[key] = nullptr;
|
||||
m_vxMakerp->freeVertexp(newMoveVxp);
|
||||
continue;
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ public:
|
|||
const AstScope* scopep, const AstSenTree* domainp) {
|
||||
// Exclude initial/settle logic from the mtasks graph.
|
||||
// We'll output time-zero logic separately.
|
||||
if (domainp->hasInitial() || domainp->hasSettle()) return NULL;
|
||||
if (domainp->hasInitial() || domainp->hasSettle()) return nullptr;
|
||||
return new MTaskMoveVertex(m_pomGraphp, lvertexp, varVertexp, scopep, domainp);
|
||||
}
|
||||
void freeVertexp(MTaskMoveVertex* freeMep) { freeMep->unlinkDelete(m_pomGraphp); }
|
||||
|
@ -664,7 +664,7 @@ private:
|
|||
AstSenTree* m_comboDomainp; // Combo activation tree
|
||||
AstSenTree* m_deleteDomainp; // Delete this from tree
|
||||
OrderInputsVertex* m_inputsVxp; // Top level vertex all inputs point from
|
||||
OrderLogicVertex* m_logicVxp; // Current statement being tracked, NULL=ignored
|
||||
OrderLogicVertex* m_logicVxp; // Current statement being tracked, nullptr=ignored
|
||||
AstTopScope* m_topScopep; // Current top scope being processed
|
||||
AstScope* m_scopetopp; // Scope under TOPSCOPE
|
||||
AstNodeModule* m_modp; // Current module
|
||||
|
@ -702,10 +702,10 @@ private:
|
|||
UINFO(4, " STMT " << nodep << endl);
|
||||
// VV***** We reset user4p()
|
||||
AstNode::user4ClearTree();
|
||||
UASSERT_OBJ(m_activep && m_activep->sensesp(), nodep, "NULL");
|
||||
UASSERT_OBJ(m_activep && m_activep->sensesp(), nodep, "nullptr");
|
||||
// If inside combo logic, ignore the domain, we'll assign one based on interconnect
|
||||
AstSenTree* startDomainp = m_activep->sensesp();
|
||||
if (startDomainp->hasCombo()) startDomainp = NULL;
|
||||
if (startDomainp->hasCombo()) startDomainp = nullptr;
|
||||
m_logicVxp = new OrderLogicVertex(&m_graph, m_scopep, startDomainp, nodep);
|
||||
if (m_activeSenVxp) {
|
||||
// If in a clocked activation, add a link from the sensitivity to this block
|
||||
|
@ -714,12 +714,12 @@ private:
|
|||
}
|
||||
nodep->user1p(m_modp);
|
||||
iterateChildren(nodep);
|
||||
m_logicVxp = NULL;
|
||||
m_logicVxp = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
OrderVarVertex* newVarUserVertex(AstVarScope* varscp, WhichVertex type,
|
||||
bool* createdp = NULL) {
|
||||
bool* createdp = nullptr) {
|
||||
if (!varscp->user1p()) {
|
||||
OrderUser* newup = new OrderUser();
|
||||
m_orderUserps.push_back(newup);
|
||||
|
@ -759,8 +759,8 @@ private:
|
|||
Logics m_logics;
|
||||
ExecMTask* m_execMTaskp;
|
||||
MTaskState()
|
||||
: m_mtaskBodyp(NULL)
|
||||
, m_execMTaskp(NULL) {}
|
||||
: m_mtaskBodyp(nullptr)
|
||||
, m_execMTaskp(nullptr) {}
|
||||
};
|
||||
void processMTasks();
|
||||
typedef enum { LOGIC_INITIAL, LOGIC_SETTLE } InitialLogicE;
|
||||
|
@ -786,8 +786,8 @@ private:
|
|||
|
||||
void nodeMarkCircular(OrderVarVertex* vertexp, OrderEdge* edgep) {
|
||||
AstVarScope* nodep = vertexp->varScp();
|
||||
OrderLogicVertex* fromLVtxp = NULL;
|
||||
OrderLogicVertex* toLVtxp = NULL;
|
||||
OrderLogicVertex* fromLVtxp = nullptr;
|
||||
OrderLogicVertex* toLVtxp = nullptr;
|
||||
if (edgep) {
|
||||
fromLVtxp = dynamic_cast<OrderLogicVertex*>(edgep->fromp());
|
||||
toLVtxp = dynamic_cast<OrderLogicVertex*>(edgep->top());
|
||||
|
@ -951,7 +951,7 @@ private:
|
|||
// We're finished, complete the topscopes
|
||||
if (m_topScopep) {
|
||||
process();
|
||||
m_topScopep = NULL;
|
||||
m_topScopep = nullptr;
|
||||
}
|
||||
}
|
||||
virtual void visit(AstTopScope* nodep) override {
|
||||
|
@ -962,7 +962,7 @@ private:
|
|||
AstNode::user1ClearTree();
|
||||
AstNode::user3ClearTree();
|
||||
m_graph.clear();
|
||||
m_activep = NULL;
|
||||
m_activep = nullptr;
|
||||
m_topScopep = nodep;
|
||||
m_scopetopp = nodep->scopep();
|
||||
// Find global SenTrees
|
||||
|
@ -980,8 +980,8 @@ private:
|
|||
pushDeletep(m_deleteDomainp); // Cleanup when done
|
||||
UINFO(5, " DeleteDomain = " << m_deleteDomainp << endl);
|
||||
// Base vertices
|
||||
m_activeSenVxp = NULL;
|
||||
m_inputsVxp = new OrderInputsVertex(&m_graph, NULL);
|
||||
m_activeSenVxp = nullptr;
|
||||
m_inputsVxp = new OrderInputsVertex(&m_graph, nullptr);
|
||||
//
|
||||
iterateChildren(nodep);
|
||||
// Done topscope, erase extra user information
|
||||
|
@ -1001,18 +1001,18 @@ private:
|
|||
virtual void visit(AstScope* nodep) override {
|
||||
UINFO(4, " SCOPE " << nodep << endl);
|
||||
m_scopep = nodep;
|
||||
m_logicVxp = NULL;
|
||||
m_activeSenVxp = NULL;
|
||||
m_logicVxp = nullptr;
|
||||
m_activeSenVxp = nullptr;
|
||||
nodep->user1p(m_modp);
|
||||
// Iterate
|
||||
iterateChildren(nodep);
|
||||
m_scopep = NULL;
|
||||
m_scopep = nullptr;
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
// Create required activation blocks and add to module
|
||||
UINFO(4, " ACTIVE " << nodep << endl);
|
||||
m_activep = nodep;
|
||||
m_activeSenVxp = NULL;
|
||||
m_activeSenVxp = nullptr;
|
||||
m_inClocked = nodep->hasClocked();
|
||||
// Grab the sensitivity list
|
||||
UASSERT_OBJ(!nodep->sensesStorep(), nodep,
|
||||
|
@ -1020,8 +1020,8 @@ private:
|
|||
iterate(nodep->sensesp());
|
||||
// Collect statements under it
|
||||
iterateChildren(nodep);
|
||||
m_activep = NULL;
|
||||
m_activeSenVxp = NULL;
|
||||
m_activep = nullptr;
|
||||
m_activeSenVxp = nullptr;
|
||||
m_inClocked = false;
|
||||
}
|
||||
virtual void visit(AstVarScope* nodep) override {
|
||||
|
@ -1222,21 +1222,21 @@ private:
|
|||
public:
|
||||
// CONSTRUCTORS
|
||||
OrderVisitor() {
|
||||
m_topScopep = NULL;
|
||||
m_scopetopp = NULL;
|
||||
m_modp = NULL;
|
||||
m_scopep = NULL;
|
||||
m_activep = NULL;
|
||||
m_topScopep = nullptr;
|
||||
m_scopetopp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_scopep = nullptr;
|
||||
m_activep = nullptr;
|
||||
m_inSenTree = false;
|
||||
m_inClocked = false;
|
||||
m_inClkAss = false;
|
||||
m_inPre = m_inPost = false;
|
||||
m_comboDomainp = NULL;
|
||||
m_deleteDomainp = NULL;
|
||||
m_inputsVxp = NULL;
|
||||
m_activeSenVxp = NULL;
|
||||
m_logicVxp = NULL;
|
||||
m_pomNewFuncp = NULL;
|
||||
m_comboDomainp = nullptr;
|
||||
m_deleteDomainp = nullptr;
|
||||
m_inputsVxp = nullptr;
|
||||
m_activeSenVxp = nullptr;
|
||||
m_logicVxp = nullptr;
|
||||
m_pomNewFuncp = nullptr;
|
||||
m_pomNewStmts = 0;
|
||||
if (debug()) m_graph.debug(5); // 3 is default if global debug; we want acyc debugging
|
||||
}
|
||||
|
@ -1423,10 +1423,10 @@ void OrderVisitor::processCircular() {
|
|||
// other tests such as t_gated_clk_1.
|
||||
if (!v3Global.opt.orderClockDly()) {
|
||||
UINFO(5, "Circular Clock, no-order-clock-delay " << vvertexp << endl);
|
||||
nodeMarkCircular(vvertexp, NULL);
|
||||
nodeMarkCircular(vvertexp, nullptr);
|
||||
} else if (vvertexp->isDelayed()) {
|
||||
UINFO(5, "Circular Clock, delayed " << vvertexp << endl);
|
||||
nodeMarkCircular(vvertexp, NULL);
|
||||
nodeMarkCircular(vvertexp, nullptr);
|
||||
} else {
|
||||
UINFO(5, "Circular Clock, not delayed " << vvertexp << endl);
|
||||
}
|
||||
|
@ -1494,7 +1494,7 @@ void OrderVisitor::processDomainsIterate(OrderEitherVertex* vertexp) {
|
|||
if (vertexp->domainp()) return; // Already processed, or sequential logic
|
||||
UINFO(5, " pdi: " << vertexp << endl);
|
||||
OrderVarVertex* vvertexp = dynamic_cast<OrderVarVertex*>(vertexp);
|
||||
AstSenTree* domainp = NULL;
|
||||
AstSenTree* domainp = nullptr;
|
||||
UASSERT(m_comboDomainp, "not preset");
|
||||
if (vvertexp && vvertexp->varScp()->varp()->isNonOutput()) domainp = m_comboDomainp;
|
||||
if (vvertexp && vvertexp->varScp()->isCircular()) domainp = m_comboDomainp;
|
||||
|
@ -1534,7 +1534,7 @@ void OrderVisitor::processDomainsIterate(OrderEitherVertex* vertexp) {
|
|||
UASSERT_OBJ(newtree2p, fromVertexp->domainp(),
|
||||
"No senitem found under clocked domain");
|
||||
newtreep->addSensesp(newtree2p);
|
||||
newtree2p = NULL; // Below edit may replace it
|
||||
newtree2p = nullptr; // Below edit may replace it
|
||||
V3Const::constifyExpensiveEdit(newtreep); // Remove duplicates
|
||||
newtreep->multi(true); // Comment that it was made from 2 clock domains
|
||||
domainp = m_finder.getSenTree(newtreep);
|
||||
|
@ -1617,7 +1617,7 @@ void OrderVisitor::processMoveBuildGraph() {
|
|||
UINFO(5, " MoveBuildGraph\n");
|
||||
processMoveClear();
|
||||
m_pomGraph
|
||||
.userClearVertices(); // Vertex::user->OrderMoveVertex*, last edge added or NULL=none
|
||||
.userClearVertices(); // Vertex::user->OrderMoveVertex*, last edge added or nullptr=none
|
||||
|
||||
OrderMoveVertexMaker createOrderMoveVertex(&m_pomGraph, &m_pomWaiting);
|
||||
ProcessMoveBuildGraph<OrderMoveVertex> serialPMBG(&m_graph, &m_pomGraph,
|
||||
|
@ -1654,13 +1654,14 @@ void OrderVisitor::processMove() {
|
|||
while (domScopep) {
|
||||
UINFO(6, " MoveDomain l=" << domScopep->domainp() << endl);
|
||||
// Process all nodes ready under same domain & scope
|
||||
m_pomNewFuncp = NULL;
|
||||
m_pomNewFuncp = nullptr;
|
||||
while (OrderMoveVertex* vertexp
|
||||
= domScopep->readyVertices().begin()) { // lintok-begin-on-ref
|
||||
processMoveOne(vertexp, domScopep, 1);
|
||||
}
|
||||
// Done with scope/domain pair, pick new scope under same domain, or NULL if none left
|
||||
OrderMoveDomScope* domScopeNextp = NULL;
|
||||
// Done with scope/domain pair, pick new scope under same domain, or nullptr if none
|
||||
// left
|
||||
OrderMoveDomScope* domScopeNextp = nullptr;
|
||||
for (OrderMoveDomScope* huntp = m_pomReadyDomScope.begin(); huntp;
|
||||
huntp = huntp->readyDomScopeNextp()) {
|
||||
if (huntp->domainp() == domScopep->domainp()) {
|
||||
|
@ -1745,12 +1746,12 @@ void OrderVisitor::processMoveOne(OrderMoveVertex* vertexp, OrderMoveDomScope* d
|
|||
|
||||
AstActive* OrderVisitor::processMoveOneLogic(const OrderLogicVertex* lvertexp,
|
||||
AstCFunc*& newFuncpr, int& newStmtsr) {
|
||||
AstActive* activep = NULL;
|
||||
AstActive* activep = nullptr;
|
||||
AstScope* scopep = lvertexp->scopep();
|
||||
AstSenTree* domainp = lvertexp->domainp();
|
||||
AstNode* nodep = lvertexp->nodep();
|
||||
AstNodeModule* modp = VN_CAST(scopep->user1p(), NodeModule); // Stashed by visitor func
|
||||
UASSERT(modp, "NULL");
|
||||
UASSERT(modp, "nullptr");
|
||||
if (VN_IS(nodep, SenTree)) {
|
||||
// Just ignore sensitivities, we'll deal with them when we move statements that need them
|
||||
} else { // Normal logic
|
||||
|
@ -1759,7 +1760,7 @@ AstActive* OrderVisitor::processMoveOneLogic(const OrderLogicVertex* lvertexp,
|
|||
|| (v3Global.opt.outputSplitCFuncs()
|
||||
&& v3Global.opt.outputSplitCFuncs() < newStmtsr)) {
|
||||
// Put every statement into a unique function to ease profiling or reduce function size
|
||||
newFuncpr = NULL;
|
||||
newFuncpr = nullptr;
|
||||
}
|
||||
if (!newFuncpr && domainp != m_deleteDomainp) {
|
||||
string name = cfuncName(modp, domainp, scopep, nodep);
|
||||
|
@ -1800,8 +1801,8 @@ void OrderVisitor::processMTasksInitial(InitialLogicE logic_type) {
|
|||
// mtask partition, aren't eligible for parallelism.
|
||||
//
|
||||
int initStmts = 0;
|
||||
AstCFunc* initCFunc = NULL;
|
||||
AstScope* lastScopep = NULL;
|
||||
AstCFunc* initCFunc = nullptr;
|
||||
AstScope* lastScopep = nullptr;
|
||||
for (V3GraphVertex* initVxp = m_graph.verticesBeginp(); initVxp;
|
||||
initVxp = initVxp->verticesNextp()) {
|
||||
OrderLogicVertex* initp = dynamic_cast<OrderLogicVertex*>(initVxp);
|
||||
|
@ -1810,7 +1811,7 @@ void OrderVisitor::processMTasksInitial(InitialLogicE logic_type) {
|
|||
if ((logic_type == LOGIC_SETTLE) && !initp->domainp()->hasSettle()) continue;
|
||||
if (initp->scopep() != lastScopep) {
|
||||
// Start new cfunc, don't let the cfunc cross scopes
|
||||
initCFunc = NULL;
|
||||
initCFunc = nullptr;
|
||||
lastScopep = initp->scopep();
|
||||
}
|
||||
AstActive* newActivep = processMoveOneLogic(initp, initCFunc /*ref*/, initStmts /*ref*/);
|
||||
|
@ -1911,15 +1912,15 @@ void OrderVisitor::processMTasks() {
|
|||
// Create leaf CFunc's to run this mtask's logic,
|
||||
// and create a set of AstActive's to call those CFuncs.
|
||||
// Add the AstActive's into the AstMTaskBody.
|
||||
const AstSenTree* last_domainp = NULL;
|
||||
AstCFunc* leafCFuncp = NULL;
|
||||
const AstSenTree* last_domainp = nullptr;
|
||||
AstCFunc* leafCFuncp = nullptr;
|
||||
int leafStmts = 0;
|
||||
for (MTaskState::Logics::iterator it = state.m_logics.begin(); it != state.m_logics.end();
|
||||
++it) {
|
||||
const OrderLogicVertex* logicp = *it;
|
||||
if (logicp->domainp() != last_domainp) {
|
||||
// Start a new leaf function.
|
||||
leafCFuncp = NULL;
|
||||
leafCFuncp = nullptr;
|
||||
}
|
||||
last_domainp = logicp->domainp();
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
class OrderEitherVertex : public V3GraphVertex {
|
||||
AstScope* m_scopep; // Scope the vertex is in
|
||||
AstSenTree* m_domainp; // Clock domain (NULL = to be computed as we iterate)
|
||||
AstSenTree* m_domainp; // Clock domain (nullptr = to be computed as we iterate)
|
||||
bool m_isFromInput; // From input, or derived therefrom (conservatively false)
|
||||
protected:
|
||||
OrderEitherVertex(V3Graph* graphp, const OrderEitherVertex& old)
|
||||
|
@ -158,7 +158,7 @@ class OrderInputsVertex : public OrderEitherVertex {
|
|||
|
||||
public:
|
||||
OrderInputsVertex(V3Graph* graphp, AstSenTree* domainp)
|
||||
: OrderEitherVertex(graphp, NULL, domainp) {
|
||||
: OrderEitherVertex(graphp, nullptr, domainp) {
|
||||
isFromInput(true); // By definition
|
||||
}
|
||||
virtual ~OrderInputsVertex() {}
|
||||
|
@ -211,7 +211,7 @@ protected:
|
|||
|
||||
public:
|
||||
OrderVarVertex(V3Graph* graphp, AstScope* scopep, AstVarScope* varScp)
|
||||
: OrderEitherVertex(graphp, scopep, NULL)
|
||||
: OrderEitherVertex(graphp, scopep, nullptr)
|
||||
, m_varScp(varScp)
|
||||
, m_isClock(false)
|
||||
, m_isDelayed(false) {}
|
||||
|
@ -331,11 +331,11 @@ public:
|
|||
: V3GraphVertex(graphp)
|
||||
, m_logicp(logicp)
|
||||
, m_state(POM_WAIT)
|
||||
, m_domScopep(NULL) {}
|
||||
, m_domScopep(nullptr) {}
|
||||
virtual ~OrderMoveVertex() {}
|
||||
virtual OrderMoveVertex* clone(V3Graph* graphp) const {
|
||||
v3fatalSrc("Unsupported");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// METHODS
|
||||
virtual OrderVEdgeType type() const { return OrderVEdgeType::VERTEX_MOVE; }
|
||||
|
@ -350,7 +350,7 @@ public:
|
|||
if (logicp()) {
|
||||
return logicp()->fileline();
|
||||
} else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
virtual string name() const {
|
||||
|
@ -405,7 +405,7 @@ public:
|
|||
virtual ~MTaskMoveVertex() {}
|
||||
virtual MTaskMoveVertex* clone(V3Graph* graphp) const {
|
||||
v3fatalSrc("Unsupported");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
virtual OrderVEdgeType type() const { return OrderVEdgeType::VERTEX_MOVE; }
|
||||
virtual string dotColor() const {
|
||||
|
|
|
@ -259,7 +259,7 @@ string V3Os::trueRandom(size_t size) {
|
|||
// Note: std::string.data() returns a non-const Char* from C++17 onwards.
|
||||
// For pre-C++17, this cast is OK in practice, even though it's UB.
|
||||
#if defined(_WIN32) || defined(__MINGW32__)
|
||||
NTSTATUS hr = BCryptGenRandom(NULL, reinterpret_cast<BYTE*>(data), size,
|
||||
NTSTATUS hr = BCryptGenRandom(nullptr, reinterpret_cast<BYTE*>(data), size,
|
||||
BCRYPT_USE_SYSTEM_PREFERRED_RNG);
|
||||
if (!BCRYPT_SUCCESS(hr)) { v3fatal("Could not acquire random data."); }
|
||||
#else
|
||||
|
@ -290,7 +290,7 @@ uint64_t V3Os::timeUsecs() {
|
|||
#else
|
||||
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
|
||||
timeval tv;
|
||||
if (gettimeofday(&tv, NULL) < 0) return 0;
|
||||
if (gettimeofday(&tv, nullptr) < 0) return 0;
|
||||
return static_cast<uint64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
AstNodeModule* findByParams(const string& origName, AstPin* firstPinp,
|
||||
const AstNodeModule* modp) {
|
||||
if (m_hierBlockOptsByOrigName.find(origName) == m_hierBlockOptsByOrigName.end()) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// This module is a hierarchical block. Need to replace it by the protect-lib wrapper.
|
||||
const std::pair<HierMapIt, HierMapIt> candidates
|
||||
|
@ -191,7 +191,7 @@ public:
|
|||
hierIt->second->mangledName() << " is not found");
|
||||
|
||||
HierBlockModMap::const_iterator it = m_hierBlockMod.find(hierIt->second->mangledName());
|
||||
if (it == m_hierBlockMod.end()) return NULL;
|
||||
if (it == m_hierBlockMod.end()) return nullptr;
|
||||
return it->second;
|
||||
}
|
||||
};
|
||||
|
@ -332,7 +332,7 @@ private:
|
|||
if (AstBracketArrayDType* adtypep = VN_CAST(nodep, BracketArrayDType)) {
|
||||
return adtypep->subDTypep();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
void collectPins(CloneMap* clonemapp, AstNodeModule* modp) {
|
||||
// Grab all I/O so we can remap our pins later
|
||||
|
@ -475,12 +475,12 @@ private:
|
|||
for (CellList::iterator it = m_cellps.begin(); it != m_cellps.end(); ++it) {
|
||||
AstCell* cellp = *it;
|
||||
if (string* genHierNamep = (string*)cellp->user5p()) {
|
||||
cellp->user5p(NULL);
|
||||
cellp->user5p(nullptr);
|
||||
VL_DO_DANGLING(delete genHierNamep, genHierNamep);
|
||||
}
|
||||
}
|
||||
m_cellps.clear();
|
||||
m_modp = NULL;
|
||||
m_modp = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ private:
|
|||
virtual void visit(AstNodeFTask* nodep) override {
|
||||
m_ftaskp = nodep;
|
||||
iterateChildren(nodep);
|
||||
m_ftaskp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
}
|
||||
|
||||
// Make sure all parameters are constantified
|
||||
|
@ -621,7 +621,7 @@ private:
|
|||
}
|
||||
}
|
||||
}
|
||||
nodep->varp(NULL); // Needs relink, as may remove pointed-to var
|
||||
nodep->varp(nullptr); // Needs relink, as may remove pointed-to var
|
||||
}
|
||||
|
||||
virtual void visit(AstUnlinkedRef* nodep) override {
|
||||
|
@ -730,7 +730,7 @@ private:
|
|||
}
|
||||
virtual void visit(AstGenCase* nodep) override {
|
||||
UINFO(9, " GENCASE " << nodep << endl);
|
||||
AstNode* keepp = NULL;
|
||||
AstNode* keepp = nullptr;
|
||||
iterateAndNextNull(nodep->exprp());
|
||||
V3Case::caseLint(nodep);
|
||||
V3Width::widthParamsEdit(nodep); // Param typed widthing will NOT recurse the body,
|
||||
|
@ -786,8 +786,8 @@ public:
|
|||
explicit ParamVisitor(AstNetlist* nodep)
|
||||
: m_hierBlocks(v3Global.opt.hierBlocks(), nodep) {
|
||||
m_longId = 0;
|
||||
m_ftaskp = NULL;
|
||||
m_modp = NULL;
|
||||
m_ftaskp = nullptr;
|
||||
m_modp = nullptr;
|
||||
m_nextValue = 1;
|
||||
for (AstNodeModule* modp = nodep->modulesp(); modp;
|
||||
modp = VN_CAST(modp->nextp(), NodeModule)) {
|
||||
|
@ -899,7 +899,7 @@ void ParamVisitor::visitCell(AstCell* nodep, const string& hierName) {
|
|||
portIrefp = VN_CAST(arraySubDTypep(modvarp->subDTypep()), IfaceRefDType);
|
||||
}
|
||||
|
||||
AstIfaceRefDType* pinIrefp = NULL;
|
||||
AstIfaceRefDType* pinIrefp = nullptr;
|
||||
AstNode* exprp = pinp->exprp();
|
||||
if (exprp && VN_IS(exprp, VarRef) && VN_CAST(exprp, VarRef)->varp()
|
||||
&& VN_CAST(exprp, VarRef)->varp()->subDTypep()
|
||||
|
@ -989,7 +989,7 @@ void ParamVisitor::visitCell(AstCell* nodep, const string& hierName) {
|
|||
|
||||
//
|
||||
// Already made this flavor?
|
||||
AstNodeModule* cellmodp = NULL;
|
||||
AstNodeModule* cellmodp = nullptr;
|
||||
ModNameMap::iterator iter = m_modNameMap.find(newname);
|
||||
if (iter != m_modNameMap.end()) cellmodp = iter->second.m_modp;
|
||||
if (!cellmodp) {
|
||||
|
|
|
@ -32,7 +32,7 @@ int V3ParseImp::bisonParse() {
|
|||
|
||||
const char* V3ParseImp::tokenName(int token) {
|
||||
#if YYDEBUG || YYERROR_VERBOSE
|
||||
static const char** nameTablep = NULL;
|
||||
static const char** nameTablep = nullptr;
|
||||
if (!nameTablep) {
|
||||
int size;
|
||||
for (size = 0; yytname[size]; ++size) {}
|
||||
|
@ -59,7 +59,7 @@ const char* V3ParseImp::tokenName(int token) {
|
|||
|
||||
void V3ParseImp::parserClear() {
|
||||
// Clear up any dynamic memory V3Parser required
|
||||
VARDTYPE(NULL);
|
||||
VARDTYPE(nullptr);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
|
@ -67,8 +67,8 @@ void V3ParseImp::parserClear() {
|
|||
|
||||
AstNode* V3ParseGrammar::argWrapList(AstNode* nodep) {
|
||||
// Convert list of expressions to list of arguments
|
||||
if (!nodep) return NULL;
|
||||
AstNode* outp = NULL;
|
||||
if (!nodep) return nullptr;
|
||||
AstNode* outp = nullptr;
|
||||
AstBegin* tempp = new AstBegin(nodep->fileline(), "[EditWrapper]", nodep);
|
||||
while (nodep) {
|
||||
AstNode* nextp = nodep->nextp();
|
||||
|
@ -152,7 +152,7 @@ AstVar* V3ParseGrammar::createVariable(FileLine* fileline, const string& name,
|
|||
if (GRAMMARP->m_varIO == VDirection::NONE && GRAMMARP->m_varDecl == AstVarType::PORT) {
|
||||
// Just a port list with variable name (not v2k format); AstPort already created
|
||||
if (dtypep) fileline->v3warn(E_UNSUPPORTED, "Unsupported: Ranges ignored in port-lists");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (GRAMMARP->m_varDecl == AstVarType::WREAL) {
|
||||
// dtypep might not be null, might be implicit LOGIC before we knew better
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
//======================================================================
|
||||
// Globals
|
||||
|
||||
V3ParseImp* V3ParseImp::s_parsep = NULL;
|
||||
V3ParseImp* V3ParseImp::s_parsep = nullptr;
|
||||
|
||||
int V3ParseSym::s_anonNum = 0;
|
||||
|
||||
|
@ -195,7 +195,7 @@ double V3ParseImp::lexParseTimenum(const char* textp) {
|
|||
if (*sp != '_') *dp++ = *sp;
|
||||
}
|
||||
*dp++ = '\0';
|
||||
double d = strtod(strgp, NULL);
|
||||
double d = strtod(strgp, nullptr);
|
||||
string suffix(sp);
|
||||
|
||||
double divisor = 1;
|
||||
|
@ -293,7 +293,7 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i
|
|||
// Create output file with all the preprocessor output we buffered up
|
||||
string vppfilename
|
||||
= v3Global.opt.hierTopDataDir() + "/" + v3Global.opt.prefix() + "_" + modname + ".vpp";
|
||||
std::ofstream* ofp = NULL;
|
||||
std::ofstream* ofp = nullptr;
|
||||
std::ostream* osp;
|
||||
if (v3Global.opt.preprocOnly()) {
|
||||
osp = &cout;
|
||||
|
@ -489,7 +489,7 @@ void V3ParseImp::tokenPipelineSym() {
|
|||
// if (debug() >= 7) V3ParseImp::parsep()->symp()->dump(cout, " -symtree: ");
|
||||
foundp = look_underp->findIdFallback(*(yylval.strp));
|
||||
// "consume" it. Must set again if want another token under temp scope
|
||||
V3ParseImp::parsep()->symp()->nextId(NULL);
|
||||
V3ParseImp::parsep()->symp()->nextId(nullptr);
|
||||
} else {
|
||||
UINFO(7, " tokenPipelineSym: find upward "
|
||||
<< V3ParseImp::parsep()->symp()->symCurrentp() << " for '"
|
||||
|
@ -519,10 +519,10 @@ void V3ParseImp::tokenPipelineSym() {
|
|||
&& (*(yylval.strp) == "mailbox" // IEEE-standard class
|
||||
|| *(yylval.strp) == "process" // IEEE-standard class
|
||||
|| *(yylval.strp) == "semaphore")) { // IEEE-standard class
|
||||
yylval.scp = NULL;
|
||||
yylval.scp = nullptr;
|
||||
if (token == yaID__LEX) token = yaID__aTYPE;
|
||||
} else { // Not found
|
||||
yylval.scp = NULL;
|
||||
yylval.scp = nullptr;
|
||||
if (token == yaID__CC) {
|
||||
// IEEE does require this, but we may relax this as UVM breaks it, so allow bbox
|
||||
// for today
|
||||
|
@ -550,7 +550,7 @@ int V3ParseImp::tokenToBison() {
|
|||
tokenPipelineSym(); // sets yylval
|
||||
m_bisonLastFileline = yylval.fl;
|
||||
|
||||
// yylval.scp = NULL; // Symbol table not yet needed - no packages
|
||||
// yylval.scp = nullptr; // Symbol table not yet needed - no packages
|
||||
if (debugFlex() >= 6 || debugBison() >= 6) { // --debugi-flex and --debugi-bison
|
||||
cout << "tokenToBison " << yylval << endl;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ V3Parse::V3Parse(AstNetlist* rootp, VInFilter* filterp, V3ParseSym* symp) {
|
|||
m_impp = new V3ParseImp(rootp, filterp, symp);
|
||||
}
|
||||
V3Parse::~V3Parse() { //
|
||||
VL_DO_CLEAR(delete m_impp, m_impp = NULL);
|
||||
VL_DO_CLEAR(delete m_impp, m_impp = nullptr);
|
||||
}
|
||||
void V3Parse::parseFile(FileLine* fileline, const string& modname, bool inLibrary,
|
||||
const string& errmsg) {
|
||||
|
|
|
@ -180,7 +180,7 @@ class V3ParseImp {
|
|||
std::deque<FileLine> m_lexLintState; // Current lint state for save/restore
|
||||
std::deque<string> m_ppBuffers; // Preprocessor->lex buffer of characters to process
|
||||
|
||||
AstNode* m_tagNodep; // Points to the node to set to m_tag or NULL to not set.
|
||||
AstNode* m_tagNodep; // Points to the node to set to m_tag or nullptr to not set.
|
||||
VTimescale m_timeLastUnit; // Last `timescale's unit
|
||||
|
||||
public:
|
||||
|
@ -304,13 +304,13 @@ public:
|
|||
: m_rootp(rootp)
|
||||
, m_filterp(filterp)
|
||||
, m_symp(parserSymp) {
|
||||
m_lexFileline = NULL;
|
||||
m_lexerp = NULL;
|
||||
m_lexFileline = nullptr;
|
||||
m_lexerp = nullptr;
|
||||
m_inLibrary = false;
|
||||
m_lexKwdDepth = 0;
|
||||
m_lexKwdLast = stateVerilogRecent();
|
||||
m_lexPrevToken = 0;
|
||||
m_tagNodep = NULL;
|
||||
m_tagNodep = nullptr;
|
||||
m_timeLastUnit = v3Global.opt.timeDefaultUnit();
|
||||
}
|
||||
~V3ParseImp();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue