11/29/2006

CBEA Note - 02

Part 2 User Mode Environment

Chapter 2

2.1 Instruction and Command Classes
  1. Both the PPE and the SPU components execute programs that consist of instructions that specify the type of actions they are to perform.
    〔PPE 與 SPU 需指定 type of actions〕
  2. The MFCs execute commands that specify the type of data copying or movement
    they are to perform.
    〔MFC command 則需指定 type of data〕
  3. These instructions and commands can be categorized into three classes, as follows:
    • Defined Class (see page 28)
    • Illegal Class (see page 28)
    • Reserved Class (see page 29)
  4. The class of an instruction or command is determined by examining the opcode.
    〔指令的類別由 opcode 來決定〕
  5. If an instruction opcode, or a combination of opcode and extended opcode, is not that of a defined or reserved instruction, then the instruction is illegal.
    〔不符合型態的指令會被認定為非法指令。〕
  6. In future versions of the CBEA, instructions or commands that are currently illegal can become defined (by being added to the architecture), or reserved (by being assigned to a special-purpose operation). Similarly, some instructions or commands that are currently reserved can become defined in a subsequent architecture release.
    〔非法指令的判定標準在未來版本的 CBEA 裡是會變動的。〕

2.1.1 Defined Class

  1. Defined instructions and commands are guaranteed to be provided in all implementations. The only deviations permitted are instructions or commands specifically identified in their descriptions as optional.
    〔屬於 Defined 類別中的指令或命令在未來也被保證能夠在所有的 CBEA implementation 中繼續執行。會變動的只有 optional 的部分。〕
  2. Defined instructions or commands can have preferred forms, or invalid forms, or both. These forms are also indicated in the relevant description.
    〔已定義的指令或命令有 preferred 格式或 invalid 格式,或是兩種格式兼具。格式會在相關的敘述中說明。〕

2.1.2 Illegal Class

  1. Any attempt to execute an illegal PPE instruction causes an exception interrupt, but has no other effect on the PPE operation.
    〔非法的 PPE 指令將導致一個 interrupt,但不影響此 PPE opertaion。〕
  2. Any SPU that encounters an illegal instruction immediately halts program execution, records the event in its status register, and requests an external interrupt.
    〔SPU 一旦執行到非法的指令將會停止執行整個程式,並把此事件紀錄在 status register中,最後產生一個 external interrupt。〕
  3. The illegal-instruction interrupt should be enabled and routed to a PPE. In either case, the exception interrupt should cause the illegal-instruction handler for the system to be invoked, which then takes appropriate action.
    〔非法指令產生的 interrupt 都應被導向 PPE ,由 illegal-instruction handler 來處理。〕

2.1.3 Reserved Class


  1. Reserved instructions are allocated to specific purposes outside the scope of the CBEA, or
    are intended for use in future extensions of the CBEA.
    〔Reserved instructions 是超出 CBEA 定義之外,但未來有可能被 CBEA 的 extensions 所使用的指令集。〕
  2. These are the only commands that should be used by implementation-dependent applications.
    〔這一種類的指令集應只被 implementation-dependent application 所使用。〕

2.2 Forms of Defined Instructions and Commands

In the defined set of instructions and commands, certain field or parameter settings can execute more efficiently, or can produce an error condition. The CBEA defines the field and parameter settings as preferred forms or invalid forms.


2.2.1 Preferred Forms
  1. Some defined instructions and commands have preferred forms. The preferred form of an instruction or command executes in an efficient manner; any other form can take significantly longer to execute.
    〔一些已定義的指令集有 preferred 格式,以此種格式被執行時會有較佳的效率。〕

2.2.2 Invalid Forms
  1. Some defined instructions and commands have invalid forms.
    〔一些 Defined instructions and commands 則有無效的格式。〕

2.2.3 Optional Forms
  1. Some of the defined instructions are optional. Any attempt to execute an optional instruction that is not provided by the implementation causes the system illegal-instruction interrupt handler to be invoked.
  2. Currently, there are no optional MFC commands or instructions, but there is an optional facility, the Isolation Facility.

2.2.4 Optional Fields
  1. Optional fields in the MFC commands are assumed to be zero if not explicitly set.
  2. Software does not have to set the optional fields if zeros achieve the desired results.

2.3 Exceptions

  1. Exceptions are the result of an operation that cannot be executed as requested. In the CBEA, there are four types of exceptions:
    • Exceptions caused directly by the execution of a PPE instruction
    • Exceptions caused by the execution of an SPU instruction
    • Exceptions caused by the execution of a MFC DMA command
    System-caused, asynchronous, external-event exceptions.
  2. An exception can set status information in a register, and can cause an interrupt handler of the system software in the PPE to be invoked.
  3. Exceptions caused by the execution of a PPE instruction are defined in PowerPC Architecture, Book I. :
    - caused by the execution of a PPE instruction
    - caused by an asynchronous event.
  4. Exceptions generated directly by the execution of an instruction include:
    • An attempt to execute an illegal instruction
    • An attempt to execute a privileged instruction from the user mode environment (PPE only)
    • The execution of a defined instruction using an invalid form
    • The execution of an optional instruction not supported by the implementation
    • An attempt to access storage with an effective address alignment that is invalid for the instruction (PPE only)
    • The execution of a system-call instruction (PPE only)
    • The execution of a trap instruction (PPE only)
    • The execution of a floating-point instruction that causes a floating-point exception that is enabled (PPE only)
    • The execution of a floating-point instruction that requires assistance from system software (PPE only)
    • The execution of an interrupt mailbox channel write instruction by the SPU
    • The execution of an SPU stop-and-signal instruction
  5. The exceptions generated by an MFC command include:
    • An attempt to execute an illegal MFC command
    • An attempt to execute a defined MFC command using an invalid form (that is, invalid parameters)
    • An attempt to execute a defined MFC command with an alignment error
    • The execution of an optional MFC command not supported by the implementation
    • An attempt to access storage not defined by the MFC-translation facility

2.4 SPU Events

The SPU supports an event facility that provides the capability to
  1. mask and to unmask events
  2. wait on events
  3. poll for events
  4. provide interrupts for specific events
If the SPU interrupts are enabled an occurrence of an unmasked event results in an SPU interrupt handler being invoked with the first instruction of the interrupt handler located at local storage address ‘0’.
〔嗯嗯~原來 SPU interrupt handler 在 LS address '0' 啊。〕

沒有留言: