From f113af4636afad4bc2e495363b6c9c411f126b2e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 21 Aug 2019 05:47:06 +0100 Subject: [PATCH] add mul factor to PartitionPoints.like --- src/ieee754/part_mul_add/multiply.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ieee754/part_mul_add/multiply.py b/src/ieee754/part_mul_add/multiply.py index 64994ad3..0a05c587 100644 --- a/src/ieee754/part_mul_add/multiply.py +++ b/src/ieee754/part_mul_add/multiply.py @@ -50,15 +50,17 @@ class PartitionPoints(dict): raise ValueError("point must be a non-negative integer") self[point] = Value.wrap(enabled) - def like(self, name=None, src_loc_at=0): + def like(self, name=None, src_loc_at=0, mul=1): """Create a new ``PartitionPoints`` with ``Signal``s for all values. :param name: the base name for the new ``Signal``s. + :param mul: a multiplication factor on the indices """ if name is None: name = Signal(src_loc_at=1+src_loc_at).name # get variable name retval = PartitionPoints() for point, enabled in self.items(): + point *= mul retval[point] = Signal(enabled.shape(), name=f"{name}_{point}") return retval -- 2.30.2