(no commit message)
[libreriscv.git] / 3d_gpu / architecture / dynamic_simd / cat.mdwn
1 # PartitionedSignal nmigen-aware Cat
2
3 * <https://bugs.libre-soc.org/show_bug.cgi?id=707>
4
5 Concatenation of Signals is ordinarily straightforward: reduce to the bitlevel and create a sequence. The contributors to that sequence may be of arbitrary length.
6
7 However for a PartitionedSignal unless *all* contributors are also
8 PartitionedSignals, the results cannot be guaranteed to match, at all
9 partition sizes.
10
11 Take two PartitionedSignals:
12
13 partition: p p p (3 bits)
14 a : AAA3 AAA2 AAA1 AAA0 (32 bits)
15 b : BBB3 BBB2 BBB1 BBB0 (32 bits)
16
17 When the partitions are 32-bit, the output is:
18
19 partition: p p p (3 bits)
20 out : AAA3 AAA2 AAA1 AAA0 BBB3 BBB2 BBB1 BBB0 (64 bits)
21
22 When 2x16, the top 2 halves of A and B are Catted together,
23 and likewise the lower:
24
25 partition: p p p (3 bits)
26 out : AAA3 AAA2 BBB3 BBB2 AAA1 AAA0 BBB1 BBB0 (64 bits)
27
28 Finally when 4x8, each byte is concatenated:
29
30 partition: p p p (3 bits)
31 out : AAA3 BBB3 AAA2 BBB2 AAA1 BBB1 AAA0 BBB0 (64 bits)
32
33 This then generalises regardless of the number of PartitionedSignals
34 being Concatenated, and, also, regardless of the actual length of
35 each individual PartitionedSignal.
36
37 To confirm that et us assume that A is 16-bit and B is 32-bit: