psx.wiki

Instruction Fetch During DMA2

Measures CPU instruction fetch while a DMA2 list runs and how long the MDEC status shows busy after a table.

Instruction Fetch During DMA2
MachineSCPH-5501
Programfollowup4

This is an old revision of this page, as edited by RemmyLee at 05:40, 23 October 2026. Edit this revision | Latest revision

Overview

The program has two groups. LFE times code that misses the instruction cache on every line, the same code run from KSEG1, a cached block that hits, and byte stores. Each runs alone and straight after a DMA2 list starts, and then in a race in which the CPU runs cache-missing code before it stores a pointer into the list. TBT reads the MDEC status and root counter 2 back to back after the last word of a quantization or scale table.1

Results

Instruction Fetch During a DMA2 List

Run alone, 8 KB of NOPs that missed the cache on every line took about 4,720 cycles. 512 NOPs from KSEG1 took about 3,145 cycles and 512 cached NOPs took 520. 200 byte stores to RAM took about 1,210 cycles.1

Started at the same moment as a list of 2048 empty nodes, the cached NOPs took 515 to 520 cycles. The byte stores took about 2,610 cycles. The two uncached blocks read 8 cycles on root counter 2 in both runs. In these rows the timer write that starts the stopwatch waited behind the list, so 8 is not the time of the work. CPU Speed During a DMA2 List reads the counter with loads only for that reason.1

With a list of 16 nodes of 255 words the cache-missing block took 4,689 to 4,693 cycles. The program recorded that the list ended first. The KSEG1 block took about 6,750 cycles against 3,145 alone. The cached block took 282 cycles.1

In the race at node 1000, DMA2 took the CPU's new pointer in every row. At node 512 it had always passed the node before the store.1

MDEC Table Busy

Straight after the last word of a quantization or scale table the status read A004FFFFh. Bit 29 was set in that read. The next read, 18 to 29 cycles later, gave 8004FFFFh. The three table kinds behaved the same in all three passes.1

Runs

30 September 2026

00RUN.txt

===== 00 RUN | BIOS 19951204 System ROM Version 3.0 11/18/96 A
2 tests
A chain program, linked at 80100000
Saved on the card in slot 2, from image 1
COP0 at start: BPC 00000000 BDA 00000000 TAR BFC02BAC DCIC 00000000 BadVaddr 00000480 BDAM 00000000
BPCM 00000000 SR 00000000 Cause 00000020 EPC 80016C84 PRId 00000002

01LFE.txt

===== 01 LFE F4 LIST AND FETCH | BIOS 19951204 System ROM Version 3.0 11/18/96 A
BadVaddr as the group starts: 00000480
CPU work timed on timer 2, alone and straight after a DMA2 list starts (CHCR 01000401,
GP1(04h)=2), then when the list's bit 24 cleared, counted from the work's start.
8 KB of NOPs, KSEG0, every line a miss, list 2048 nodes of 0 words: alone 4721, during 8, list done at 15565; alone 4717, during 8, list done at 15559;
512 NOPs from KSEG1, list 2048 nodes of 0 words: alone 3149, during 8, list done at 15678; alone 3138, during 8, list done at 15690;
512 NOPs, KSEG0, in the cache, list 2048 nodes of 0 words: alone 520, during 515, list done at 20414; alone 520, during 520, list done at 20411;
RAM sb x200, list 2048 nodes of 0 words: alone 1217, during 2607, list done at 21562; alone 1205, during 2614, list done at 21569;
8 KB of NOPs, KSEG0, every line a miss, list 16 nodes of 255 words: alone 4708, during 4693 (list ended first), list done at 4776; alone 4721, during 4689 (list ended first), list done at 4772;
512 NOPs from KSEG1, list 16 nodes of 255 words: alone 3148, during 6746 (list ended first), list done at 6801; alone 3142, during 6750 (list ended first), list done at 6805;
512 NOPs, KSEG0, in the cache, list 16 nodes of 255 words: alone 520, during 282, list done at 2862; alone 520, during 282, list done at 2864;
RAM sb x200, list 16 nodes of 255 words: alone 1217, during 5028 (list ended first), list done at 5083; alone 1205, during 5038 (list ended first), list done at 5093;
Race: 1024 empty nodes; the CPU runs 8 KB of NOPs, then the last n NOPs again, then points
node m at a side node; 1 = DMA2 took it, 0 = it had passed; @ the store's timer 2 clock.
node 1000, a pass then the last n NOPs, n from 0 by 64: 1@8 1@98 1@8138 1@8211 1@8281 1@8339 1@8411 1@8476 1@8568 1@8624 1@8689 1@8815 1@885 1@943 1@1013 1@1076 1@1139 1@1320 1@1505 1@1677 1@1863 1@2039 1@2232 1@2407 1@2570 1@2747 1@2936 1@3060 1@3244 1@3428
node  512, a pass then the last n NOPs, n from 0 by 32: 0@8 0@68 0@8091 0@8123 0@8155 0@8180 0@8214 0@8245 0@8281 0@8310 0@8345 0@8372 0@8409 0@8441 0@8477 0@8536 0@8573 0@8600 0@8629 0@8667 0@8690 0@8746 0@8825 0@854 0@886 0@916 0@946 0@976 0@1007 0@1044
Done.

02TBT.txt

===== 02 TBT F4 MDEC TABLE BUSY | BIOS 19951204 System ROM Version 3.0 11/18/96 A
BadVaddr as the group starts: 00000480
Timer 2 zeroed just before the last table word; then MDEC1 and timer 2 read in turn.
Quant, luminance, command 40000000 then 16 words; after the last, status@timer 2:
 A004FFFF@14 8004FFFF@43 8004FFFF@61 8004FFFF@79 8004FFFF@97 8004FFFF@125 8004FFFF@143 8004FFFF@161
Quant, luminance and colour, command 40000001 then 32 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@119 8004FFFF@137
Scale, command 60000000 then 32 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@125 8004FFFF@143
Quant, luminance, command 40000000 then 16 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@129 8004FFFF@147
Quant, luminance and colour, command 40000001 then 32 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@119 8004FFFF@137
Scale, command 60000000 then 32 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@125 8004FFFF@143
Quant, luminance, command 40000000 then 16 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@122 8004FFFF@140
Quant, luminance and colour, command 40000001 then 32 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@119 8004FFFF@137
Scale, command 60000000 then 32 words; after the last, status@timer 2:
 A004FFFF@11 8004FFFF@29 8004FFFF@47 8004FFFF@65 8004FFFF@83 8004FFFF@101 8004FFFF@119 8004FFFF@137
Done.

References


  1. ^ a b c d e f SCPH-5501 output: followup4/00RUN.txt and the files beside it, with the other runs listed under Runs.

Categories: Hardware tests