3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

added resource sharing of $macc cells

This commit is contained in:
Clifford Wolf 2014-10-03 12:58:40 +02:00
parent c3e779a65f
commit 3e4b0cac8d
2 changed files with 270 additions and 3 deletions

View file

@ -45,6 +45,9 @@ struct Macc
if (SIZE(port.in_a) == 0 && SIZE(port.in_b) == 0)
continue;
if (SIZE(port.in_a) < SIZE(port.in_b))
std::swap(port.in_a, port.in_b);
if (SIZE(port.in_a) == 1 && SIZE(port.in_b) == 0 && !port.is_signed && !port.do_subtract) {
bit_ports.append(port.in_a);
continue;
@ -224,6 +227,12 @@ struct Macc
return true;
}
Macc(RTLIL::Cell *cell = nullptr)
{
if (cell != nullptr)
from_cell(cell);
}
};
YOSYS_NAMESPACE_END