Referring to DMA5 example found in CCS (16 bit transfer), the double indexing
used to transpose a square matrix is as follows:
#define REVERSE_ELE_CNT ((FRM_CNT-1)*ELE_CNT - 1)
#define SRC_FRM_IDX -(REVERSE_ELE_CNT*2 + 1)
#define SRC_ELE_IDX (2*ELE_CNT - 1)
This will works fine for a square matrix, but won’t work for a rectangular
matrix. Is there a means to use double indexing to transpose a rectangular
matrix? For example, using example DMA5 and changing the matrix format to:
#define FRM_CNT 3 //Row count
#define ELE_CNT 8 //Column count
Once ran results with:
004020: dst1
004020: 0000 0008 0010
004023: 0002 0000 0000
004026: 0000 FFFF 0000
004029: 0000 0000 0000
00402C: 0000 0000 0004
00402F: 000D 0004 000C
004032: FFFF 0000 0000
004035: 0000 0000 0004
004000: src1
004000: 0000 0001 0002 0003 0004 0005 0006 0007
004008: 0008 0009 000A 000B 000C 000D 000E 000F
004010: 0010 0011 0012 0013 0014 0015 0016 0017
,which obviously not correct.
I also obsever "-1" in the index formulas e.g. #define SRC_ELE_IDX (2*ELE_CNT
- 1), which I don't understand. I get the multiplication by 2 since DMA
using BYTE address and words are being transferred, but not the -1. The same for
#define REVERSE_ELE_CNT ((FRM_CNT-1)*ELE_CNT - 1), I don't get the last
-1 term.
I’m obviously new at this, so please spare no details.
I thank you in advance.
Much appreciated,
Daniel
rectangular matrix dma transpose
Started by ●September 12, 2007
Reply by ●September 13, 20072007-09-13
I was able to transpose a rectangular matrix by combining CCS DMA4 and DMA5
examples. More specifically by looping back through a McBSP (digital loopback)
with two distinct DMAs. The DMA in the TX path had used the index formulas
below but the frame and and element count were interchanged in the DMAs
respecitve count registers. The DMA in the RX path had the frame and element
index set to 1, and the counts were not interchanged.
Daniel
----------------
Referring to DMA5 example found in CCS (16 bit transfer), the double indexing used to transpose a square matrix is as follows:
>
>#define REVERSE_ELE_CNT ((FRM_CNT-1)*ELE_CNT - 1)
>#define SRC_FRM_IDX -(REVERSE_ELE_CNT*2 + 1)
>#define SRC_ELE_IDX (2*ELE_CNT - 1)
>
>This will works fine for a square matrix, but won’t work for a rectangular matrix. Is there a means to use double indexing to transpose a rectangular matrix? For example, using example DMA5 and changing the matrix format to:
>
>#define FRM_CNT 3 //Row count
>#define ELE_CNT 8 //Column count
>
>Once ran results with:
>
>004020: dst1
>004020: 0000 0008 0010
>004023: 0002 0000 0000
>004026: 0000 FFFF 0000
>004029: 0000 0000 0000
>00402C: 0000 0000 0004
>00402F: 000D 0004 000C
>004032: FFFF 0000 0000
>004035: 0000 0000 0004
>
>004000: src1
>004000: 0000 0001 0002 0003 0004 0005 0006 0007
>004008: 0008 0009 000A 000B 000C 000D 000E 000F
>004010: 0010 0011 0012 0013 0014 0015 0016 0017
>
>,which obviously not correct.
>
>I also obsever "-1" in the index formulas e.g. #define SRC_ELE_IDX (2*ELE_CNT - 1), which I don't understand. I get the multiplication by 2 since DMA using BYTE address and words are being transferred, but not the -1. The same for #define REVERSE_ELE_CNT ((FRM_CNT-1)*ELE_CNT - 1), I don't get the last -1 term.
>
>I’m obviously new at this, so please spare no details.
>
>I thank you in advance.
>Much appreciated,
>Daniel
Daniel
----------------
Referring to DMA5 example found in CCS (16 bit transfer), the double indexing used to transpose a square matrix is as follows:
>
>#define REVERSE_ELE_CNT ((FRM_CNT-1)*ELE_CNT - 1)
>#define SRC_FRM_IDX -(REVERSE_ELE_CNT*2 + 1)
>#define SRC_ELE_IDX (2*ELE_CNT - 1)
>
>This will works fine for a square matrix, but won’t work for a rectangular matrix. Is there a means to use double indexing to transpose a rectangular matrix? For example, using example DMA5 and changing the matrix format to:
>
>#define FRM_CNT 3 //Row count
>#define ELE_CNT 8 //Column count
>
>Once ran results with:
>
>004020: dst1
>004020: 0000 0008 0010
>004023: 0002 0000 0000
>004026: 0000 FFFF 0000
>004029: 0000 0000 0000
>00402C: 0000 0000 0004
>00402F: 000D 0004 000C
>004032: FFFF 0000 0000
>004035: 0000 0000 0004
>
>004000: src1
>004000: 0000 0001 0002 0003 0004 0005 0006 0007
>004008: 0008 0009 000A 000B 000C 000D 000E 000F
>004010: 0010 0011 0012 0013 0014 0015 0016 0017
>
>,which obviously not correct.
>
>I also obsever "-1" in the index formulas e.g. #define SRC_ELE_IDX (2*ELE_CNT - 1), which I don't understand. I get the multiplication by 2 since DMA using BYTE address and words are being transferred, but not the -1. The same for #define REVERSE_ELE_CNT ((FRM_CNT-1)*ELE_CNT - 1), I don't get the last -1 term.
>
>I’m obviously new at this, so please spare no details.
>
>I thank you in advance.
>Much appreciated,
>Daniel