From f6f85f475ba2abd186ddda10d0099750e28231ca Mon Sep 17 00:00:00 2001 From: George Rennie Date: Sun, 24 Sep 2023 12:40:41 +0100 Subject: [PATCH] smt2: Check for constant bool after fully resolving signal * This fixes #3769 --- backends/smt2/smt2.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backends/smt2/smt2.cc b/backends/smt2/smt2.cc index 5e63e6237..703628b73 100644 --- a/backends/smt2/smt2.cc +++ b/backends/smt2/smt2.cc @@ -329,13 +329,14 @@ struct Smt2Worker { sigmap.apply(bit); + if (bit_driver.count(bit)) { + export_cell(bit_driver.at(bit)); + sigmap.apply(bit); + } + if (bit.wire == nullptr) return bit == RTLIL::State::S1 ? "true" : "false"; - if (bit_driver.count(bit)) - export_cell(bit_driver.at(bit)); - sigmap.apply(bit); - if (fcache.count(bit) == 0) { if (verbose) log("%*s-> external bool: %s\n", 2+2*GetSize(recursive_cells), "", log_signal(bit));