From: Jacob Lifshay Date: Tue, 20 Feb 2024 05:34:03 +0000 (-0800) Subject: remapyield: add some more demos X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8138c79ff5b746f14a5188f46b2e8d79ec00701;p=openpower-isa.git remapyield: add some more demos --- diff --git a/src/openpower/decoder/isa/remapyield.py b/src/openpower/decoder/isa/remapyield.py index a498908e..42b04785 100644 --- a/src/openpower/decoder/isa/remapyield.py +++ b/src/openpower/decoder/isa/remapyield.py @@ -110,11 +110,52 @@ def dump_shape(SVSHAPE, VL=None): def demo(): + class SVSHAPE: pass # dummy class + + # set up an SVSHAPE with matrix mode + print("constant matrix") + SVSHAPE0 = SVSHAPE() + SVSHAPE0.lims = [1, 1, 1] + SVSHAPE0.order = [0,2,1] # experiment with different permutations, here + SVSHAPE0.mode = 0b00 + SVSHAPE0.skip = 0b00 + SVSHAPE0.submode2 = 0b000 # + SVSHAPE0.offset = 0 # experiment with different offset, here + SVSHAPE0.invxyz = [0,0,0] # inversion if desired + + dump_shape(SVSHAPE0) + + xdim, ydim, zdim = 4, 4, 1 # set the dimension sizes here + + # set up an SVSHAPE with matrix mode + print("x matrix", xdim, ydim, zdim) + SVSHAPE0 = SVSHAPE() + SVSHAPE0.lims = [xdim, ydim, zdim] + SVSHAPE0.order = [0,1,2] # experiment with different permutations, here + SVSHAPE0.mode = 0b00 + SVSHAPE0.skip = 0b10 + SVSHAPE0.submode2 = 0b000 # + SVSHAPE0.offset = 0 # experiment with different offset, here + SVSHAPE0.invxyz = [0,0,0] # inversion if desired + + dump_shape(SVSHAPE0) + + # set up an SVSHAPE with matrix mode + print("y matrix", xdim, ydim, zdim) + SVSHAPE0 = SVSHAPE() + SVSHAPE0.lims = [xdim, ydim, zdim] + SVSHAPE0.order = [0,1,2] # experiment with different permutations, here + SVSHAPE0.mode = 0b00 + SVSHAPE0.skip = 0b01 + SVSHAPE0.submode2 = 0b000 # + SVSHAPE0.offset = 0 # experiment with different offset, here + SVSHAPE0.invxyz = [0,0,0] # inversion if desired + + dump_shape(SVSHAPE0) + xdim, ydim, zdim = 3, 2, 4 # set the dimension sizes here VL = xdim * ydim * zdim # set total (can repeat, e.g. VL=x*y*z*4) - class SVSHAPE: pass # dummy class - # set up an SVSHAPE with matrix mode print("matrix", xdim, ydim, zdim) SVSHAPE0 = SVSHAPE()