3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-06 01:24:10 +00:00

ice40_dsp: fix log_assert issue

This commit is contained in:
Anhijkt 2025-03-15 17:11:32 +02:00
parent 6884c98e08
commit 725c489c7e

View file

@ -46,17 +46,19 @@ code sigA sigB sigH
// Only care about those bits that are used
int i;
for (i = 0; i < GetSize(O); i++) {
if (nusers(O[i]) <= 1)
break;
sigH.append(O[i]);
}
for (i = GetSize(O) - 1; i > 0 && nusers(O[i]) <= 1; i--)
;
// This sigM could have no users if downstream sinks (e.g. $add) is
// narrower than $mul result, for example
if (i == 0)
reject;
log_assert(nusers(O.extract_end(i)) <= 1);
for (int j = 0; j <= i; j++)
if (nusers(O[j]) == 0)
sigH.append(module->addWire(NEW_ID));
else
sigH.append(O[j]);
endcode
code argQ ffA sigA clock clock_pol