Skip to content

Commit

Permalink
[HWToBTOR2] Error on variadic ops (#7866)
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoBi22 authored Nov 22, 2024
1 parent 02823af commit 372dd33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Conversion/HWToBTOR2/HWToBTOR2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ struct ConvertHWToBTOR2Pass
// and a result width.
void genBinOp(StringRef inst, Operation *binop, Value op1, Value op2,
size_t width) {
// TODO: adding support for most variadic ops shouldn't be too hard
if (binop->getNumOperands() != 2) {
binop->emitError("variadic operations not are not currently supported");
return;
}

// Set the LID for this operation
size_t opLID = getOpLID(binop);

Expand Down
7 changes: 7 additions & 0 deletions test/Conversion/HWToBTOR2/errors.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ hw.module @reg_with_argument_initial(in %clk: !seq.clock, in %in: i32, in %init:
%1 = seq.compreg %in, %clk initial %init : i32
hw.output %1 : i32
}

// -----

hw.module @variadic_op(in %input: i32) {
// expected-error @below {{variadic operations not are not currently supported}}
%and = comb.and %input, %input, %input : i32
}

0 comments on commit 372dd33

Please sign in to comment.