ice40_dsp: tolerant of fanout-less outputs, as well as all-zero inputs
authorEddie Hung <eddie@fpgeh.com>
Fri, 17 Jan 2020 23:28:02 +0000 (15:28 -0800)
committerEddie Hung <eddie@fpgeh.com>
Fri, 17 Jan 2020 23:28:02 +0000 (15:28 -0800)
passes/pmgen/ice40_dsp.pmg

index 6b6d2b56fc70654c32670b28c7829d0a1875bdd1..9514e65d9aabb636689000f0c65be01c628ea2bb 100644 (file)
@@ -57,6 +57,9 @@ code sigA sigB sigH
                sigH.append(O[i]);
        }
        log_assert(nusers(O.extract_end(i)) <= 1);
+
+       if (sigH.empty())
+               reject;
 endcode
 
 code argQ ffA ffAholdmux ffArstmux ffAholdpol ffArstpol sigA clock clock_pol
@@ -328,6 +331,8 @@ arg argD argQ clock clock_pol
 
 code
        dff = nullptr;
+       if (argQ.empty())
+               reject;
        for (auto c : argQ.chunks()) {
                if (!c.wire)
                        reject;