From d8138c79ff5b746f14a5188f46b2e8d79ec00701 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Mon, 19 Feb 2024 21:34:03 -0800 Subject: [PATCH] remapyield: add some more demos --- src/openpower/decoder/isa/remapyield.py | 45 +++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) 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() -- 2.30.2