From 3eaaa8de42fc7703e537267de7bae972635583cb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 29 Mar 2023 10:14:13 +0100 Subject: [PATCH] corrections in ls009 svshape pseudocode, add missing modes not properly cut/paste (sigh) --- openpower/sv/rfc/ls009.mdwn | 47 ++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/openpower/sv/rfc/ls009.mdwn b/openpower/sv/rfc/ls009.mdwn index b0ba78458..0ec5ba28c 100644 --- a/openpower/sv/rfc/ls009.mdwn +++ b/openpower/sv/rfc/ls009.mdwn @@ -894,10 +894,9 @@ Form: SVM-Form SV "Matrix" Form (see [[isatables/fields.text]]) SVSHAPE2[28:29] <- 0b10 # k schedule # set schedule up for (i)DCT Inner butterfly - # SVrm Mode 2 (Mode 6 for iDCT) is for pre-calculated coefficients, # SVrm Mode 4 (Mode 12 for iDCT) is for on-the-fly (Vertical-First Mode) - if ((SVrm = 0b0010) | (SVrm = 0b0100) | - (SVrm = 0b1010) | (SVrm = 0b1100)) then + if ((SVrm = 0b0100) | + (SVrm = 0b1100)) then # calculate O(N log2 N) n <- [0] * 3 do while n < 5 @@ -911,6 +910,48 @@ Form: SVM-Form SV "Matrix" Form (see [[isatables/fields.text]]) SVSHAPE0[0:5] <- (0b0 || SVxd) # xdim SVSHAPE0[12:17] <- (0b0 || SVzd) # zdim - "striding" (2D DCT) mscale <- (0b0 || SVzd) + 1 + if (SVrm = 0b1100) then + SVSHAPE0[30:31] <- 0b11 # iDCT mode + SVSHAPE0[18:20] <- 0b011 # iDCT Inner Butterfly sub-mode + else + SVSHAPE0[30:31] <- 0b01 # DCT mode + SVSHAPE0[18:20] <- 0b001 # DCT Inner Butterfly sub-mode + SVSHAPE0[21:23] <- 0b001 # "inverse" on outer loop + SVSHAPE0[6:11] <- 0b000011 # (i)DCT Inner Butterfly mode 4 + # copy + SVSHAPE1[0:31] <- SVSHAPE0[0:31] + SVSHAPE2[0:31] <- SVSHAPE0[0:31] + if (SVrm != 0b0100) & (SVrm != 0b1100) then + SVSHAPE3[0:31] <- SVSHAPE0[0:31] + # for FRA and FRT + SVSHAPE0[28:29] <- 0b01 # j+halfstep schedule + # for cos coefficient + SVSHAPE2[28:29] <- 0b10 # ci (k for mode 4) schedule + SVSHAPE2[12:17] <- 0b000000 # reset costable "striding" to 1 + if (SVrm != 0b0100) & (SVrm != 0b1100) then + SVSHAPE3[28:29] <- 0b11 # size schedule + + # set schedule up for (i)DCT Outer butterfly + if (SVrm = 0b0011) | (SVrm = 0b1011) then + # calculate O(N log2 N) number of outer butterfly overlapping adds + vlen[0:6] <- [0] * 7 + n <- 0b000 + size <- 0b0000001 + itercount[0:6] <- (0b00 || SVxd) + 0b0000001 + itercount[0:6] <- (0b0 || itercount[0:5]) + do while n < 5 + if SVxd[4-n] = 0 then + leave + n <- n + 1 + count <- (itercount - 0b0000001) * size + vlen[0:6] <- vlen + count[7:13] + size[0:6] <- (size[1:6] || 0b0) + itercount[0:6] <- (0b0 || itercount[0:5]) + # set up template in SVSHAPE0, then copy to 1-3 + # set up FRB and FRS + SVSHAPE0[0:5] <- (0b0 || SVxd) # xdim + SVSHAPE0[12:17] <- (0b0 || SVzd) # zdim - "striding" (2D DCT) + mscale <- (0b0 || SVzd) + 1 if (SVrm = 0b1011) then SVSHAPE0[30:31] <- 0b11 # iDCT mode SVSHAPE0[18:20] <- 0b011 # iDCT Outer Butterfly sub-mode -- 2.30.2