remapyield: add some more demos
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 20 Feb 2024 05:34:03 +0000 (21:34 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Tue, 20 Feb 2024 05:34:03 +0000 (21:34 -0800)
src/openpower/decoder/isa/remapyield.py

index a498908eb0e25c842c60ee6ce0759f518a5bbeab..42b0478541149ac0791fe3bea9b3148e0df32626 100644 (file)
@@ -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()