From: Luke Kenneth Casson Leighton Date: Tue, 6 Jul 2021 08:43:58 +0000 (+0100) Subject: more useful print output in remap matrix example X-Git-Tag: DRAFT_SVP64_0_1~652 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fa6f9bca89682d37891a76c66b3b7848eb5c6fa;p=libreriscv.git more useful print output in remap matrix example --- diff --git a/openpower/sv/remapmatrix.py b/openpower/sv/remapmatrix.py index 841886491..f256cc54b 100644 --- a/openpower/sv/remapmatrix.py +++ b/openpower/sv/remapmatrix.py @@ -46,8 +46,8 @@ def matrix_demo(): [4,5,9,1,2]] # pick one of the above (crude, non-automated, but it works, hey) - X = X3 - Y = Y3 + X = X2 + Y = Y2 # get the dimensions of the 2 matrices xdim1 = len(X[0]) @@ -106,7 +106,7 @@ def matrix_demo(): # now create the schedule. we use three generators, zipped # together - print ("ydim2 xdim2 ydim1", ydim2, xdim2, ydim1) + print ("xdim2 ydim1 ydim2", xdim2, ydim1, ydim2) class SVSHAPE: pass @@ -143,9 +143,11 @@ def matrix_demo(): for i, idxs in enumerate(iterate_triple(SVSHAPE0, SVSHAPE1, SVSHAPE2)): if i == VL: break - print ("idxs", i, idxs, len(result2), len(xf), len(yf)) r_idx, x_idx, y_idx = idxs - result2[r_idx] += xf[x_idx] * yf[y_idx] + new_result = result2[r_idx] + xf[x_idx] * yf[y_idx] + print ("idxs", i, idxs, len(result2), len(xf), len(yf), + " results ", result2[r_idx], xf[x_idx], yf[y_idx], new_result) + result2[r_idx] = new_result # now print out sections of result array, assuming elements of a "row" # are in sequence (inner loop), columns are outer