+
+ return intermediate_terms, m
+
+
+class AddReduce(AddReduceSingle):
+ """Recursively Add list of numbers together.
+
+ :attribute inputs: input ``Signal``s to be summed. Modification not
+ supported, except for by ``Signal.eq``.
+ :attribute register_levels: List of nesting levels that should have
+ pipeline registers.
+ :attribute output: output sum.
+ :attribute partition_points: the input partition points. Modification not
+ supported, except for by ``Signal.eq``.
+ """
+
+ def __init__(self, inputs, output_width, register_levels, partition_points):
+ """Create an ``AddReduce``.
+
+ :param inputs: input ``Signal``s to be summed.
+ :param output_width: bit-width of ``output``.
+ :param register_levels: List of nesting levels that should have
+ pipeline registers.
+ :param partition_points: the input partition points.
+ """
+ AddReduceSingle.__init__(self, inputs, output_width, register_levels,
+ partition_points)
+
+ def next_register_levels(self):
+ """``Iterable`` of ``register_levels`` for next recursive level."""
+ for level in self.register_levels:
+ if level > 0:
+ yield level - 1
+
+ def elaborate(self, platform):
+ """Elaborate this module."""
+ intermediate_terms, m = AddReduceSingle._elaborate(self, platform)
+ if intermediate_terms is None:
+ return m
+