From 3e4b0cac8dc1f443bbd43030f1ce151b41555d97 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 3 Oct 2014 12:58:40 +0200 Subject: added resource sharing of $macc cells --- kernel/macc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'kernel/macc.h') diff --git a/kernel/macc.h b/kernel/macc.h index 271141112..7d70a2686 100644 --- a/kernel/macc.h +++ b/kernel/macc.h @@ -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 -- cgit v1.2.3