From c0d1032979c97a57f2fc585757b236aba97ca837 Mon Sep 17 00:00:00 2001 From: George Rennie Date: Tue, 15 Jul 2025 12:24:55 +0100 Subject: [PATCH] write_smt2: only take sign of cell if fit has one * this is needed to handle $barrier cells which otherwise are similar to $buf but do not have a sign parameter --- backends/smt2/smt2.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/smt2/smt2.cc b/backends/smt2/smt2.cc index 0685f80eb..a29510f6f 100644 --- a/backends/smt2/smt2.cc +++ b/backends/smt2/smt2.cc @@ -460,7 +460,7 @@ struct Smt2Worker { RTLIL::SigSpec sig_a, sig_b; RTLIL::SigSpec sig_y = sigmap(cell->getPort(ID::Y)); - bool is_signed = type == 'U' ? false : cell->getParam(ID::A_SIGNED).as_bool(); + bool is_signed = type == 'U' ? false : cell->hasParam(ID::A_SIGNED) && cell->getParam(ID::A_SIGNED).as_bool(); int width = GetSize(sig_y); if (type == 's' || type == 'S' || type == 'd' || type == 'b') {