how to use the CPU 4k cache?

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Post Reply
User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

how to use the CPU 4k cache?

Post by gwald » March 2nd, 2016, 9:20 pm

https://www.youtube.com/watch?feature=p ... BBk#t=1108
Bill Guschwan @mistagogue was a tool dev at Sony

He's talking about the DMA (bus) while double buffer swapping.
"Load up the polygon transfer loop, staying off the bus so the graphics engine could use it."
What does he mean? load the vertices data into the CPU cache, right after a swap?

AmiDog
Active PSXDEV User
Active PSXDEV User
Posts: 53
Joined: Sep 07, 2012

Post by AmiDog » March 3rd, 2016, 7:02 pm

Not sure what he means, but the CPU doesn't have a data cache. And the GPU has its own memory. Doing DMA from system memory to video memory might be faster if the CPU doesn't access memory at the same time, unless the CPU is halted during DMA anyway...

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » March 3rd, 2016, 9:23 pm

AmiDog wrote:Not sure what he means, but the CPU doesn't have a data cache.
Maybe he was talking about the scratch pad?
I actually use the scratch pad in the Menu System for handling polygon data. It's very high speed.
I think that's what he is getting at, but he is just making it sound overly complicated.

... developers :roll:
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
gwald
Verified
Net Yaroze Enthusiast
Net Yaroze Enthusiast
Posts: 282
Joined: Sep 18, 2013
I am a: programmer/DBA
PlayStation Model: Net Yaroze
Contact:

Post by gwald » March 4th, 2016, 4:03 pm

scratch pad is only 1k
Dcache (data) is on the CPU, it's 4k.
It's automatically used.
I think he's talking about the GTE/CPU (maths) using the 4k so the GPU wont be blocked when drawing.

AmiDog
Active PSXDEV User
Active PSXDEV User
Posts: 53
Joined: Sep 07, 2012

Post by AmiDog » March 4th, 2016, 8:51 pm

The CPU doesn't have a data cache as the 1k which could be used as a data cache is used as scratchpad. It's easy to verify. It might be possible to put the data cache in normal mode (haven't tested that yet), but it would still only be 1k.

The CPU has a 4k instruction cache though (which is automatically used).

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » March 4th, 2016, 9:23 pm

AmiDog wrote:It might be possible to put the data cache in normal mode (haven't tested that yet), but it would still only be 1k.
I believe the memory controller handles that because you can disable the cache, but having it on executes code faster. There was a document that explained this somewhere. It's been a while...
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

yadokari
What is PSXDEV?
What is PSXDEV?
Posts: 1
Joined: Nov 30, 2018

Post by yadokari » November 30th, 2018, 4:34 am

I believe what Bill means is that the CPU-side rendering can be fully on-cache, ie the vertex load, transform, store loop easily fits into the i-cache and therefore the instruction fetch rarely needs to access the bus. It was also common to put the stack on SPAD for most of the frame, swapping back to main RAM for system calls.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests