Skip to content

Commit

Permalink
Error on powerOn value
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoBi22 committed Jul 5, 2024
1 parent c9ff7d0 commit 92f2f2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Tools/circt-bmc/ExternalizeRegisters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ void ExternalizeRegistersPass::runOnOperation() {
regOp.emitError("registers with reset signals not yet supported");
return signalPassFailure();
}
if (regOp.getPowerOnValue()) {
regOp.emitError("registers with power-on values not yet supported");
return signalPassFailure();
}
addedInputs[module.getSymNameAttr()].push_back(regOp.getType());
addedOutputs[module.getSymNameAttr()].push_back(
regOp.getInput().getType());
Expand Down
7 changes: 7 additions & 0 deletions test/Tools/circt-bmc/externalize-registers-errors.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ hw.module @reg_with_reset(in %clk: !seq.clock, in %rst: i1, in %in: i32, out out
%1 = seq.compreg %in, %clk reset %rst, %c0_i32 : i32
hw.output %1 : i32
}

hw.module @reg_with_poweron(in %clk: !seq.clock, in %in: i32, out out: i32) {
%c0_i32 = hw.constant 0 : i32
// expected-error @below {{registers with power-on values not yet supported}}
%1 = seq.compreg %in, %clk powerOn %c0_i32 : i32
hw.output %1 : i32
}

0 comments on commit 92f2f2a

Please sign in to comment.