Memory map: Difference between revisions

Fix explication of writes. It's RDRAM that handles byte and short writes, not RCP.
No edit summary
(Fix explication of writes. It's RDRAM that handles byte and short writes, not RCP.)
 
Line 136:
 
* Reads: VR4300 puts the address on the bus and the size of the access (8, 16, 32, 64). The RCP typically returns a full (aligned) 32-bit word address (or two, in case of a 64-bit read), from which the VR4300 extracts the correct portion. For instance, when reading 8-bit from address <code>0x0000'0001</code>, the RCP will put on the bus the 32-bit values at <code>0x0000'0000 - 0x0000'0003</code>, and the VR4300 will then just isolate the requested 8 bits.
* Writes: VR4300 puts the address on the bus, the size of the access, and then the 32-bit value to be written. When the access is made using 8 or 16 bits, the value on the bus is prepared to match with the aligned 32-bit address. This is the same of what happens for reads, but this time it is the VR4300 tothat prepareprepares the data. For instance, if register <code>S0=0x1234'5678</code>, <code>A0=0x00000x0400'0001</code> and the opcode <code>SB S0, 0(A0)</code> is run, the VR4300 puts on the bus the value <code>S0 << 168</code>, that is <code>0x56780x3456'00007800</code>. ItRCP is then up toignores the RCPlower to2 seebits that, sinceof the address isand the <code>0x0000'0001</code>''access size''', (so offsetany 1RCP withinregister theor 32-bitMapped word),memory itwill needstreat toit isolateas the32bit thewrite secondof byte<code>0x3456'7800</code> to <code>0x78Address & 0xfffffffc</code>., So even if it's is aan 8- bit write opcode, otherthe upper bits of the register <code>S0</code> "leak" ononto the bus. However, the lower bits of '''address''' and '''access size''' are passed on to the RDRAM devices (see below).
 
Notice that misaligned address are forbidden by MIPS architecture and they will result in an Address Exception. So all accesses that go through the memory map are always aligned to the access size (eg: aligned to 2 bytes for 16-bit reads/writes).
 
=== Range 0x0000'0000 - 0x03EF'FFFF (RDRAM memory) ===
The accesses in this area are handled by RCP via RI (Ram Interface). When the VR4300 reads or writes a location in this range, it gets stalled while the RI communicates with the RDRAM via the RAMBUS serial protocol. As soon as the read or write is finished, the VR4300 is released. Effectively, all reads and writes are synchronous (blocking) from the point of view of the VR4300, as you would expect when accessing a RAM. All access sizes work correctly: 8-bit, 16-bit, 32-bit, 64-bit. Support smaller access sizes is implemented the RDRAM device, which uses the lower bits of '''address''' and '''access size''' passed from RCP to generate a byte mask.
 
The RDRAM area is the only areas in the memory map where the RCP supports '''cached''' accesses. This allows the VR4300 to issue the cache fills/flushes at the SysAD level to leverage the internal data and instruction cache (either via the KSEG0 directly-mapped segment, or through a TLB configured with the cache setting). Instead cache requests are ignored for all the other address ranges, and they will thus freeze the CPU requiring a hard reset.
 
 
=== Range 0x03F0'0000 - 0x03FF'FFFF (RDRAM registers) ===
22

edits