Difference between revisions of "DSP"
(Finish work on DMA examples) |
(Add example for saturation) |
||
Line 106: | Line 106: | ||
*** DSP to buffer: words: <code>0x927FFF, 0xB47FFF, 0xD67FFF, 0xF87FFF</code> → bytes: <code>0x12,0x34,0x56,0x78</code> ''(Rounded down)'' | *** DSP to buffer: words: <code>0x927FFF, 0xB47FFF, 0xD67FFF, 0xF87FFF</code> → bytes: <code>0x12,0x34,0x56,0x78</code> ''(Rounded down)'' | ||
*** DSP to buffer: words: <code>0x928000, 0xB48000, 0xD68000, 0xF88000</code> → bytes: <code>0x13,0x35,0x57,0x79</code> ''(Rounded up)'' | *** DSP to buffer: words: <code>0x928000, 0xB48000, 0xD68000, 0xF88000</code> → bytes: <code>0x13,0x35,0x57,0x79</code> ''(Rounded up)'' | ||
+ | *** DSP to buffer: words: <code>0x800000, 0x7E7FFF, 0x7E8000, 0x7FFFFF</code> → bytes: <code>0x00,0xFE,0xFF,0xFF</code> ''(Saturated)'' | ||
** 0x1 = 16 bit (1 DSP word / 2 bytes) ''sample-count must be multiple of 2, or transfer is skipped; truncated'' | ** 0x1 = 16 bit (1 DSP word / 2 bytes) ''sample-count must be multiple of 2, or transfer is skipped; truncated'' | ||
*** Buffer to DSP: bytes: <code>0x34,0x12</code> → word: <code>0x123400</code> | *** Buffer to DSP: bytes: <code>0x34,0x12</code> → word: <code>0x123400</code> |
Revision as of 07:13, 27 December 2018
The DSPs in the APU are probably "Parthus MediaStream" DSP core (DSP24210/DSP2420?).
Those are similar to Motorola DSP56362 (DSP56300 Family). If so, the datasheet can be found at http://www.nxp.com/docs/en/data-sheet/DSP56362.pdf (Also see "Documentation" section in said datasheet for the related documentation)
Memory Size
Program RAM Size | X Data RAM Size | Y Data RAM Size | MIXBUF Size | |
---|---|---|---|---|
GP | 4096 x 24-bit | 4096 x 24-bit | 2048 x 24-bit | 992[FIXME] x 24-bit |
EP | 4096 x 24-bit | 3072 x 24-bit | 256 x 24-bit | n/a |
MIXBUF is accessible at X:$001400 in the GP.
Other datasheets for similar DSPs suggest that the memory sizes might be different if instruction cache or switch mode are toggled. It is currently unknown if the DSPs in the Xbox APU support a similar feature[FIXME].
DMA
This section is very incomplete and not much was tested on hardware either
DMA is controlled using peripheral registers:
- 0xFFFFD4: Memory address of next command block
- 0xFFFFD5: DMA_START_BLOCK[FIXME]
- 0xFFFFD6: DMA_CONTROL[FIXME]
- 0xFFFFD7: DMA_CONFIGURATION[FIXME]
Additionally, bit 7 in the interrupt register at 0xFFFFC5 is set if a DMA End-Of-List has been encountered.
Command blocks
DSP command blocks are loaded from X-Memory.
Word | Meaning | Notes |
---|---|---|
0 | Next command block address | Memory address of next command block.
Bit 14 is used as End-Of-List marker. |
1 | Transfer control word | Controls the DMA transfer:
|
2 | Transfer sample count | The number of samples to transfer. |
3 | DSP address | This is the address in the DSP:
|
4 | Buffer offset | This is the address within the buffer where the first sample is accessed. |
5 | Buffer base | Only used for circular buffers, ignored otherwise.[FIXME]
The start of the buffer. |
6 | Buffer size | Only used for circular buffers, ignored otherwise.[FIXME]
Size of buffer minus 1. For a buffer with 0x1000 bytes, this has to be 0xFFF. |