The CBEA-compliant processor implements two concurrent storage models for an application program:
- virtual storage model of the PPE (also used by MFCs for DMA operations) . The PPE virtual storage model allows privileged software to provide different views of the real memory
and I/O devices for the PPE and any MFC unit DMA transfers. It is possible for multiple virtual address spaces to exist. - local storage model of the SPU. The SPU local storage model is restricted to applications running on SPUs and data transfers handled by the MFC.
- Allows applications to exist within a virtual address space larger than either the effective address space or the real address space.
- In a typical CBEA-compliant processor system, the effective address space of each program is a subset of a larger virtual address space managed by privileged software.
- The privileged software manages the real storage resources of the system by setting up the tables and other information used by the hardware address translation facility.
- Access to the virtual pages can be read/write, read only, or no access.
〔
基本上記憶體管理模型還是用 segmentation 加上 paging,只是與 x86 用詞上不太一樣:
CBEA 架構下是:
segmentation paging
virtual address -----------> effective address -----> real address
x86 架構下則是:
segmentation paging
logical address -----------> linear address -----> physical address
〕
3.2 SPU Local Storage Model
- Each SPU has its own dedicated area of local storage.
- The individual local storage areas can be aliased to a real address within the main storage
domain and any PPE can access these areas by using the appropriate effective address.
- The CBEA allows the local storage of an SPU to have an alias in the real address space in the main storage domain.
- This allows other processors in the main storage domain to access local storage through appropriately mapped effective address space.
- Privileged software should access the aliased pages of local storage in the main storage domain.
- If not accessed as caching inhibited, software must explicitly manage the coherency of local storage with other system caches.
〔若不以 cache inhibited 方式來存取 local storage,就必須由程式自己來處理 cache 與真正 local storage 間同步的問題了。〕
- MFC commands, which access an effective address range that maps to its own local storage can produce an error or unpredictable results.
〔 MFC command 若存取了對應到自己的 local storage 範圍時,則會產生錯誤會或不可預期的結果。因為此時 DMA 的來源與目的區塊是重疊的。〕 - Therefore, it is the programmer's and privileged software's responsibility to avoid an unintended overlap, which can result in the corruption of data.
3.3 Single-Copy Atomicity
- In the PowerPC Architecture, the following single register accesses are always atomic:
• Byte accesses (all bytes are aligned on byte boundaries)
• Halfword accesses aligned on halfword boundaries
• Word accesses aligned on word boundaries
• Doubleword accesses aligned on doubleword boundaries
• Quadword accesses aligned on quadword boundaries - Only quadword accesses of local storage are atomic.
〔沒有 alignment 的存取也不是 atomic 的,而在存取 local storage 時,只有 quadword access 是 atomic〕
- Harvard-style cache of PPC.
- A location in the data cache is considered to be modified in that cache if the location has been modified (for example, by a store instruction) and the modified data has not been written to main storage.
- Cache management instructions allow programs to manage the caches when needed.
- The Cache Management Instructions allow programs to:
• Invalidate the copy of storage in an instruction cache block (icbi)
[invalid an instruction cache]
• Provide a hint that the program will probably soon access a specified data cache block (dcbt, dcbtst)
[set a cache hint]
• Set the contents of a data cache block to zeros (dcbz)
[clear cache]
• Copy the contents of a modified data cache block to main storage (dcbst)
[copy back]
• Copy the contents of a modified data cache block to main storage and make the copy of the block in the data cache invalid (dcbf)
[copy back and set invalid] - The SL1 data cache commands allow programs to:
• Bring a range of effective addresses into the SL1 (sdcrt)
• Bring a range of effective addresses into the SL1 (sdcrtst)
• Write zeros to the contents of a range of effective addresses (sdcrz)
• Store the modified contents of a range of effective addresses (sdcrst)
• Store the modified contents of a range of effective addresses and invalidate the block (sdcrf) - Above instructions are treated as no operations (no-op) instructions in implementations without an SL1.
- 當一連串的存取同一個位址的 memory 時,並不能保證每次的 store 都會真的寫入到這個位址上,因為 cache 的關係,所以軟體必須要自己來控制 Memory coherence 的問題。
(原文寫了很多,就是要說明這一點啦~)
3.6 Storage Control Attributes
- Storage control attributes are associated with units of storage that are multiples of the page size.
〔以 page 為單位的 storage control attributes〕 - The storage control attributes are:
• Write through Required
〔從 cache 寫到了真的記憶體位址中〕
• Caching Inhibited
〔不使用 cache 〕
• Memory Coherence Required
〔需要 Memory Coherence〕
• Guarded
- The CBEA supports the sharing of storage between programs, between different instances of the same program, between SPUs, and between processors and other devices.
- It also supports access to a storage location by one or more programs using different effective addresses or DMA addresses.
〔segmentation + paging 吧〕 - Storage is shared in blocks of an integral number of pages.
- When the same storage location has different effective addresses, the addresses are called aliases.
- Each application can be granted separate access privileges to aliased pages.