(no commit message)
[libreriscv.git] / simple_v_extension / shape_table_format.mdwn
1 Shape is 32-bits. When SHAPE is set entirely to zeros, remapping is
2 disabled: the register's elements are a linear (1D) vector.
3
4 | 31..30 | 29..24 | 23..21 | 20..18 | 17..12 | 11..6 | 5..0 |
5 | -------- | ------ | ------- | ------- | ------- | -------- | ------- |
6 | applydim | offset | invxyz | permute | zdimsz | ydimsz | xdimsz |
7
8 applydim will set to zero the dimensions less than this. applydim=0
9 applies all three. applydim=1 applies y and z. applydim=2 applys only
10 z. applydim=3 is reserved.
11
12 invxyz will invert the start index of each of x, y or z. If invxyz[0] is
13 zero then x-dimensional counting begins from 0 and increments, otherwise
14 it begins from xdimsz-1 and iterates down to zero. Likewise for y and z.
15
16 offset will have the effect equivalent to the sequential element loop
17 to appear to run for offset (additional) iterations prior to actually
18 generating output.
19
20 xdimsz, ydimsz and zdimsz are offset by 1, such that a value of 0 indicates
21 that the array dimensionality for that dimension is 1. A value of xdimsz=2
22 would indicate that in the first dimension there are 3 elements in the
23 array. The format of the array is therefore as follows:
24
25 array[xdim+1][ydim+1][zdim+1]
26
27 However whilst illustrative of the dimensionality, that does not take the
28 "permute" setting into account. "permute" may be any one of six values
29 (0-5, with values of 6 and 7 being reserved, and not legal). The table
30 below shows how the permutation dimensionality order works:
31
32 | permute | order | array format |
33 | ------- | ----- | ------------------------ |
34 | 000 | 0,1,2 | (xdim+1)(ydim+1)(zdim+1) |
35 | 001 | 0,2,1 | (xdim+1)(zdim+1)(ydim+1) |
36 | 010 | 1,0,2 | (ydim+1)(xdim+1)(zdim+1) |
37 | 011 | 1,2,0 | (ydim+1)(zdim+1)(xdim+1) |
38 | 100 | 2,0,1 | (zdim+1)(xdim+1)(ydim+1) |
39 | 101 | 2,1,0 | (zdim+1)(ydim+1)(xdim+1) |
40
41 In other words, the "permute" option changes the order in which
42 nested for-loops over the array would be done.
43