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]]
[[File:PSP CXD2962GG.jpg|thumb|PSP CXD2962GG]]


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


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


See [[Allegrex]].
The PSP's CPU, named <b>Allegrex</b> — is a dual core 32-bit Little Endian MIPS processor, based on the R4000 design with a few custom instructions.
 
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.
 
The main CPU has three coprocessors:
* <b>COP0</b>: general system control
* <b>[[COP1]]</b>: 32-bit Floating Point Unit
* <b>[[COP2]]</b>: Vector Floating Point Unit (up to 3.2 GFLOPS)
 
It has some instructions from <b>MIPS IV:</b> <code>ext, ins, wsbw, seb, seh, rotr, rot(r)v, bitrev, clz, clo</code>.
 
It doesn't seem to have:
* 64-bit instructions (of course)
* <code>ll, ldc1, ldc2, lwc2, sc, sdc1, sdc2, swc2</code> (<i>some of them are actually replaced by VFPU instructions with different names</i>)
* T* (<i>trap and TLB</i>) instructions
*<code>bltzal, bgezal, bltzall, bgezall</code>
* [[COP2]] (<i>VFPU</i>) branching instructions
 
It also has its own instructions:
* <code>halt</code> (<i>opcode 0x70000000</i>): This instructions waits for an interruption to wake it up.
* <code>mfic</code> (<i>opcode 0x70000024 with mask 0xFFFF07FF</i>): It retrieves the interrupt controller state (<i>1: interruptions enabled, 0: interruptions disabled</i>) into the register described by mask 0x0000F800.
* <code>mtic</code> (<i>opcode 0x70000026 with mask 0xFFFF07FF</i>): It sets the interrupt controller state to the value which is in the register described by mask 0x0000F800.
 
The CPU defaults to 222 MHz, but can be configured to run from 1-333 MHz.
 
The CPU cores are connected to main memory and other peripherals like the Graphics Engine through a system bus, that is limited to half of the CPU's configured clock speed.
 
Since the PSP doesn't have a MMU, the COP0 registers related to TLBs are unused. The PSP also uses the obscure instructions <code>cfc0</code>/<code>ctc0</code> to access "control registers" which are used by the PSP firmware to store various low level data.
 
=== Calling convention ===
 
The PSP calling convention seems a bit non-standard:
*<b>Arguments are passed</b> through following registers: <code>$a0, $a1, $a2, $a3, $t0, $t1, $t2, $t3</code>, then on the stack
*Registers <code>$s0, $s1, $s2, $s3, $s4, $s5, $s6, $s7, $fp</code> (<i>used as a normal registers</i>), <code>$ra</code> (<i>return address</i>), <code>$sp</code> (<i>stack pointer</i>) <b>are saved</b> (<i>or restored</i>) by the callee
*Registers <code>$t4, $t5, $t6, $t7, $t8, $t9</code> are temporary registers, <b>not saved</b> by the callee
*Registers <code>$v0, $v1</code> contain the <b>return value</b> of a function: <code>$v0</code> for the lower 32-bits and <code>$v1</code> for the higher 32-bits (if appliable)
 
Some registers are used only by the kernel:
*<code>$gp</code> and <code>$k0</code> are used in only a few specific places in the kernel
*<code>$k1</code> <b>is used to check permissions</b>: each time an user function is called, it shifts <code>$k1</code> left by 11 bits. The function is in user mode if the <code>$k1</code> 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).
*<code>$at</code> (<i>assembly temporary</i>) <b>is used as a temporary register</b>, for hardware manipulation sometimes (to store the hardware register address when reading/writing from/to it).


== Media Engine ==
== Media Engine ==


See [[Media Engine]].
<b>The Media Engine</b> (<i>or shortly ME</i>) — 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".
 
The ME runs at the same clock frequency as the main CPU core. It seems to have the same instruction set.
 
The ME has two co-processors:
* <b>COP0</b>: general system control
* <b>[[COP1]]</b>: 32-bit Floating Point Unit
 
It has three instructions the main CPU doesn't have (or used):
* <code>DBREAK</code> (<i>also present on other MIPS processors</i>): used only once in the ME firmware
* <code>MTVME</code>
* <code>MFVME</code>
 
These two last instructions actually have the same opcodes as LDL and SDL, which this CPU doesn't have.
The instructions are actually encoded like this:
<pre>
ldl $reg, off($a3) <=> mfvme $reg, $off
sdl $reg, off($a3) <=> mtvme $reg, $off
</pre>
They might be used to store and retrieve information from and to the VME. They seem to be only used for video decoding.
 
== Graphics Engine ==


== Virtual Mobile Engine ==
== Virtual Mobile Engine ==


See [[Virtual Mobile Engine]].
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"].


== Graphics Engine ==
It might be something like a reconfigurable DSP; noone has been able to interpret its "firmware" yet.


: <i>See main article: <b>[[Graphics]]</b></i>
It can be accessed from the ME through the mfvme/mtvme instructions or through DMA with addresses from 0x440F8000 to 0x44100000 (excluded).


== Memory mapping ==
== Memory mapping ==
Line 35: Line 96:
| 0x08000000 || 0x087FFFFF || 0x00800000 (<i>8MiB</i>)  || Allegrex Kernel memory (RAM)
| 0x08000000 || 0x087FFFFF || 0x00800000 (<i>8MiB</i>)  || Allegrex Kernel memory (RAM)
|-
|-
| 0x08800000 || 0x09FFFFFF || 0x01800000 (<i>24MiB</i>) || Allegrex User memory (RAM)
| 0x08800000 || 0x097FFFFF || 0x01800000 (<i>24MiB</i>) || Allegrex User memory (RAM)
|-
|-
| 0x1C000000 || ?          || ?                        || Hardware registers
| 0x1C000000 || ?          || ?                        || Hardware registers
Line 65: Line 126:
|-
|-
|}
|}
== PSP-1000 VFPU bug ==
PSP-1000 CPU has broken <code>ulv.q</code> instruction, that causes FPU registers corruption.
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].


== Versions ==  
== Versions ==  
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)