mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 12:12:39 +00:00
Fix C++20 compilation errors (#4670)
This commit is contained in:
parent
27102ea0fb
commit
dc10118d3b
@ -39,7 +39,7 @@
|
|||||||
using namespace experimental; // Bring std::experimental into the std namespace
|
using namespace experimental; // Bring std::experimental into the std namespace
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# if defined __clang__ && defined __GLIBCXX__
|
# if defined __clang__ && defined __GLIBCXX__ && !defined __cpp_impl_coroutine
|
||||||
# define __cpp_impl_coroutine 1 // Clang doesn't define this, but it's needed for libstdc++
|
# define __cpp_impl_coroutine 1 // Clang doesn't define this, but it's needed for libstdc++
|
||||||
# endif
|
# endif
|
||||||
# include <coroutine>
|
# include <coroutine>
|
||||||
|
10
src/V3Ast.h
10
src/V3Ast.h
@ -757,11 +757,15 @@ public:
|
|||||||
bool isRef() const VL_MT_SAFE { return m_e == REF; }
|
bool isRef() const VL_MT_SAFE { return m_e == REF; }
|
||||||
bool isConstRef() const VL_MT_SAFE { return m_e == CONSTREF; }
|
bool isConstRef() const VL_MT_SAFE { return m_e == CONSTREF; }
|
||||||
};
|
};
|
||||||
constexpr bool operator==(const VDirection& lhs, const VDirection& rhs) {
|
constexpr bool operator==(const VDirection& lhs, const VDirection& rhs) VL_MT_SAFE {
|
||||||
return lhs.m_e == rhs.m_e;
|
return lhs.m_e == rhs.m_e;
|
||||||
}
|
}
|
||||||
constexpr bool operator==(const VDirection& lhs, VDirection::en rhs) { return lhs.m_e == rhs; }
|
constexpr bool operator==(const VDirection& lhs, VDirection::en rhs) VL_MT_SAFE {
|
||||||
constexpr bool operator==(VDirection::en lhs, const VDirection& rhs) { return lhs == rhs.m_e; }
|
return lhs.m_e == rhs;
|
||||||
|
}
|
||||||
|
constexpr bool operator==(VDirection::en lhs, const VDirection& rhs) VL_MT_SAFE {
|
||||||
|
return lhs == rhs.m_e;
|
||||||
|
}
|
||||||
inline std::ostream& operator<<(std::ostream& os, const VDirection& rhs) {
|
inline std::ostream& operator<<(std::ostream& os, const VDirection& rhs) {
|
||||||
return os << rhs.ascii();
|
return os << rhs.ascii();
|
||||||
}
|
}
|
||||||
|
@ -777,13 +777,7 @@ public:
|
|||||||
}
|
}
|
||||||
ASTGEN_MEMBERS_AstEnumDType;
|
ASTGEN_MEMBERS_AstEnumDType;
|
||||||
|
|
||||||
const char* broken() const override {
|
const char* broken() const override;
|
||||||
BROKEN_RTN(!((m_refDTypep && !childDTypep() && m_refDTypep->brokeExists())
|
|
||||||
|| (!m_refDTypep && childDTypep())));
|
|
||||||
BROKEN_RTN(std::any_of(m_tableMap.begin(), m_tableMap.end(),
|
|
||||||
[](const auto& p) { return !p.second->brokeExists(); }));
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
void cloneRelink() override {
|
void cloneRelink() override {
|
||||||
if (m_refDTypep && m_refDTypep->clonep()) m_refDTypep = m_refDTypep->clonep();
|
if (m_refDTypep && m_refDTypep->clonep()) m_refDTypep = m_refDTypep->clonep();
|
||||||
}
|
}
|
||||||
|
@ -1577,6 +1577,14 @@ void AstEnumItemRef::dump(std::ostream& str) const {
|
|||||||
str << "UNLINKED";
|
str << "UNLINKED";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const char* AstEnumDType::broken() const {
|
||||||
|
BROKEN_RTN(!((m_refDTypep && !childDTypep() && m_refDTypep->brokeExists())
|
||||||
|
|| (!m_refDTypep && childDTypep())));
|
||||||
|
BROKEN_RTN(std::any_of(m_tableMap.begin(), m_tableMap.end(),
|
||||||
|
[](const auto& p) { return !p.second->brokeExists(); }));
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
const char* AstEnumItemRef::broken() const {
|
const char* AstEnumItemRef::broken() const {
|
||||||
BROKEN_RTN(m_itemp && !m_itemp->brokeExists());
|
BROKEN_RTN(m_itemp && !m_itemp->brokeExists());
|
||||||
BROKEN_RTN(m_classOrPackagep && !m_classOrPackagep->brokeExists());
|
BROKEN_RTN(m_classOrPackagep && !m_classOrPackagep->brokeExists());
|
||||||
|
@ -1126,7 +1126,7 @@ private:
|
|||||||
// commonly appears after V3Expand and the simplification in matchMaskedOr. Similarly,
|
// commonly appears after V3Expand and the simplification in matchMaskedOr. Similarly,
|
||||||
// drop redundant masking of left shift result. E.g.: 0xff000000 & ((uint32_t)a << 24).
|
// drop redundant masking of left shift result. E.g.: 0xff000000 & ((uint32_t)a << 24).
|
||||||
|
|
||||||
const auto checkMask = [=](const V3Number& mask) -> bool {
|
const auto checkMask = [nodep, this](const V3Number& mask) -> bool {
|
||||||
const AstConst* const constp = VN_AS(nodep->lhsp(), Const);
|
const AstConst* const constp = VN_AS(nodep->lhsp(), Const);
|
||||||
if (constp->num().isCaseEq(mask)) {
|
if (constp->num().isCaseEq(mask)) {
|
||||||
AstNode* const rhsp = nodep->rhsp();
|
AstNode* const rhsp = nodep->rhsp();
|
||||||
|
@ -752,13 +752,13 @@ class DfgVertexWithArity VL_NOT_FINAL : public DfgVertex {
|
|||||||
std::array<DfgEdge, Arity> m_srcs; // Source edges
|
std::array<DfgEdge, Arity> m_srcs; // Source edges
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
DfgVertexWithArity<Arity>(DfgGraph& dfg, VDfgType type, FileLine* flp, AstNodeDType* dtypep)
|
DfgVertexWithArity(DfgGraph& dfg, VDfgType type, FileLine* flp, AstNodeDType* dtypep)
|
||||||
: DfgVertex{dfg, type, flp, dtypep} {
|
: DfgVertex{dfg, type, flp, dtypep} {
|
||||||
// Initialize source edges
|
// Initialize source edges
|
||||||
for (size_t i = 0; i < Arity; ++i) m_srcs[i].init(this);
|
for (size_t i = 0; i < Arity; ++i) m_srcs[i].init(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
~DfgVertexWithArity<Arity>() override = default;
|
~DfgVertexWithArity() override = default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::pair<DfgEdge*, size_t> sourceEdges() final override { //
|
std::pair<DfgEdge*, size_t> sourceEdges() final override { //
|
||||||
|
@ -292,11 +292,11 @@ class ExtractCyclicComponents final {
|
|||||||
|
|
||||||
// Visit all neighbors. We stop at variable boundaries,
|
// Visit all neighbors. We stop at variable boundaries,
|
||||||
// which is where we will split the graphs
|
// which is where we will split the graphs
|
||||||
vtx.forEachSource([=](DfgVertex& other) {
|
vtx.forEachSource([this, targetComponent](DfgVertex& other) {
|
||||||
if (other.is<DfgVertexVar>()) return;
|
if (other.is<DfgVertexVar>()) return;
|
||||||
visitMergeSCCs(other, targetComponent);
|
visitMergeSCCs(other, targetComponent);
|
||||||
});
|
});
|
||||||
vtx.forEachSink([=](DfgVertex& other) {
|
vtx.forEachSink([this, targetComponent](DfgVertex& other) {
|
||||||
if (other.is<DfgVertexVar>()) return;
|
if (other.is<DfgVertexVar>()) return;
|
||||||
visitMergeSCCs(other, targetComponent);
|
visitMergeSCCs(other, targetComponent);
|
||||||
});
|
});
|
||||||
|
@ -224,7 +224,7 @@ public:
|
|||||||
uint32_t driverIndex(size_t idx) const { return m_driverData[idx].second; }
|
uint32_t driverIndex(size_t idx) const { return m_driverData[idx].second; }
|
||||||
|
|
||||||
DfgVertex* driverAt(size_t idx) const {
|
DfgVertex* driverAt(size_t idx) const {
|
||||||
const DfgEdge* const edgep = findSourceEdge([=](const DfgEdge&, size_t i) { //
|
const DfgEdge* const edgep = findSourceEdge([this, idx](const DfgEdge&, size_t i) { //
|
||||||
return driverIndex(i) == idx;
|
return driverIndex(i) == idx;
|
||||||
});
|
});
|
||||||
return edgep ? edgep->sourcep() : nullptr;
|
return edgep ? edgep->sourcep() : nullptr;
|
||||||
|
173
src/V3Hasher.cpp
173
src/V3Hasher.cpp
@ -91,56 +91,56 @@ private:
|
|||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
// AstNodeDType
|
// AstNodeDType
|
||||||
void visit(AstNodeArrayDType* nodep) override {
|
void visit(AstNodeArrayDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() {
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
m_hash += nodep->left();
|
m_hash += nodep->left();
|
||||||
m_hash += nodep->right();
|
m_hash += nodep->right();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodeUOrStructDType* nodep) override {
|
void visit(AstNodeUOrStructDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, false, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, false, [this, nodep]() { //
|
||||||
m_hash += nodep->uniqueNum();
|
m_hash += nodep->uniqueNum();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstParamTypeDType* nodep) override {
|
void visit(AstParamTypeDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
m_hash += nodep->varType();
|
m_hash += nodep->varType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstMemberDType* nodep) override {
|
void visit(AstMemberDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstDefImplicitDType* nodep) override {
|
void visit(AstDefImplicitDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->uniqueNum();
|
m_hash += nodep->uniqueNum();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstAssocArrayDType* nodep) override {
|
void visit(AstAssocArrayDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() {
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
iterateConstNull(nodep->virtRefDType2p());
|
iterateConstNull(nodep->virtRefDType2p());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstDynArrayDType* nodep) override {
|
void visit(AstDynArrayDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstUnsizedArrayDType* nodep) override {
|
void visit(AstUnsizedArrayDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstWildcardArrayDType* nodep) override {
|
void visit(AstWildcardArrayDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstBasicDType* nodep) override {
|
void visit(AstBasicDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->keyword();
|
m_hash += nodep->keyword();
|
||||||
m_hash += nodep->numeric();
|
m_hash += nodep->numeric();
|
||||||
m_hash += nodep->nrange().left();
|
m_hash += nodep->nrange().left();
|
||||||
@ -148,45 +148,45 @@ private:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCDType* nodep) override {
|
void visit(AstCDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstConstDType* nodep) override {
|
void visit(AstConstDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstClassRefDType* nodep) override {
|
void visit(AstClassRefDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->classp());
|
iterateConstNull(nodep->classp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstIfaceRefDType* nodep) override {
|
void visit(AstIfaceRefDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->cellp());
|
iterateConstNull(nodep->cellp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstQueueDType* nodep) override {
|
void visit(AstQueueDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->virtRefDTypep());
|
iterateConstNull(nodep->virtRefDTypep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstRefDType* nodep) override {
|
void visit(AstRefDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
iterateConstNull(nodep->typedefp());
|
iterateConstNull(nodep->typedefp());
|
||||||
iterateConstNull(nodep->refDTypep());
|
iterateConstNull(nodep->refDTypep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstStreamDType* nodep) override {
|
void visit(AstStreamDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstVoidDType* nodep) override {
|
void visit(AstVoidDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstEnumDType* nodep) override {
|
void visit(AstEnumDType* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, false, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, false, [this, nodep]() { //
|
||||||
m_hash += nodep->uniqueNum();
|
m_hash += nodep->uniqueNum();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -194,23 +194,23 @@ private:
|
|||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
// AstNodeExpr
|
// AstNodeExpr
|
||||||
void visit(AstNodeExpr* nodep) override {
|
void visit(AstNodeExpr* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstConst* nodep) override {
|
void visit(AstConst* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->num().toHash();
|
m_hash += nodep->num().toHash();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNullCheck* nodep) override {
|
void visit(AstNullCheck* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstCCast* nodep) override {
|
void visit(AstCCast* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->size();
|
m_hash += nodep->size();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstVarRef* nodep) override {
|
void visit(AstVarRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
if (nodep->varScopep()) {
|
if (nodep->varScopep()) {
|
||||||
iterateConstNull(nodep->varScopep());
|
iterateConstNull(nodep->varScopep());
|
||||||
} else {
|
} else {
|
||||||
@ -220,28 +220,28 @@ private:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstVarXRef* nodep) override {
|
void visit(AstVarXRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
iterateConstNull(nodep->varp());
|
iterateConstNull(nodep->varp());
|
||||||
m_hash += nodep->dotted();
|
m_hash += nodep->dotted();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstMemberSel* nodep) override {
|
void visit(AstMemberSel* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstFScanF* nodep) override {
|
void visit(AstFScanF* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->text();
|
m_hash += nodep->text();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstSScanF* nodep) override {
|
void visit(AstSScanF* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->text();
|
m_hash += nodep->text();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstAddrOfCFunc* nodep) override {
|
void visit(AstAddrOfCFunc* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->funcp());
|
iterateConstNull(nodep->funcp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -249,64 +249,64 @@ private:
|
|||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
// AstNodeStmt
|
// AstNodeStmt
|
||||||
void visit(AstNodeStmt* nodep) override {
|
void visit(AstNodeStmt* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstNodeText* nodep) override {
|
void visit(AstNodeText* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->text();
|
m_hash += nodep->text();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodeCCall* nodep) override {
|
void visit(AstNodeCCall* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->funcp());
|
iterateConstNull(nodep->funcp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodeFTaskRef* nodep) override {
|
void visit(AstNodeFTaskRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() {
|
||||||
iterateConstNull(nodep->taskp());
|
iterateConstNull(nodep->taskp());
|
||||||
iterateConstNull(nodep->classOrPackagep());
|
iterateConstNull(nodep->classOrPackagep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCMethodHard* nodep) override {
|
void visit(AstCMethodHard* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCAwait* nodep) override {
|
void visit(AstCAwait* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->sensesp());
|
iterateConstNull(nodep->sensesp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCLocalScope* nodep) override {
|
void visit(AstCLocalScope* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstCoverInc* nodep) override {
|
void visit(AstCoverInc* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->declp());
|
iterateConstNull(nodep->declp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstDisplay* nodep) override {
|
void visit(AstDisplay* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->displayType();
|
m_hash += nodep->displayType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstMonitorOff* nodep) override {
|
void visit(AstMonitorOff* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->off();
|
m_hash += nodep->off();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstJumpGo* nodep) override {
|
void visit(AstJumpGo* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->labelp());
|
iterateConstNull(nodep->labelp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstTraceInc* nodep) override {
|
void visit(AstTraceInc* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->declp());
|
iterateConstNull(nodep->declp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodeCoverOrAssert* nodep) override {
|
void visit(AstNodeCoverOrAssert* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -314,103 +314,104 @@ private:
|
|||||||
//------------------------------------------------------------
|
//------------------------------------------------------------
|
||||||
// AstNode direct descendants
|
// AstNode direct descendants
|
||||||
void visit(AstNodeRange* nodep) override {
|
void visit(AstNodeRange* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstNodeModule* nodep) override {
|
void visit(AstNodeModule* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, false, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, false, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodePreSel* nodep) override {
|
void visit(AstNodePreSel* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstClassExtends* nodep) override {
|
void visit(AstClassExtends* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstSelLoopVars* nodep) override {
|
void visit(AstSelLoopVars* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstDefParam* nodep) override {
|
void visit(AstDefParam* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstArg* nodep) override {
|
void visit(AstArg* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstParseRef* nodep) override {
|
void visit(AstParseRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->expect();
|
m_hash += nodep->expect();
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstClassOrPackageRef* nodep) override {
|
void visit(AstClassOrPackageRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->classOrPackageNodep());
|
iterateConstNull(nodep->classOrPackageNodep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstSenItem* nodep) override {
|
void visit(AstSenItem* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->edgeType();
|
m_hash += nodep->edgeType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstSenTree* nodep) override {
|
void visit(AstSenTree* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstSFormatF* nodep) override {
|
void visit(AstSFormatF* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->text();
|
m_hash += nodep->text();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstElabDisplay* nodep) override {
|
void visit(AstElabDisplay* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->displayType();
|
m_hash += nodep->displayType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstInitItem* nodep) override {
|
void visit(AstInitItem* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstInitArray* nodep) override {
|
void visit(AstInitArray* nodep) override {
|
||||||
if (const AstAssocArrayDType* const dtypep = VN_CAST(nodep->dtypep(), AssocArrayDType)) {
|
if (const AstAssocArrayDType* const dtypep = VN_CAST(nodep->dtypep(), AssocArrayDType)) {
|
||||||
if (nodep->defaultp()) {
|
if (nodep->defaultp()) {
|
||||||
m_hash
|
m_hash
|
||||||
+= hashNodeAndIterate(nodep->defaultp(), HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
+= hashNodeAndIterate(nodep->defaultp(), HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
const auto& mapr = nodep->map();
|
const auto& mapr = nodep->map();
|
||||||
for (const auto& itr : mapr) { // mapr is sorted, so hash should get stable results
|
for (const auto& itr : mapr) { // mapr is sorted, so hash should get stable results
|
||||||
m_hash += itr.first;
|
m_hash += itr.first;
|
||||||
m_hash += hashNodeAndIterate(itr.second, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(itr.second, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
} else if (const AstUnpackArrayDType* const dtypep
|
} else if (const AstUnpackArrayDType* const dtypep
|
||||||
= VN_CAST(nodep->dtypep(), UnpackArrayDType)) {
|
= VN_CAST(nodep->dtypep(), UnpackArrayDType)) {
|
||||||
// Hash unpacked array initializers by value, as the order of initializer nodes does
|
// Hash unpacked array initializers by value, as the order of initializer nodes does
|
||||||
// not matter, and we want semantically equivalent initializers to map to the same
|
// not matter, and we want semantically equivalent initializers to map to the same
|
||||||
// hash.
|
// hash.
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, /* hashChildren: */ !dtypep, [=]() {
|
m_hash += hashNodeAndIterate(
|
||||||
if (dtypep) {
|
nodep, HASH_DTYPE, /* hashChildren: */ !dtypep, [this, nodep, dtypep]() {
|
||||||
const uint32_t size = dtypep->elementsConst();
|
if (dtypep) {
|
||||||
for (uint32_t n = 0; n < size; ++n) { //
|
const uint32_t size = dtypep->elementsConst();
|
||||||
iterateConstNull(nodep->getIndexDefaultedValuep(n));
|
for (uint32_t n = 0; n < size; ++n) { //
|
||||||
|
iterateConstNull(nodep->getIndexDefaultedValuep(n));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void visit(AstPragma* nodep) override {
|
void visit(AstPragma* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->pragType();
|
m_hash += nodep->pragType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstAttrOf* nodep) override {
|
void visit(AstAttrOf* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->attrType();
|
m_hash += nodep->attrType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodeFile* nodep) override {
|
void visit(AstNodeFile* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCFunc* nodep) override {
|
void visit(AstCFunc* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
// We might be in a recursive function, if so on *second* call
|
// We might be in a recursive function, if so on *second* call
|
||||||
// here we need to break what would be an infinite loop.
|
// here we need to break what would be an infinite loop.
|
||||||
nodep->user4(V3Hash{1}.value()); // Set this "first" call
|
nodep->user4(V3Hash{1}.value()); // Set this "first" call
|
||||||
@ -421,90 +422,90 @@ private:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstVar* nodep) override {
|
void visit(AstVar* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
m_hash += nodep->varType();
|
m_hash += nodep->varType();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstScope* nodep) override {
|
void visit(AstScope* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, false, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, false, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
iterateConstNull(nodep->aboveScopep());
|
iterateConstNull(nodep->aboveScopep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstVarScope* nodep) override {
|
void visit(AstVarScope* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
iterateConstNull(nodep->varp());
|
iterateConstNull(nodep->varp());
|
||||||
iterateConstNull(nodep->scopep());
|
iterateConstNull(nodep->scopep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstEnumItem* nodep) override {
|
void visit(AstEnumItem* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstTypedef* nodep) override {
|
void visit(AstTypedef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstTypedefFwd* nodep) override {
|
void visit(AstTypedefFwd* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstActive* nodep) override {
|
void visit(AstActive* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
iterateConstNull(nodep->sensesp());
|
iterateConstNull(nodep->sensesp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCell* nodep) override {
|
void visit(AstCell* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
iterateConstNull(nodep->modp());
|
iterateConstNull(nodep->modp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstCellInline* nodep) override {
|
void visit(AstCellInline* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
iterateConstNull(nodep->scopep());
|
iterateConstNull(nodep->scopep());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstNodeFTask* nodep) override {
|
void visit(AstNodeFTask* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstModport* nodep) override {
|
void visit(AstModport* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstModportVarRef* nodep) override {
|
void visit(AstModportVarRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
iterateConstNull(nodep->varp());
|
iterateConstNull(nodep->varp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstModportFTaskRef* nodep) override {
|
void visit(AstModportFTaskRef* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
iterateConstNull(nodep->ftaskp());
|
iterateConstNull(nodep->ftaskp());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstMTaskBody* nodep) override {
|
void visit(AstMTaskBody* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstNodeProcedure* nodep) override {
|
void visit(AstNodeProcedure* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, []() {});
|
||||||
}
|
}
|
||||||
void visit(AstNodeBlock* nodep) override {
|
void visit(AstNodeBlock* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() { //
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() { //
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void visit(AstPin* nodep) override {
|
void visit(AstPin* nodep) override {
|
||||||
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {
|
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [this, nodep]() {
|
||||||
m_hash += nodep->name();
|
m_hash += nodep->name();
|
||||||
m_hash += nodep->pinNum();
|
m_hash += nodep->pinNum();
|
||||||
});
|
});
|
||||||
|
@ -184,7 +184,7 @@ class SchedGraphBuilder final : public VNVisitor {
|
|||||||
|
|
||||||
// Clocked or hybrid logic has explicit sensitivity, so add edge from sensitivity vertex
|
// Clocked or hybrid logic has explicit sensitivity, so add edge from sensitivity vertex
|
||||||
if (!m_senTreep->hasCombo()) {
|
if (!m_senTreep->hasCombo()) {
|
||||||
m_senTreep->foreach([=](AstSenItem* senItemp) {
|
m_senTreep->foreach([this, nodep, logicVtxp](AstSenItem* senItemp) {
|
||||||
if (senItemp->isIllegal()) return;
|
if (senItemp->isIllegal()) return;
|
||||||
UASSERT_OBJ(senItemp->isClocked() || senItemp->isHybrid(), nodep,
|
UASSERT_OBJ(senItemp->isClocked() || senItemp->isHybrid(), nodep,
|
||||||
"Non-clocked SenItem under clocked SenTree");
|
"Non-clocked SenItem under clocked SenTree");
|
||||||
@ -194,7 +194,7 @@ class SchedGraphBuilder final : public VNVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add edges based on references
|
// Add edges based on references
|
||||||
nodep->foreach([=](const AstVarRef* vrefp) {
|
nodep->foreach([this, logicVtxp](const AstVarRef* vrefp) {
|
||||||
AstVarScope* const vscp = vrefp->varScopep();
|
AstVarScope* const vscp = vrefp->varScopep();
|
||||||
if (vrefp->access().isReadOrRW() && m_readTriggersThisLogic(vscp)) {
|
if (vrefp->access().isReadOrRW() && m_readTriggersThisLogic(vscp)) {
|
||||||
new V3GraphEdge{m_graphp, getVarVertex(vscp), logicVtxp, 10};
|
new V3GraphEdge{m_graphp, getVarVertex(vscp), logicVtxp, 10};
|
||||||
@ -206,7 +206,7 @@ class SchedGraphBuilder final : public VNVisitor {
|
|||||||
|
|
||||||
// If the logic calls a 'context' DPI import, it might fire the DPI Export trigger
|
// If the logic calls a 'context' DPI import, it might fire the DPI Export trigger
|
||||||
if (m_dpiExportTriggerp) {
|
if (m_dpiExportTriggerp) {
|
||||||
nodep->foreach([=](const AstCCall* callp) {
|
nodep->foreach([this, logicVtxp](const AstCCall* callp) {
|
||||||
if (!callp->funcp()->dpiImportWrapper()) return;
|
if (!callp->funcp()->dpiImportWrapper()) return;
|
||||||
if (!callp->funcp()->dpiContext()) return;
|
if (!callp->funcp()->dpiContext()) return;
|
||||||
new V3GraphEdge{m_graphp, logicVtxp, getVarVertex(m_dpiExportTriggerp), 10};
|
new V3GraphEdge{m_graphp, logicVtxp, getVarVertex(m_dpiExportTriggerp), 10};
|
||||||
|
@ -91,7 +91,7 @@ class SenExprBuilder final {
|
|||||||
}
|
}
|
||||||
AstVarScope* getPrev(AstNodeExpr* exprp) {
|
AstVarScope* getPrev(AstNodeExpr* exprp) {
|
||||||
FileLine* const flp = exprp->fileline();
|
FileLine* const flp = exprp->fileline();
|
||||||
const auto rdCurr = [=]() { return getCurr(exprp); };
|
const auto rdCurr = [this, exprp]() { return getCurr(exprp); };
|
||||||
|
|
||||||
AstNode* scopeExprp = exprp;
|
AstNode* scopeExprp = exprp;
|
||||||
if (AstVarRef* const refp = VN_CAST(exprp, VarRef)) scopeExprp = refp->varScopep();
|
if (AstVarRef* const refp = VN_CAST(exprp, VarRef)) scopeExprp = refp->varScopep();
|
||||||
@ -155,8 +155,10 @@ class SenExprBuilder final {
|
|||||||
FileLine* const flp = senItemp->fileline();
|
FileLine* const flp = senItemp->fileline();
|
||||||
AstNodeExpr* const senp = senItemp->sensp();
|
AstNodeExpr* const senp = senItemp->sensp();
|
||||||
|
|
||||||
const auto currp = [=]() { return getCurr(senp); };
|
const auto currp = [this, senp]() { return getCurr(senp); };
|
||||||
const auto prevp = [=]() { return new AstVarRef{flp, getPrev(senp), VAccess::READ}; };
|
const auto prevp = [this, flp, senp]() {
|
||||||
|
return new AstVarRef{flp, getPrev(senp), VAccess::READ};
|
||||||
|
};
|
||||||
const auto lsb = [=](AstNodeExpr* opp) { return new AstSel{flp, opp, 0, 1}; };
|
const auto lsb = [=](AstNodeExpr* opp) { return new AstSel{flp, opp, 0, 1}; };
|
||||||
|
|
||||||
// All event signals should be 1-bit at this point
|
// All event signals should be 1-bit at this point
|
||||||
|
Loading…
Reference in New Issue
Block a user