From 2a262483bb9035f9f455c20720b144ed4b1e9b29 Mon Sep 17 00:00:00 2001 From: rhanqtl Date: Thu, 4 Sep 2025 23:19:11 +0800 Subject: [PATCH] fix(parse): #5234 adjust width of rhs according to lhs --- kernel/rtlil.cc | 5 ++++- tests/sat/fminit_seq_width.ys | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/sat/fminit_seq_width.ys diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 0250346d1..1d8912189 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -5836,7 +5836,10 @@ bool RTLIL::SigSpec::parse_rhs(const RTLIL::SigSpec &lhs, RTLIL::SigSpec &sig, R } } - return parse(sig, module, str); + if (!parse(sig, module, str)) + return false; + sig.extend_u0(lhs.width_); + return true; } RTLIL::CaseRule::~CaseRule() diff --git a/tests/sat/fminit_seq_width.ys b/tests/sat/fminit_seq_width.ys new file mode 100644 index 000000000..b6cf66470 --- /dev/null +++ b/tests/sat/fminit_seq_width.ys @@ -0,0 +1,17 @@ +read_verilog -sv -formal <