summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-10-03 12:58:40 +0200
committerClifford Wolf <clifford@clifford.at>2014-10-03 12:58:40 +0200
commit3e4b0cac8dc1f443bbd43030f1ce151b41555d97 (patch)
tree5c8f76ce5af6127fa059b6d6411df5e7a70951b0 /kernel
parentc3e779a65f285afa123b990f3a717a7ae8e028f5 (diff)
added resource sharing of $macc cells
Diffstat (limited to 'kernel')
-rw-r--r--kernel/macc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/macc.h b/kernel/macc.h
index 27114111..7d70a268 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