| View previous topic :: View next topic |
| Author |
Message |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Wed Nov 01, 2006 2:33 am Post subject: SCRATCH PAD - Does the kernel use it ? |
|
|
Hi,
PSP does have a scratch pad (0×00010000 - 0×00014000 (16 KiB)). Scratch pad is usually a faster memory than other memories. I was wondering if kernel or user libraries (i mean not ours) do really use it or it is eventually free for our purpose ? can it be cached ? or is it irrelevant ? |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Nov 01, 2006 4:10 am Post subject: |
|
|
| It's been said on IRC that the scratchpad ram ends up being no faster than normal ram on the PSP, haven't tested it myself though. |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Wed Nov 01, 2006 5:00 am Post subject: |
|
|
not slower too ?
well, I remember when I was working on SH1, there is another reason to use scratch pad : to avoid both instructions and data to be fetched from the external bus (DRAM here) by running instructions in scratch pad to make memory transfer faster. But, well, there was no cache and it was running at 10 MHz. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed Nov 01, 2006 6:55 am Post subject: |
|
|
| Based on the odd system diagram which Sony have put out it looks like scratchpad is not really internal to the CPU (like on most processors where it has that name) but actually somewhere on the external bus, so you dont even get normal speed + no bus access it seems :( |
|
| Back to top |
|
 |
ector
Joined: 12 May 2005 Posts: 195
|
Posted: Wed Nov 01, 2006 8:13 pm Post subject: |
|
|
At the presentation at BP2005, if I remember correctly, the presenter mentioned that there is a hardware bug that causes scratchpad RAM to be way slower than was intended. If it is separate from the CPU and actually is on the bus however as Tyranid says, I would call that bad design, not a bug :) _________________ http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come. |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
Posted: Thu Nov 02, 2006 3:57 am Post subject: |
|
|
i have messed around with writing stuff to the scratchpad, and it didnt affect anything (atleast i didnt notice =D) and the data i wrote there also stayed unmodified...
but yeah its true, its not usefull for speedups (like it was on good old psx) :/ _________________ http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/ |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Thu Nov 02, 2006 4:11 am Post subject: |
|
|
| Well there is a flag in CreateThread to allocate the stack on the scratch pad (think it is 1.5+ only) but none of the kernel threads use that flag afaik. |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Thu Nov 02, 2006 6:05 pm Post subject: |
|
|
okay, to sum up :
1) scratch pad access is not more or less fast as main memory access due to the necessity for both to pass through an external bus. Sure, scratch pad sounds like a misname :/ and mostly a bad design rather than a bug indeed.
2) kernel doesn't use it, al least, for the running life of an application.
well, scratch pad still offers us 16 KiB for free.
By the way, do you know if GP is used by kernel ? by pspdev ? or can I set with my own address ? |
|
| Back to top |
|
 |
Exophase
Joined: 06 Nov 2006 Posts: 2
|
Posted: Mon Nov 06, 2006 3:58 pm Post subject: |
|
|
| hlide wrote: | okay, to sum up :
By the way, do you know if GP is used by kernel ? by pspdev ? or can I set with my own address ? |
GP is not a kernel register, but the compiler will use it to access global variables. You can set it to whatever you want, just be sure that when you call non-ASM functions to set it to whatever it was when you started running the assembly code. |
|
| Back to top |
|
 |
|