Internals: Clean up some constructors. No functional change intended.
This commit is contained in:
parent
08fef668cd
commit
6c9cbaef62
|
|
@ -45,11 +45,11 @@ public:
|
||||||
|
|
||||||
ArrayInfo(const std::string& name, void* datap, int index, const std::vector<IData>& indices,
|
ArrayInfo(const std::string& name, void* datap, int index, const std::vector<IData>& indices,
|
||||||
const std::vector<size_t>& idxWidths)
|
const std::vector<size_t>& idxWidths)
|
||||||
: m_name(name)
|
: m_name{name}
|
||||||
, m_datap(datap)
|
, m_datap{datap}
|
||||||
, m_index(index)
|
, m_index{index}
|
||||||
, m_indices(indices)
|
, m_indices{indices}
|
||||||
, m_idxWidths(idxWidths) {}
|
, m_idxWidths{idxWidths} {}
|
||||||
};
|
};
|
||||||
using ArrayInfoMap = std::map<std::string, std::shared_ptr<const ArrayInfo>>;
|
using ArrayInfoMap = std::map<std::string, std::shared_ptr<const ArrayInfo>>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1415,7 +1415,7 @@ public:
|
||||||
|
|
||||||
// cppcheck-suppress noExplicitConstructor
|
// cppcheck-suppress noExplicitConstructor
|
||||||
constexpr VStrength(en strengthLevel)
|
constexpr VStrength(en strengthLevel)
|
||||||
: m_e(strengthLevel) {}
|
: m_e{strengthLevel} {}
|
||||||
explicit VStrength(int _e)
|
explicit VStrength(int _e)
|
||||||
: m_e(static_cast<en>(_e)) {} // Need () or GCC 4.8 false warning
|
: m_e(static_cast<en>(_e)) {} // Need () or GCC 4.8 false warning
|
||||||
constexpr operator en() const { return m_e; }
|
constexpr operator en() const { return m_e; }
|
||||||
|
|
|
||||||
|
|
@ -245,12 +245,12 @@ protected:
|
||||||
numeric(VSigning::fromBool(numericUnpack.isSigned()));
|
numeric(VSigning::fromBool(numericUnpack.isSigned()));
|
||||||
}
|
}
|
||||||
AstNodeUOrStructDType(const AstNodeUOrStructDType& other)
|
AstNodeUOrStructDType(const AstNodeUOrStructDType& other)
|
||||||
: AstNodeDType(other)
|
: AstNodeDType{other}
|
||||||
, m_name(other.m_name)
|
, m_name{other.m_name}
|
||||||
, m_uniqueNum(uniqueNumInc())
|
, m_uniqueNum{uniqueNumInc()}
|
||||||
, m_packed(other.m_packed)
|
, m_packed{other.m_packed}
|
||||||
, m_isFourstate(other.m_isFourstate)
|
, m_isFourstate{other.m_isFourstate}
|
||||||
, m_constrainedRand(false) {}
|
, m_constrainedRand{false} {}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTGEN_MEMBERS_AstNodeUOrStructDType;
|
ASTGEN_MEMBERS_AstNodeUOrStructDType;
|
||||||
|
|
@ -684,8 +684,8 @@ public:
|
||||||
}
|
}
|
||||||
AstDefImplicitDType(const AstDefImplicitDType& other)
|
AstDefImplicitDType(const AstDefImplicitDType& other)
|
||||||
: AstNodeDType(other)
|
: AstNodeDType(other)
|
||||||
, m_name(other.m_name)
|
, m_name{other.m_name}
|
||||||
, m_uniqueNum(uniqueNumInc()) {}
|
, m_uniqueNum{uniqueNumInc()} {}
|
||||||
ASTGEN_MEMBERS_AstDefImplicitDType;
|
ASTGEN_MEMBERS_AstDefImplicitDType;
|
||||||
int uniqueNum() const { return m_uniqueNum; }
|
int uniqueNum() const { return m_uniqueNum; }
|
||||||
bool sameNode(const AstNode* samep) const override {
|
bool sameNode(const AstNode* samep) const override {
|
||||||
|
|
@ -800,9 +800,9 @@ public:
|
||||||
widthFromSub(subDTypep());
|
widthFromSub(subDTypep());
|
||||||
}
|
}
|
||||||
AstEnumDType(const AstEnumDType& other)
|
AstEnumDType(const AstEnumDType& other)
|
||||||
: AstNodeDType(other)
|
: AstNodeDType{other}
|
||||||
, m_name(other.m_name)
|
, m_name{other.m_name}
|
||||||
, m_uniqueNum(uniqueNumInc()) {}
|
, m_uniqueNum{uniqueNumInc()} {}
|
||||||
ASTGEN_MEMBERS_AstEnumDType;
|
ASTGEN_MEMBERS_AstEnumDType;
|
||||||
|
|
||||||
const char* broken() const override;
|
const char* broken() const override;
|
||||||
|
|
@ -925,7 +925,7 @@ public:
|
||||||
AstNode* valuep)
|
AstNode* valuep)
|
||||||
: ASTGEN_SUPER_MemberDType(fl)
|
: ASTGEN_SUPER_MemberDType(fl)
|
||||||
, m_name{name}
|
, m_name{name}
|
||||||
, m_constrainedRand(false) {
|
, m_constrainedRand{false} {
|
||||||
childDTypep(dtp); // Only for parser
|
childDTypep(dtp); // Only for parser
|
||||||
this->valuep(valuep);
|
this->valuep(valuep);
|
||||||
dtypep(nullptr); // V3Width will resolve
|
dtypep(nullptr); // V3Width will resolve
|
||||||
|
|
@ -934,7 +934,7 @@ public:
|
||||||
AstMemberDType(FileLine* fl, const string& name, AstNodeDType* dtp)
|
AstMemberDType(FileLine* fl, const string& name, AstNodeDType* dtp)
|
||||||
: ASTGEN_SUPER_MemberDType(fl)
|
: ASTGEN_SUPER_MemberDType(fl)
|
||||||
, m_name{name}
|
, m_name{name}
|
||||||
, m_constrainedRand(false) {
|
, m_constrainedRand{false} {
|
||||||
UASSERT(dtp, "AstMember created with no dtype");
|
UASSERT(dtp, "AstMember created with no dtype");
|
||||||
refDTypep(dtp);
|
refDTypep(dtp);
|
||||||
dtypep(this);
|
dtypep(this);
|
||||||
|
|
@ -1434,7 +1434,7 @@ public:
|
||||||
// isSoft implies packed
|
// isSoft implies packed
|
||||||
AstUnionDType(FileLine* fl, bool isSoft, VSigning numericUnpack)
|
AstUnionDType(FileLine* fl, bool isSoft, VSigning numericUnpack)
|
||||||
: ASTGEN_SUPER_UnionDType(fl, numericUnpack)
|
: ASTGEN_SUPER_UnionDType(fl, numericUnpack)
|
||||||
, m_isSoft(isSoft) {
|
, m_isSoft{isSoft} {
|
||||||
packed(packed() | m_isSoft);
|
packed(packed() | m_isSoft);
|
||||||
}
|
}
|
||||||
ASTGEN_MEMBERS_AstUnionDType;
|
ASTGEN_MEMBERS_AstUnionDType;
|
||||||
|
|
|
||||||
|
|
@ -820,14 +820,14 @@ public:
|
||||||
: ASTGEN_SUPER_ConsDynArray(fl) {}
|
: ASTGEN_SUPER_ConsDynArray(fl) {}
|
||||||
explicit AstConsDynArray(FileLine* fl, bool lhsIsValue, AstNode* lhsp)
|
explicit AstConsDynArray(FileLine* fl, bool lhsIsValue, AstNode* lhsp)
|
||||||
: ASTGEN_SUPER_ConsDynArray(fl)
|
: ASTGEN_SUPER_ConsDynArray(fl)
|
||||||
, m_lhsIsValue(lhsIsValue) {
|
, m_lhsIsValue{lhsIsValue} {
|
||||||
this->lhsp(lhsp);
|
this->lhsp(lhsp);
|
||||||
}
|
}
|
||||||
explicit AstConsDynArray(FileLine* fl, bool lhsIsValue, AstNode* lhsp, bool rhsIsValue,
|
explicit AstConsDynArray(FileLine* fl, bool lhsIsValue, AstNode* lhsp, bool rhsIsValue,
|
||||||
AstNode* rhsp)
|
AstNode* rhsp)
|
||||||
: ASTGEN_SUPER_ConsDynArray(fl)
|
: ASTGEN_SUPER_ConsDynArray(fl)
|
||||||
, m_lhsIsValue(lhsIsValue)
|
, m_lhsIsValue{lhsIsValue}
|
||||||
, m_rhsIsValue(rhsIsValue) {
|
, m_rhsIsValue{rhsIsValue} {
|
||||||
this->lhsp(lhsp);
|
this->lhsp(lhsp);
|
||||||
this->rhsp(rhsp);
|
this->rhsp(rhsp);
|
||||||
}
|
}
|
||||||
|
|
@ -902,14 +902,14 @@ public:
|
||||||
: ASTGEN_SUPER_ConsQueue(fl) {}
|
: ASTGEN_SUPER_ConsQueue(fl) {}
|
||||||
explicit AstConsQueue(FileLine* fl, bool lhsIsValue, AstNode* lhsp)
|
explicit AstConsQueue(FileLine* fl, bool lhsIsValue, AstNode* lhsp)
|
||||||
: ASTGEN_SUPER_ConsQueue(fl)
|
: ASTGEN_SUPER_ConsQueue(fl)
|
||||||
, m_lhsIsValue(lhsIsValue) {
|
, m_lhsIsValue{lhsIsValue} {
|
||||||
this->lhsp(lhsp);
|
this->lhsp(lhsp);
|
||||||
}
|
}
|
||||||
explicit AstConsQueue(FileLine* fl, bool lhsIsValue, AstNode* lhsp, bool rhsIsValue,
|
explicit AstConsQueue(FileLine* fl, bool lhsIsValue, AstNode* lhsp, bool rhsIsValue,
|
||||||
AstNode* rhsp)
|
AstNode* rhsp)
|
||||||
: ASTGEN_SUPER_ConsQueue(fl)
|
: ASTGEN_SUPER_ConsQueue(fl)
|
||||||
, m_lhsIsValue(lhsIsValue)
|
, m_lhsIsValue{lhsIsValue}
|
||||||
, m_rhsIsValue(rhsIsValue) {
|
, m_rhsIsValue{rhsIsValue} {
|
||||||
this->lhsp(lhsp);
|
this->lhsp(lhsp);
|
||||||
this->rhsp(rhsp);
|
this->rhsp(rhsp);
|
||||||
}
|
}
|
||||||
|
|
@ -1605,7 +1605,7 @@ public:
|
||||||
AstLambdaArgRef(FileLine* fl, const string& name, bool index)
|
AstLambdaArgRef(FileLine* fl, const string& name, bool index)
|
||||||
: ASTGEN_SUPER_LambdaArgRef(fl)
|
: ASTGEN_SUPER_LambdaArgRef(fl)
|
||||||
, m_name{name}
|
, m_name{name}
|
||||||
, m_index(index) {}
|
, m_index{index} {}
|
||||||
bool sameNode(const AstNode* /*samep*/) const override { return true; }
|
bool sameNode(const AstNode* /*samep*/) const override { return true; }
|
||||||
string emitVerilog() override { return name(); }
|
string emitVerilog() override { return name(); }
|
||||||
string emitC() override { V3ERROR_NA_RETURN(""); }
|
string emitC() override { V3ERROR_NA_RETURN(""); }
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ public:
|
||||||
AstNodeReadWriteMem(VNType t, FileLine* fl, bool hex, AstNodeExpr* filenamep,
|
AstNodeReadWriteMem(VNType t, FileLine* fl, bool hex, AstNodeExpr* filenamep,
|
||||||
AstNodeExpr* memp, AstNodeExpr* lsbp, AstNodeExpr* msbp)
|
AstNodeExpr* memp, AstNodeExpr* lsbp, AstNodeExpr* msbp)
|
||||||
: AstNodeStmt{t, fl}
|
: AstNodeStmt{t, fl}
|
||||||
, m_isHex(hex) {
|
, m_isHex{hex} {
|
||||||
this->filenamep(filenamep);
|
this->filenamep(filenamep);
|
||||||
this->memp(memp);
|
this->memp(memp);
|
||||||
this->lsbp(lsbp);
|
this->lsbp(lsbp);
|
||||||
|
|
@ -1114,7 +1114,7 @@ class AstConstraint final : public AstNode {
|
||||||
public:
|
public:
|
||||||
AstConstraint(FileLine* fl, const string& name, AstNode* itemsp)
|
AstConstraint(FileLine* fl, const string& name, AstNode* itemsp)
|
||||||
: ASTGEN_SUPER_Constraint(fl)
|
: ASTGEN_SUPER_Constraint(fl)
|
||||||
, m_name(name) {
|
, m_name{name} {
|
||||||
addItemsp(itemsp);
|
addItemsp(itemsp);
|
||||||
}
|
}
|
||||||
ASTGEN_MEMBERS_AstConstraint;
|
ASTGEN_MEMBERS_AstConstraint;
|
||||||
|
|
@ -1579,7 +1579,7 @@ public:
|
||||||
AstPragma(FileLine* fl, VPragmaType pragType, const VTimescale& timescale)
|
AstPragma(FileLine* fl, VPragmaType pragType, const VTimescale& timescale)
|
||||||
: ASTGEN_SUPER_Pragma(fl)
|
: ASTGEN_SUPER_Pragma(fl)
|
||||||
, m_pragType{pragType}
|
, m_pragType{pragType}
|
||||||
, m_timescale(timescale) {}
|
, m_timescale{timescale} {}
|
||||||
ASTGEN_MEMBERS_AstPragma;
|
ASTGEN_MEMBERS_AstPragma;
|
||||||
VPragmaType pragType() const { return m_pragType; } // *=type of the pragma
|
VPragmaType pragType() const { return m_pragType; } // *=type of the pragma
|
||||||
bool isPredictOptimizable() const override { return false; }
|
bool isPredictOptimizable() const override { return false; }
|
||||||
|
|
@ -2880,7 +2880,7 @@ class AstCReset final : public AstNodeStmt {
|
||||||
public:
|
public:
|
||||||
AstCReset(FileLine* fl, AstVarRef* varrefp, bool constructing)
|
AstCReset(FileLine* fl, AstVarRef* varrefp, bool constructing)
|
||||||
: ASTGEN_SUPER_CReset(fl)
|
: ASTGEN_SUPER_CReset(fl)
|
||||||
, m_constructing(constructing) {
|
, m_constructing{constructing} {
|
||||||
this->varrefp(varrefp);
|
this->varrefp(varrefp);
|
||||||
}
|
}
|
||||||
ASTGEN_MEMBERS_AstCReset;
|
ASTGEN_MEMBERS_AstCReset;
|
||||||
|
|
@ -3518,7 +3518,7 @@ class AstStop final : public AstNodeStmt {
|
||||||
public:
|
public:
|
||||||
AstStop(FileLine* fl, bool isFatal)
|
AstStop(FileLine* fl, bool isFatal)
|
||||||
: ASTGEN_SUPER_Stop(fl)
|
: ASTGEN_SUPER_Stop(fl)
|
||||||
, m_isFatal(isFatal) {}
|
, m_isFatal{isFatal} {}
|
||||||
ASTGEN_MEMBERS_AstStop;
|
ASTGEN_MEMBERS_AstStop;
|
||||||
void dump(std::ostream& str) const override;
|
void dump(std::ostream& str) const override;
|
||||||
void dumpJson(std::ostream& str) const override;
|
void dumpJson(std::ostream& str) const override;
|
||||||
|
|
@ -4094,7 +4094,7 @@ public:
|
||||||
explicit AstTextBlock(FileLine* fl, const string& textp = "", bool tracking = false,
|
explicit AstTextBlock(FileLine* fl, const string& textp = "", bool tracking = false,
|
||||||
bool commas = false)
|
bool commas = false)
|
||||||
: ASTGEN_SUPER_TextBlock(fl, textp, tracking)
|
: ASTGEN_SUPER_TextBlock(fl, textp, tracking)
|
||||||
, m_commas(commas) {}
|
, m_commas{commas} {}
|
||||||
ASTGEN_MEMBERS_AstTextBlock;
|
ASTGEN_MEMBERS_AstTextBlock;
|
||||||
bool commas() const { return m_commas; }
|
bool commas() const { return m_commas; }
|
||||||
void commas(bool flag) { m_commas = flag; }
|
void commas(bool flag) { m_commas = flag; }
|
||||||
|
|
|
||||||
|
|
@ -788,7 +788,7 @@ string AstVar::dpiTmpVarType(const string& varName) const {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit converter(const string& name)
|
explicit converter(const string& name)
|
||||||
: m_name(name) {}
|
: m_name{name} {}
|
||||||
};
|
};
|
||||||
return converter{varName}.convert(this);
|
return converter{varName}.convert(this);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class CUseVisitor final : public VNVisitorConst {
|
||||||
public:
|
public:
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
explicit CUseVisitor(AstNodeModule* modp)
|
explicit CUseVisitor(AstNodeModule* modp)
|
||||||
: m_modp(modp) {
|
: m_modp{modp} {
|
||||||
iterateConst(modp);
|
iterateConst(modp);
|
||||||
|
|
||||||
for (auto& used : m_didUse) {
|
for (auto& used : m_didUse) {
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ class CoverageVisitor final : public VNVisitor {
|
||||||
CoverTerm(AstNodeExpr* exprp, bool objective, const string& emitV)
|
CoverTerm(AstNodeExpr* exprp, bool objective, const string& emitV)
|
||||||
: m_exprp{exprp}
|
: m_exprp{exprp}
|
||||||
, m_objective{objective}
|
, m_objective{objective}
|
||||||
, m_emitV(emitV) {}
|
, m_emitV{emitV} {}
|
||||||
};
|
};
|
||||||
using CoverExpr = std::deque<CoverTerm>;
|
using CoverExpr = std::deque<CoverTerm>;
|
||||||
using CoverExprs = std::list<CoverExpr>;
|
using CoverExprs = std::list<CoverExpr>;
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ class EmitCLazyDecls final : public VNVisitorConst {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit EmitCLazyDecls(EmitCBaseVisitorConst& emitter)
|
explicit EmitCLazyDecls(EmitCBaseVisitorConst& emitter)
|
||||||
: m_emitter(emitter) {}
|
: m_emitter{emitter} {}
|
||||||
void emit(AstNode* nodep) {
|
void emit(AstNode* nodep) {
|
||||||
m_needsBlankLine = false;
|
m_needsBlankLine = false;
|
||||||
iterateChildrenConst(nodep);
|
iterateChildrenConst(nodep);
|
||||||
|
|
@ -1513,7 +1513,7 @@ public:
|
||||||
} // LCOV_EXCL_STOP
|
} // LCOV_EXCL_STOP
|
||||||
|
|
||||||
EmitCFunc()
|
EmitCFunc()
|
||||||
: m_lazyDecls(*this) {}
|
: m_lazyDecls{*this} {}
|
||||||
EmitCFunc(AstNode* nodep, V3OutCFile* ofp, AstCFile* cfilep, bool trackText = false)
|
EmitCFunc(AstNode* nodep, V3OutCFile* ofp, AstCFile* cfilep, bool trackText = false)
|
||||||
: EmitCFunc{} {
|
: EmitCFunc{} {
|
||||||
setOutputFile(ofp, cfilep);
|
setOutputFile(ofp, cfilep);
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public:
|
||||||
static std::unordered_map<const ExecMTask*, MTaskState> mtaskState;
|
static std::unordered_map<const ExecMTask*, MTaskState> mtaskState;
|
||||||
|
|
||||||
explicit ThreadSchedule(uint32_t nThreads)
|
explicit ThreadSchedule(uint32_t nThreads)
|
||||||
: m_id(s_nextId++)
|
: m_id{s_nextId++}
|
||||||
, threads{nThreads} {}
|
, threads{nThreads} {}
|
||||||
ThreadSchedule(ThreadSchedule&&) = default;
|
ThreadSchedule(ThreadSchedule&&) = default;
|
||||||
ThreadSchedule& operator=(ThreadSchedule&&) = default;
|
ThreadSchedule& operator=(ThreadSchedule&&) = default;
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ public:
|
||||||
LinkDotState(AstNetlist* rootp, VLinkDotStep step)
|
LinkDotState(AstNetlist* rootp, VLinkDotStep step)
|
||||||
: m_syms{rootp}
|
: m_syms{rootp}
|
||||||
, m_mods{rootp}
|
, m_mods{rootp}
|
||||||
, m_step(step) {
|
, m_step{step} {
|
||||||
UINFO(4, __FUNCTION__ << ": ");
|
UINFO(4, __FUNCTION__ << ": ");
|
||||||
s_errorThisp = this;
|
s_errorThisp = this;
|
||||||
V3Error::errorExitCb(preErrorDumpHandler); // If get error, dump self
|
V3Error::errorExitCb(preErrorDumpHandler); // If get error, dump self
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ class CodeMotionAnalysisVisitor final : public VNVisitorConst {
|
||||||
|
|
||||||
// CONSTRUCTOR
|
// CONSTRUCTOR
|
||||||
CodeMotionAnalysisVisitor(AstNode* nodep, StmtPropertiesAllocator& stmtProperties)
|
CodeMotionAnalysisVisitor(AstNode* nodep, StmtPropertiesAllocator& stmtProperties)
|
||||||
: m_stmtProperties(stmtProperties) {
|
: m_stmtProperties{stmtProperties} {
|
||||||
iterateAndNextConstNull(nodep);
|
iterateAndNextConstNull(nodep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -399,7 +399,7 @@ class CodeMotionOptimizeVisitor final : public VNVisitor {
|
||||||
|
|
||||||
// CONSTRUCTOR
|
// CONSTRUCTOR
|
||||||
CodeMotionOptimizeVisitor(AstNode* nodep, const StmtPropertiesAllocator& stmtProperties)
|
CodeMotionOptimizeVisitor(AstNode* nodep, const StmtPropertiesAllocator& stmtProperties)
|
||||||
: m_stmtProperties(stmtProperties) {
|
: m_stmtProperties{stmtProperties} {
|
||||||
// We assert the given node is at the head of the list otherwise we might move a node
|
// We assert the given node is at the head of the list otherwise we might move a node
|
||||||
// before the given node. This is easy to fix in the above iteration with a check on a
|
// before the given node. This is easy to fix in the above iteration with a check on a
|
||||||
// boundary node we should not move past, if we ever need to do so.
|
// boundary node we should not move past, if we ever need to do so.
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ public:
|
||||||
|
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
explicit AppendHelper(V3OptionParser& parser)
|
explicit AppendHelper(V3OptionParser& parser)
|
||||||
: m_parser(parser) {}
|
: m_parser{parser} {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define V3OPTION_PARSER_DECL_TAGS \
|
#define V3OPTION_PARSER_DECL_TAGS \
|
||||||
|
|
|
||||||
|
|
@ -1206,9 +1206,9 @@ class CaptureVisitor final : public VNVisitor {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CaptureVisitor(AstNode* const nodep, AstNodeModule* callerp, AstClass* const targetp)
|
explicit CaptureVisitor(AstNode* const nodep, AstNodeModule* callerp, AstClass* const targetp)
|
||||||
: m_argsp(nullptr)
|
: m_argsp{nullptr}
|
||||||
, m_callerp(callerp)
|
, m_callerp{callerp}
|
||||||
, m_targetp(targetp) {
|
, m_targetp{targetp} {
|
||||||
iterateAndNextNull(nodep);
|
iterateAndNextNull(nodep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2355,7 +2355,7 @@ class RandomizeVisitor final : public VNVisitor {
|
||||||
public:
|
public:
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
explicit RandomizeVisitor(AstNetlist* nodep)
|
explicit RandomizeVisitor(AstNetlist* nodep)
|
||||||
: m_inlineUniqueNames("__Vrandwith") {
|
: m_inlineUniqueNames{"__Vrandwith"} {
|
||||||
createRandomizeClassVars(nodep);
|
createRandomizeClassVars(nodep);
|
||||||
iterate(nodep);
|
iterate(nodep);
|
||||||
nodep->foreach([&](AstConstraint* constrp) {
|
nodep->foreach([&](AstConstraint* constrp) {
|
||||||
|
|
|
||||||
|
|
@ -46,12 +46,12 @@ class VSymEnt final {
|
||||||
using IdNameMap = std::multimap<std::string, VSymEnt*>;
|
using IdNameMap = std::multimap<std::string, VSymEnt*>;
|
||||||
IdNameMap m_idNameMap; // Hash of variables by name
|
IdNameMap m_idNameMap; // Hash of variables by name
|
||||||
AstNode* m_nodep; // Node that entry belongs to
|
AstNode* m_nodep; // Node that entry belongs to
|
||||||
VSymEnt* m_fallbackp; // Table "above" this one in name scope, for fallback resolution
|
VSymEnt* m_fallbackp = nullptr; // Table "above" this in name scope, for fallback resolution
|
||||||
VSymEnt* m_parentp; // Table that created this table, dot notation needed to resolve into it
|
VSymEnt* m_parentp = nullptr; // Table that created this
|
||||||
AstNodeModule* m_classOrPackagep; // Package node is in (for V3LinkDot, unused here)
|
AstNodeModule* m_classOrPackagep = nullptr; // Package node is in (for V3LinkDot, unused here)
|
||||||
string m_symPrefix; // String to prefix symbols with (for V3LinkDot, unused here)
|
string m_symPrefix; // String to prefix symbols with (for V3LinkDot, unused here)
|
||||||
bool m_exported; // Allow importing
|
bool m_exported = true; // Allow importing
|
||||||
bool m_imported; // Was imported
|
bool m_imported = false; // Was imported
|
||||||
#ifdef VL_DEBUG
|
#ifdef VL_DEBUG
|
||||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||||
#else
|
#else
|
||||||
|
|
@ -68,6 +68,11 @@ public:
|
||||||
<< std::setw(0) << std::right;
|
<< std::setw(0) << std::right;
|
||||||
os << " se" << cvtToHex(this) << std::setw(0);
|
os << " se" << cvtToHex(this) << std::setw(0);
|
||||||
os << " fallb=se" << cvtToHex(m_fallbackp);
|
os << " fallb=se" << cvtToHex(m_fallbackp);
|
||||||
|
if (m_imported || m_exported) {
|
||||||
|
os << " ";
|
||||||
|
if (m_imported) os << "[I]";
|
||||||
|
if (m_exported) os << "[E]";
|
||||||
|
}
|
||||||
if (m_symPrefix != "") os << " symPrefix=" << m_symPrefix;
|
if (m_symPrefix != "") os << " symPrefix=" << m_symPrefix;
|
||||||
if (nodep()) os << " n=" << nodep();
|
if (nodep()) os << " n=" << nodep();
|
||||||
os << '\n';
|
os << '\n';
|
||||||
|
|
@ -332,25 +337,20 @@ protected:
|
||||||
//######################################################################
|
//######################################################################
|
||||||
|
|
||||||
inline VSymEnt::VSymEnt(VSymGraph* graphp, AstNode* nodep)
|
inline VSymEnt::VSymEnt(VSymGraph* graphp, AstNode* nodep)
|
||||||
: m_nodep(nodep) {
|
: m_nodep{nodep} {
|
||||||
// No argument to set fallbackp, as generally it's wrong to set it in the new call,
|
// No argument to set fallbackp, as generally it's wrong to set it in the new call,
|
||||||
// Instead it needs to be set on a "findOrNew()" return, as it may have been new'ed
|
// Instead it needs to be set on a "findOrNew()" return, as it may have been new'ed
|
||||||
// by an earlier search insertion.
|
// by an earlier search insertion.
|
||||||
m_fallbackp = nullptr;
|
|
||||||
m_parentp = nullptr;
|
|
||||||
m_classOrPackagep = nullptr;
|
|
||||||
m_exported = true;
|
|
||||||
m_imported = false;
|
|
||||||
graphp->pushNewEnt(this);
|
graphp->pushNewEnt(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline VSymEnt::VSymEnt(VSymGraph* graphp, const VSymEnt* symp)
|
inline VSymEnt::VSymEnt(VSymGraph* graphp, const VSymEnt* symp)
|
||||||
: m_nodep(symp->m_nodep) {
|
: m_nodep{symp->m_nodep}
|
||||||
m_fallbackp = symp->m_fallbackp;
|
, m_fallbackp{symp->m_fallbackp}
|
||||||
m_parentp = symp->m_parentp;
|
, m_parentp{symp->m_parentp}
|
||||||
m_classOrPackagep = symp->m_classOrPackagep;
|
, m_classOrPackagep{symp->m_classOrPackagep}
|
||||||
m_exported = symp->m_exported;
|
, m_exported{symp->m_exported}
|
||||||
m_imported = symp->m_imported;
|
, m_imported{symp->m_imported} {
|
||||||
graphp->pushNewEnt(this);
|
graphp->pushNewEnt(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ class UndrivenVarEntry final {
|
||||||
public:
|
public:
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
explicit UndrivenVarEntry(AstVar* varp)
|
explicit UndrivenVarEntry(AstVar* varp)
|
||||||
: m_varp(varp) { // Construction for when a var is used
|
: m_varp{varp} { // Construction for when a var is used
|
||||||
UINFO(9, "create " << varp);
|
UINFO(9, "create " << varp);
|
||||||
m_wholeFlags.resize(FLAGS_PER_BIT);
|
m_wholeFlags.resize(FLAGS_PER_BIT);
|
||||||
for (int i = 0; i < FLAGS_PER_BIT; i++) m_wholeFlags[i] = false;
|
for (int i = 0; i < FLAGS_PER_BIT; i++) m_wholeFlags[i] = false;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ public:
|
||||||
V3UniqueNames() = default;
|
V3UniqueNames() = default;
|
||||||
explicit V3UniqueNames(const std::string& prefix, bool addSuffix = true)
|
explicit V3UniqueNames(const std::string& prefix, bool addSuffix = true)
|
||||||
: m_prefix{prefix}
|
: m_prefix{prefix}
|
||||||
, m_addSuffix(addSuffix) {
|
, m_addSuffix{addSuffix} {
|
||||||
if (!m_prefix.empty()) {
|
if (!m_prefix.empty()) {
|
||||||
UASSERT(VString::startsWith(m_prefix, "__V"), "Prefix must start with '__V'");
|
UASSERT(VString::startsWith(m_prefix, "__V"), "Prefix must start with '__V'");
|
||||||
UASSERT(!VString::endsWith(m_prefix, "_"), "Prefix must not end with '_'");
|
UASSERT(!VString::endsWith(m_prefix, "_"), "Prefix must not end with '_'");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue