From 3deb8f313e3351206dc4d3f86fdc4ac10b6ee2f9 Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 1 Sep 2026 14:34:28 -0600 Subject: [PATCH] fix 6151 - adding error cases to formal backends / also adding test cases --- backends/btor/btor.cc | 9 +++++++ backends/smt2/smt2.cc | 3 +++ tests/various/btor_allconst.ys | 13 ++++++++++ tests/various/btor_allseq.ys | 13 ++++++++++ ...heck_cells_btor.ys => btor_check_cells.ys} | 0 tests/various/btor_equiv_cells.ys | 26 +++++++++++++++++++ tests/various/btor_fair_cells.ys | 11 ++++++++ tests/various/btor_live_cells.ys | 11 ++++++++ ...heck_cells_smt2.ys => smt2_check_cells.ys} | 0 tests/various/smt2_equiv_cells.ys | 26 +++++++++++++++++++ tests/various/smt2_fair_cells.ys | 11 ++++++++ tests/various/smt2_live_cells.ys | 11 ++++++++ 12 files changed, 134 insertions(+) create mode 100644 tests/various/btor_allconst.ys create mode 100644 tests/various/btor_allseq.ys rename tests/various/{check_cells_btor.ys => btor_check_cells.ys} (100%) create mode 100644 tests/various/btor_equiv_cells.ys create mode 100644 tests/various/btor_fair_cells.ys create mode 100644 tests/various/btor_live_cells.ys rename tests/various/{check_cells_smt2.ys => smt2_check_cells.ys} (100%) create mode 100644 tests/various/smt2_equiv_cells.ys create mode 100644 tests/various/smt2_fair_cells.ys create mode 100644 tests/various/smt2_live_cells.ys diff --git a/backends/btor/btor.cc b/backends/btor/btor.cc index d9d23ad7b..51f28afcd 100644 --- a/backends/btor/btor.cc +++ b/backends/btor/btor.cc @@ -745,6 +745,11 @@ struct BtorWorker goto okay; } + if (cell->type.in(ID($allconst), ID($allseq))) + log_error("Unsupported cell type %s for cell %s.%s", + cell->type.unescape(), module, cell); + + if (cell->type.in(ID($anyconst), ID($anyseq))) { SigSpec sig_y = sigmap(cell->getPort(ID::Y)); @@ -1270,6 +1275,10 @@ struct BtorWorker log_error("Unsupported cell type %s for cell %s.%s -- please run `async2sync` or `clk2fflogic` before `write_btor`.\n", cell->type.unescape(), module, cell); + if (cell->type.in(ID($live), ID($fair), ID($equiv))) + log_error("Unsupported cell type %s for cell %s.%s", + cell->type.unescape(), module, cell); + if (cell->type == ID($assume)) { btorf_push(cell->name.unescape()); diff --git a/backends/smt2/smt2.cc b/backends/smt2/smt2.cc index 88044359f..40587edae 100644 --- a/backends/smt2/smt2.cc +++ b/backends/smt2/smt2.cc @@ -1110,6 +1110,9 @@ struct Smt2Worker if (cell->type == ID($check)) log_error("Unsupported cell type %s for cell %s.%s -- please run `async2sync` or `clk2fflogic` before `write_smt2`.\n", cell->type.unescape(), module, cell); + if (cell->type.in(ID($live), ID($fair), ID($equiv))) + log_error("Unsupported cell type %s for cell %s.%s", + cell->type.unescape(), module, cell); if (cell->type.in(ID($assert), ID($assume), ID($cover))) { diff --git a/tests/various/btor_allconst.ys b/tests/various/btor_allconst.ys new file mode 100644 index 000000000..ff52a498e --- /dev/null +++ b/tests/various/btor_allconst.ys @@ -0,0 +1,13 @@ + +read_verilog -formal <