Skip to content

Commit

Permalink
Suppress some debug unknown hash/simulate warnings in UVM.
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Sep 15, 2023
1 parent c52ba28 commit 188cf85
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/V3Hasher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ class HasherVisitor final : public VNVisitorConst {
iterateConstNull(nodep->refDTypep());
});
}
void visit(AstStreamDType* nodep) override {
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {});
}
void visit(AstVoidDType* nodep) override {
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() {});
}
Expand Down Expand Up @@ -269,6 +272,9 @@ class HasherVisitor final : public VNVisitorConst {
iterateConstNull(nodep->sensesp());
});
}
void visit(AstCLocalScope* nodep) override {
m_hash += hashNodeAndIterate(nodep, HASH_DTYPE, HASH_CHILDREN, [=]() {});
}
void visit(AstCoverInc* nodep) override {
m_hash += hashNodeAndIterate(nodep, false, HASH_CHILDREN, [=]() { //
iterateConstNull(nodep->declp());
Expand Down
21 changes: 21 additions & 0 deletions src/V3Simulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ class SimulateVisitor VL_NOT_FINAL : public VNVisitorConst {
if (nodep->isOutputter()) m_isOutputter = true;
}

void knownBadNodeType(AstNode* nodep) {
// Call for node types we know we can't handle
checkNodeInfo(nodep);
if (optimizable()) {
clearOptimizable(nodep, std::string{"Known unhandled node type "} + nodep->typeName());
}
}
void badNodeType(AstNode* nodep) {
// Call for default node types, or other node types we don't know how to handle
checkNodeInfo(nodep);
Expand Down Expand Up @@ -1163,6 +1170,20 @@ class SimulateVisitor VL_NOT_FINAL : public VNVisitorConst {
}
}

// ====
// Known Bad
void visit(AstCMethodHard* nodep) override {
// Some CMethods such as size() on queues could be supported, but
// instead we should change those methods to new Ast types so we can
// properly dispatch them
if (jumpingOver(nodep)) return;
knownBadNodeType(nodep);
}
void visit(AstMemberSel* nodep) override {
if (jumpingOver(nodep)) return;
knownBadNodeType(nodep);
}
// ====
// default
// These types are definitely not reducible
// AstCoverInc, AstFinish,
Expand Down

0 comments on commit 188cf85

Please sign in to comment.