fix reporting in remapmatrix.py
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 29 Sep 2022 08:45:39 +0000 (09:45 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 29 Sep 2022 08:45:56 +0000 (09:45 +0100)
openpower/sv/remapmatrix.py

index c9c81f21451ea61c5dac65efeb2b8254471883bb..6561d09904ad8098a2c92d1f7c4acf7872c4ff78 100644 (file)
@@ -56,10 +56,10 @@ def matrix_demo():
     ydim2 = len(Y)
 
     # print out X and Y
-    print ("X:")
+    print ("X:", xdim1, ydim1)
     for r in X:
         print ("\t", r)
-    print ("Y:")
+    print ("Y:", xdim2, ydim2)
     for r in Y:
         print ("\t", r)
 
@@ -77,8 +77,8 @@ def matrix_demo():
             for j in range(len(Y[0])):        # xdim2
                 print ("order %d    res %d   X %d   Y %d" % \
                         (count,
-                         (i*xdim2)+j, # result linear array index
-                         (i*xdim1)+k,  # X linear array index
+                         (i*ydim1)+j, # result linear array index
+                         (i*ydim1)+k,  # X linear array index
                          (k*xdim2)+j))   # Y linear array index
                 result[i][j] += X[i][k] * Y[k][j]
                 count += 1