Editing Tachyon

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[File:PSP CXD2962GG.jpg|thumb|PSP CXD2962GG]]
Tachyon is the codename of the PSP main CPU SoC IC. It is a Sony custom-made LSI which holds the main CPU (Allegrex), the VFPU coprocessor, the Media Engine CPU and its embedded DRAM, the Graphics Engine, the AVC decoder, the Virtual Mobile Engine DSP, the [[Kirk]] and [[Spock]] crypto engines, and the 4KB embedded mask ROM which holds the [[PRE-IPL|iplloader]] and routines to boot into service mode. Tachyon has one primary CPU core which is responsible for running the XMB and games, and a second CPU core (Media Engine) which implements the audio and video decoding functionality of the PSP.


<b>Tachyon</b> is the codename of the PSP main CPU SoC IC. It is a Sony custom-made LSI which holds the main CPU (Allegrex), the VFPU coprocessor, the Media Engine CPU and its embedded DRAM, the Graphics Engine, the AVC decoder, the Virtual Mobile Engine DSP, the [[Kirk]] and [[Spock]] crypto engines, and the 4KB embedded mask ROM which holds the [[iplloader]] and routines to boot into service mode.
[[File:PSP CXD2962GG.jpg|thumb|left|PSP CXD2962GG]]<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>


Tachyon has one primary CPU core which is responsible for running the [[XMB]] and games, and a second CPU core (<i>[[Media Engine]]</i>) which implements the audio and video decoding functionality of the PSP.
<br>
<br>
<br>
<br>


== Main Core "SC" ==
== Main Core "SC" ==


See [[Allegrex]].
The PSP's CPU, named Allegrex, is a dual core 32-bit Little Endian MIPS based on the R4000 design with a few custom instructions.


== Media Engine ==
Both CPU cores have their own 16 KiB Instruction and 16 KiB Data caches. The main CPU has an internal 16 KiB of scratchpad RAM that is accessed directly without going through the system bus.


See [[Media Engine]].
The main CPU has three coprocessors:
*COP0 - general system control
*COP1 - 32-bit Floating Point Unit
*COP2 - Vector Floating Point Unit (up to 3.2 GFLOPS)


== Virtual Mobile Engine ==
It has some instructions from MIPS IV: EXT, INS, WSBW, SEB, SEH, ROTR, ROT(R)V, BITREV, CLZ, CLO.
It doesn't seem to have:
*64bit instructions (of course)
*LL, LDC1, LDC2, LWC2, SC, SDC1, SDC2, SWC2 (some of them are actually replaced by VFPU instructions, with different names)
*T* (Trap and TLB) instructions
*BLTZAL, BGEZAL, BLTZALL, BGEZALL
*COP2 (VFPU) branching instructions
It also has its own instructions:
*HALT: opcode 0x70000000. This instructions waits for an interruption to wake it up.
*MFIC: opcode 0x70000024 with mask 0xFFFF07FF. It retrieves the interrupt controller state (1: interruptions enabled, 0: interruptions disabled) into the register described by mask 0x0000F800.
*MTIC: opcode 0x70000026 with mask 0xFFFF07FF. It sets the interrupt controller state to the value which is in the register described by mask 0x0000F800.


See [[Virtual Mobile Engine]].
The CPU defaults to 222MHz, but can be configured to run from 1-333 MHz.


== Graphics Engine ==
The CPU cores are connected to main memory and other peripherals like the Graphics Engine through a system bus that is limited to 1/2 of the CPU's configured clock speed.


: <i>See main article: <b>[[Graphics]]</b></i>
Since the PSP doesn't have a MMU, the COP0 registers related to TLBs are unused. The PSP also uses the obscure instructions cfc0/ctc0 to access "control registers" which are used by the PSP firmware to store various low level data.


== Memory mapping ==
=== CPU registers ===


