from ieee754.part_shift.part_shift_scalar import PartitionedScalarShift
from ieee754.part_mul_add.partpoints import make_partition2, PartitionPoints
from ieee754.part_mux.part_mux import PMux
+from ieee754.part_ass.passign import PAssign
from ieee754.part_cat.pcat import PCat
from operator import or_, xor, and_, not_
"val1 == %d, val2 == %d" % (len(val1), len(val2))
return PMux(self.m, self.partpoints, self, val1, val2)
+ def __Assign__(self, val):
+ # print ("partsig ass", self, val)
+ return PAssign(self.m, self.shape(), val, self.partpoints)
+
def __Cat__(self, *args, src_loc_at=0):
args = [self] + list(args)
for sig in args:
from ieee754.part.partsig import PartitionedSignal
-modcount = 0 # global for now
-def PAssign(m, arglist, mask):
- global modcount
- modcount += 1
- pc = PartitionedAssign(arglist, mask)
- setattr(m.submodules, "pass%d" % modcount, pc)
- return pc.output
-
-
def get_runlengths(pbit, size):
res = []
count = 1
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+# See Notices.txt for copyright information
+
+"""
+Copyright (C) 2021 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+
+dynamically-partitionable "assign" class, directly equivalent
+to nmigen Assign
+
+See:
+
+* http://libre-riscv.org/3d_gpu/architecture/dynamic_simd/assign
+* http://bugs.libre-riscv.org/show_bug.cgi?id=709
+
+"""
+
+
+
+modcount = 0 # global for now
+def PAssign(m, shape, assign, mask):
+ from ieee754.part_ass.assign import PartitionedAssign # recursion issue
+ global modcount
+ modcount += 1
+ pc = PartitionedAssign(shape, assign, mask)
+ setattr(m.submodules, "pass%d" % modcount, pc)
+ return pc.output
+
+
from ieee754.part.test.test_partsig import create_simulator
-modcount = 0 # global for now
-def PCat(m, arglist, mask):
- global modcount
- modcount += 1
- pc = PartitionedCat(arglist, mask)
- setattr(m.submodules, "pcat%d" % modcount, pc)
- return pc.output
-
-
def get_runlengths(pbit, size):
res = []
count = 1