Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Verif] Add ContractOp to Visitor #8155

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/circt/Dialect/Verif/VerifVisitors.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Visitor {
auto *thisCast = static_cast<ConcreteType *>(this);
return TypeSwitch<Operation *, ResultType>(op)
.template Case<AssertOp, AssumeOp, CoverOp, ClockedAssertOp,
ClockedAssumeOp, ClockedCoverOp>(
ClockedAssumeOp, ClockedCoverOp, ContractOp>(
[&](auto op) -> ResultType {
return thisCast->visitVerif(op, args...);
})
Expand Down Expand Up @@ -55,6 +55,7 @@ class Visitor {
HANDLE(ClockedAssertOp, Unhandled);
HANDLE(ClockedAssumeOp, Unhandled);
HANDLE(ClockedCoverOp, Unhandled);
HANDLE(ContractOp, Unhandled);
#undef HANDLE
};

Expand Down
12 changes: 4 additions & 8 deletions lib/Conversion/HWToBTOR2/HWToBTOR2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ struct ConvertHWToBTOR2Pass
public hw::TypeOpVisitor<ConvertHWToBTOR2Pass>,
public verif::Visitor<ConvertHWToBTOR2Pass> {
public:
using verif::Visitor<ConvertHWToBTOR2Pass>::visitVerif;

ConvertHWToBTOR2Pass(raw_ostream &os) : os(os) {}
// Executes the pass
void runOnOperation() override;
Expand Down Expand Up @@ -843,14 +845,8 @@ struct ConvertHWToBTOR2Pass
void visitVerif(verif::AssumeOp op) { visitAssumeLike(op); }
void visitVerif(verif::ClockedAssumeOp op) { visitAssumeLike(op); }

// Cover is not supported in btor2
void visitVerif(verif::CoverOp op) {
op->emitError("Cover is not supported in btor2!");
return signalPassFailure();
}

void visitVerif(verif::ClockedCoverOp op) {
op->emitError("Cover is not supported in btor2!");
void visitUnhandledVerif(Operation *op) {
op->emitError("not supported in btor2!");
return signalPassFailure();
}

Expand Down