From e36eaa544549c77e1fbf1f085ba81eee8455ec91 Mon Sep 17 00:00:00 2001 From: Emily Schmidt Date: Wed, 12 Jun 2024 12:27:43 +0100 Subject: [PATCH] need unsigned comparison when checking shift widths for overflow in functional backend --- kernel/graphtools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/graphtools.h b/kernel/graphtools.h index 98046c6be0b..4fb7aacf444 100644 --- a/kernel/graphtools.h +++ b/kernel/graphtools.h @@ -40,7 +40,7 @@ class CellSimplifier { } else { reduced_b_width = new_width; T lower_b = factory.slice(b, b_width, 0, new_width); - T overflow = factory.gt(b, factory.constant(RTLIL::Const(y_width, b_width)), b_width); + T overflow = factory.ugt(b, factory.constant(RTLIL::Const(y_width, b_width)), b_width); return factory.mux(lower_b, factory.constant(RTLIL::Const(y_width, new_width)), overflow, new_width); } }