SVSHAPE0.lims = [xdim2, ydim2, 1]
SVSHAPE0.order = [0,1,2] # result iterates through i and j (modulo)
SVSHAPE0.mode = 0b00
+ SVSHAPE0.skip = 0b00
SVSHAPE0.offset = 0 # no offset
SVSHAPE0.invxyz = [0,0,0] # no inversion
# X uses SVSHAPE1
SVSHAPE1 = SVSHAPE()
SVSHAPE1.lims = [xdim2, ydim2, ydim1]
SVSHAPE1.order = [0,2,1] # X iterates through i and k
- SVSHAPE1.mode = 0b10
+ SVSHAPE1.mode = 0b00
+ SVSHAPE1.skip = 0b01
SVSHAPE1.offset = 0 # no offset
SVSHAPE1.invxyz = [0,0,0] # no inversion
# y-selector uses SHAPE2
SVSHAPE2 = SVSHAPE()
SVSHAPE2.lims = [xdim2, ydim2, ydim1]
SVSHAPE2.order = [0,2,1] # X iterates through i and k
- SVSHAPE2.mode = 0b01
+ SVSHAPE2.mode = 0b00
+ SVSHAPE2.skip = 0b11
SVSHAPE2.offset = 0 # no offset
SVSHAPE2.invxyz = [0,0,0] # no inversion
(SVSHAPE.lims[1], y, "y"),
(SVSHAPE.lims[2], z, "z")
]
- # now select those by order:
+ # now select those by order. this allows us to
+ # create schedules for [z][x], [x][y], or [y][z]
+ # for matrix multiply.
vals = [vals[SVSHAPE.order[0]],
vals[SVSHAPE.order[1]],
vals[SVSHAPE.order[2]]
]
- # ok now we can construct the result, using bits of
- # "order" to say which ones get stacked on
+ # some of the dimensions can be "skipped". the order
+ # was actually selected above on all 3 dimensions,
+ # e.g. [z][x][y] or [y][z][x]. "skip" allows one of
+ # those to be knocked out
+ if SVSHAPE.skip == 0b00:
+ select = 0b111
+ elif SVSHAPE.skip == 0b11:
+ select = 0b011
+ elif SVSHAPE.skip == 0b01:
+ select = 0b110
+ elif SVSHAPE.skip == 0b10:
+ select = 0b101
+ else:
+ select = 0b111
result = 0
mult = 1
- if SVSHAPE.mode == 0b00:
- permute = 0b111
- elif SVSHAPE.mode == 0b01:
- permute = 0b011
- elif SVSHAPE.mode == 0b10:
- permute = 0b110
- else:
- permute = 0b111
+ # ok now we can construct the result, using bits of
+ # "order" to say which ones get stacked on
for i in range(3):
lim, idx, dbg = vals[i]
if permute & (1<<i):
| 31..30 | 29..28 | 27..24 | 23..21 | 20..18 | 17..12 | 11..6 | 5..0 |
| ------ | ------ | ------ | ------ | ------- | ------- | ------- | ------- |
-| mode | skip | offset | invxyz | permute | zdimsz | ydimsz | xdimsz |
-| 0b11 | skip | offset | invxyz | submode | rsvd | rsvd | xdimsz |
+| 0b00 | skip | offset | invxyz | permute | zdimsz | ydimsz | xdimsz |
+| 0b01 | submode| offset | invxyz | rsvd | rsvd | rsvd | xdimsz |
mode sets different behaviours (straight matrix multiply, FFT, DCT).
-* **mode=0b00** sets straight permute/skip, for matrices
-* **mode=0b01** sets further sub-modes including "FFT / DCT" mode
+* **mode=0b00** sets straight Matrix Mode
+* **mode=0b01** sets "FFT / DCT" mode and activates submodes
submode further selects schedules for FFT and DCT.