This memory mapping is shared by the SC, the GE & the ME, except the VRAM which is accessible only by the SC and the GE.
The PSP calling convention seems a bit non-standard:
*Arguments are passed through the arguments $a0, $a1, $a2, $a3, $t0, $t1, $t2, $t3, then on the stack
*Registers $s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7, $fp (used as a normal register), $ra (return address), $sp (stack pointer) are saved (or restored) by the callee
*Registers $t4, $t5, $t6, $t7, $t8, $t9 are temporary registers, not saved by the callee
*Registers $v0, $v1 contain the return value of a function: $v0 for the lower 32-bits and $v1 for the higher 32-bits (if appliable)
Some registers are used only by the kernel:
*$gp and $k0 are used in only a few specific places in the kernel
*$k1 is used to check permissions: each time an user function is called, it shifts $k1 left by 11 bits. The function is in user mode if the $k1 value has then its first (highest value) bit set. In then checks either if a pointer has its higher bit set, and/or if its end has its higher bit set, and/or if its size has its higher bit set. If one of those bits is set and we're in user mode, the function returns an error (if it checked the pointer/buffer, which is not always the case).
*$at is used as a temporary register, for hardware manipulation sometimes (to store the hardware register address when reading/writing from/to it).


{| class="wikitable"
== Media Engine ==
|-
! Start !! End !! Size !! Description
|-
| 0x00010000 || 0x00013FFF || 0x00004000 (<i>16KiB</i>) || Allegrex Scratchpad
|-
| 0x04000000 || 0x041FFFFF || 0x00200000 (<i>2MiB</i>)  || Graphics Engine VRAM
|-
| 0x08000000 || 0x087FFFFF || 0x00800000 (<i>8MiB</i>)  || Allegrex Kernel memory (RAM)
|-
| 0x08800000 || 0x09FFFFFF || 0x01800000 (<i>24MiB</i>) || Allegrex User memory (RAM)
|-
| 0x1C000000 || ?          || ?                        || Hardware registers
|-
| 0x1FC00000 || 0x1FDFFFFF || 0x00200000                || MIPS Reset Vector
|-
| 0x1FE00000 || ?          || ?                        || Hardware registers
|-
|}


See [[Hardware Registers]] for details about the hardware registers.
The Media Engine ("ME") is a second MIPS based CPU core that was not directly accessible by licensed developers. Instead, Sony runs code on the ME to facilitate decoding audio and video assets, along with the help of more specialized hardware like the Virtual Mobile Engine and "AVC".


Access can be cached & privileged or not by changing the first 4 bits (<i>31-28 bits</i>) of the address using this virtual memory mapping:
The ME runs at the same clock frequency as the main CPU core.
{| class="wikitable"
|-
! Address !! Name !! Is it cached? !! Permission || Description
|-
| 0x<b>0</b>0000000 || KU0  || Cached  || User/Supervisor/Kernel || Main memory
|-
| 0x<b>4</b>0000000 || KU1  || Uncached || User/Supervisor/Kernel || Often used for VRAM
|-
| 0x<b>8</b>0000000 || K0    || Cached  || Kernel || Main kernel memory
|-
| 0x<b>A</b>0000000 || K1    || Uncached || Kernel || Mainly used for hardware registers
|-
| 0x<b>C</b>0000000 || K2/KS || Cached  || Supervisor/Kernel || Usage unknown/unconfirmed
|-
| 0x<b>E</b>0000000 || K3    || Cached  || Kernel || Usage unknown/unconfirmed
|-
|}


== PSP-1000 VFPU bug ==
The ME has two co-processors:
*COP0 - general system control
*COP1 - 32-bit Floating Point Unit


PSP-1000 CPU has broken <code>ulv.q</code> instruction, that causes FPU registers corruption.
== Graphics Engine ==
 
== Virtual Mobile Engine ==


You can see more about it [https://sites.google.com/a/davidgf.es/davidgf-net/home/psp-dev/vfpu-test?tmpl=%2Fsystem%2Fapp%2Ftemplates%2Fprint%2F here].
The VME appears to be one half of Sony's "Virtual Mobile Engine Concept 2" where a CPU would take care of "lightweight control tasks" and reconfigurable hardware logic (the VME) would do all of the "heavy work in a power efficient manner". See [https://www.yumpu.com/en/document/read/10961029/virtual-mobile-enginetm-vme-sony Virtual Mobile Engine - LSI that "Changes its Spots"].


== Versions ==  
== Versions ==  
Line 90: Line 92:
* https://www.zdnet.com/article/sony-reveals-some-specs-for-psp-handheld/ (2004)
* https://www.zdnet.com/article/sony-reveals-some-specs-for-psp-handheld/ (2004)


* https://www.extremetech.com/extreme/56942-sony-details-psp-chip-specs
https://www.extremetech.com/extreme/56942-sony-details-psp-chip-specs


* https://www.copetti.org/writings/consoles/playstation-portable/
https://www.copetti.org/writings/consoles/playstation-portable/
Please note that all contributions to PSP Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PSP Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)