From 2b3a148fc41f77e6933a97c964fb610d9dc313ab Mon Sep 17 00:00:00 2001 From: Anhijkt Date: Sat, 5 Apr 2025 13:46:38 +0300 Subject: [PATCH] ice40_dsp: fix const handling --- techlibs/ice40/ice40_dsp.pmg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/techlibs/ice40/ice40_dsp.pmg b/techlibs/ice40/ice40_dsp.pmg index 63bc8de4b..2cfb97b2a 100644 --- a/techlibs/ice40/ice40_dsp.pmg +++ b/techlibs/ice40/ice40_dsp.pmg @@ -32,8 +32,8 @@ code sigA sigB sigH ++i; return sig.extract(0, i); }; - sigA = unextend(port(mul, \A)); - sigB = unextend(port(mul, \B)); + sigA = port(mul, \A).is_fully_const() ? port(mul, \A) : unextend(port(mul, \A)); + sigB = port(mul, \B).is_fully_const() ? port(mul, \B) : unextend(port(mul, \B)); SigSpec O; if (mul->type == $mul)