psx.wiki

GP0 Command FIFO Occupancy: Difference between revisions

Revision as of 04:31, 23 October 2026
RemmyLee
(Hardware tests: test page type, raw console output served from truth/, first test page)
Revision as of 05:11, 23 October 2026
RemmyLee
(Hardware tests: 72 more test pages, listed on the main page by area; RUN.toml no longer published)
Line 1:Line 1:
+---
+title: GP0 Command FIFO Occupancy
+type: test
+summary: Measures which GP0 command words take space in the GPU command FIFO.
+category: Hardware tests
+info: Machine = SCPH-5501
+info: Program = gpu-fifo (pcsx-redux nugget)
+---
+
+## Overview
+
+The program finds out which GP0 words occupy the [GPU](/hardware/gpu/) command FIFO. It first starts a 512 x 256 VRAM-to-VRAM copy so that the GPU is busy, then writes one opcode word up to 32 times behind it. After each write it reads [GPUSTAT](/hardware/gpu/gpustat/) with GP1(04h) set to 1, where bit 28 means the FIFO is empty and bit 25 means it is not full.[^src]
+
+For each opcode the program records the write at which bit 28 dropped and the write at which bit 25 dropped. It then counts GPUSTAT reads until bit 26 (ready for a command) returns. GP0(A0h) image data and GP0(60h) rectangles are the controls, since their words are FIFO traffic by construction.[^src]
+
+## Results
+
+The copy ran behind every row. The destination pixel pair changed from 7C007C00h to 001F001Fh, and GPUSTAT bit 26 came back only after about 13,266 reads.[^run]
+
+The FIFO filled after 8 words of GP0(A0h) image data and after 12 words of GP0(60h) rectangles. Six other opcodes filled it after 11 writes, so each of their words takes a place in the FIFO:[^run]
+
+Table: Opcodes that fill the FIFO
+
+| Opcode | Writes until full |
+| --- | --- |
+| GP0(01h) | 11 |
+| GP0(03h) | 11 |
+| GP0(1Fh) | 11 |
+| GP0(E1h) | 11 |
+| GP0(E2h) | 11 |
+| GP0(E6h) | 11 |
+
+GP0(00h), GP0(04h) to GP0(1Eh), GP0(E0h), GP0(E3h) to GP0(E5h) and GP0(E7h) to GP0(EFh) never filled the FIFO in 32 writes. After each of them GPUSTAT read 32802000h with bit 28 set again. Bit 26 returned after about 14,157 reads, which is the time left on the copy.[^run]
+
+## Runs
+
+### 22 October 2026
+
+[gpufifo/GPUFIFO.txt](/tests/raw/20261022T2233Z-5501a-link-4/gpufifo/GPUFIFO.txt)
+
+```
+GPUFIFO-START
+IDLE stat=14802000
+GPUVER idx7=00000002
+COPY stat0=22802000 busyPolls=13267 dst 7c007c00 -> 001f001f src=001f001f COPIED
+COPY stat0=22802000 busyPolls=13266 dst 7c007c00 -> 001f001f src=001f001f COPIED
+FIFO A0data OP=a0 notEmptyAt=1 fullAt=8 endStat=22802000 readyPolls=100000
+FIFO rect60 OP=60 notEmptyAt=1 fullAt=12 endStat=20802000 readyPolls=100000
+FIFO op OP=00 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=01 notEmptyAt=1 fullAt=11 endStat=20802000 readyPolls=14163
+FIFO op OP=03 notEmptyAt=1 fullAt=11 endStat=20802000 readyPolls=14161
+FIFO op OP=04 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=05 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=06 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=07 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=08 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=09 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=0a notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=0b notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=0c notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=0d notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=0e notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=0f notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=10 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=11 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=12 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=13 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=14 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=15 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=16 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=17 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=18 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=19 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=1a notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=1b notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=1c notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=1d notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=1e notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=1f notEmptyAt=1 fullAt=11 endStat=20802000 readyPolls=14165
+FIFO op OP=e0 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=e1 notEmptyAt=1 fullAt=11 endStat=20802000 readyPolls=14162
+FIFO op OP=e2 notEmptyAt=1 fullAt=11 endStat=20802000 readyPolls=14163
+FIFO op OP=e3 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=e4 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=e5 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=e6 notEmptyAt=1 fullAt=11 endStat=20802000 readyPolls=14163
+FIFO op OP=e7 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=e8 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=e9 notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=ea notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=eb notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=ec notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14158
+FIFO op OP=ed notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=ee notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO op OP=ef notEmptyAt=1 fullAt=-1 endStat=32802000 readyPolls=14157
+FIFO A0data OP=a0 notEmptyAt=1 fullAt=8 endStat=22802000 readyPolls=100000
+GPUFIFO-DONE
+ResetGraph:jtb=801e78b8,env=801e7900
+```
+
+[gpufifo/bench.txt](/tests/raw/20261022T2233Z-5501a-link-4/gpufifo/bench.txt)
+
+```
+4017 bytes of TTY text in psx.log
+```
+
+[gpufifo/when.txt](/tests/raw/20261022T2233Z-5501a-link-4/gpufifo/when.txt)
+
+```
+20261022T2233Z
+```
+
+## References
+
+[^src]: pcsx-redux nugget, tests/gpu-fifo/gpu-fifo.c, header comment. MIT License. https://github.com/pcsx-redux/nugget
+[^run]: Hardware test run 20261022T2233Z-5501a-link-4 on the SCPH-5501: [GPUFIFO.txt](/tests/raw/20261022T2233Z-5501a-link-4/gpufifo/GPUFIFO.txt).