[libre-riscv-dev] [Bug 132] SIMD-like nmigen signal for partitioning

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Wed Aug 14 12:03:53 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=132

--- Comment #3 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #2)
> See also:
> https://salsa.debian.org/Kazan-team/simple-barrel-processor/blob/master/src/
> multiply.py

yehyeh, that's the one.  if we can create operators >=, add, sub, etc.
then there's no need to explicitly confuse the entire design of a pipeline
stage.

what will be needed in the __init__ constructors is, instead of just
"self.a = Signal(width)" it will be:

self.a = PartitionedSignal(self.ctx, pspec, width)

the reason is: the context contains (will contain) not just the SIMD
partitioning information, it will contain the "cancellation mask"
which will be used to cancel *subsets* of the SIMD operation rather
than all of it.

the only thing is: multiply is *not* going to be easy, because it's
multi-stage.  so i think there, we would have to do something quite
complex inside the multiply, like:

class PartitionedSignal:

   def __mul__(self, value):
       if self.ctx.operator == FIRST_STAGE_MULTIPLY:
           # do wallace multiply step 1
       elif self.ctx.operator == SECOND_STAGE_MULTIPLY:
           # do wallace multiply step 2

or something like that.  needs thought.


here's the full list, from Value - these will be the functions that
are needed (and one from Signal as well - PartitionedSignal.like):


    def __invert__(self):
    def __neg__(self):

    def __add__(self, other):
    def __radd__(self, other):
    def __sub__(self, other):
    def __rsub__(self, other):
    def __mul__(self, other):
    def __rmul__(self, other):
    def __mod__(self, other):
    def __rmod__(self, other):
    def __div__(self, other):
    def __rdiv__(self, other):
    def __lshift__(self, other):
    def __rlshift__(self, other):
    def __rshift__(self, other):
    def __rrshift__(self, other):
    def __and__(self, other):
    def __rand__(self, other):
    def __xor__(self, other):
    def __rxor__(self, other):
    def __or__(self, other):
    def __ror__(self, other):

    def __eq__(self, other):
    def __ne__(self, other):
    def __lt__(self, other):
    def __le__(self, other):
    def __gt__(self, other):
    def __ge__(self, other):

    def __len__(self):
    def implies(premise, conclusion):

    def eq(self, value):

    def shape(self):

    def _lhs_signals(self):
    def _rhs_signals(self):

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list