Hello World Programming on PS3

出典: PS3 Linux Information Site / Cell/B.E.のパワーを体験しよう

English / Japanese

There are several ways to write programs on PS3 using SPE. This page introduces some programs to realize the traditional “Hello World” on PS3.

Actually, the processing to write “Hello World” from SPE to a console is performed just by calling the function “printf()” in PPE from SPE. (All the I/O functions on SPE are internally sent to PPE and processed because SPE cannot directly access I/O.) Therefore, in fact, most of the computing capabilities of SPE are not used in the programs mentioned in this page. The key to fully utilizing the features of PS3 is that how you can perform parallel computations with SIMD operations or duplication of DMA transfer in addition to the normal operations of SPE.

However, frameworks of programs mentioned here will be helpful in understanding flows to run programs on SPE or in surveying the differences between libspe1 and libspe2.

See Overview of Libspe for the summary of libspe and Building Libspe Programming Environment for the details of building programming environment using libspe. Also, see Known Bugs for Libspe for the known bugs of libspe.


目次

Hello World using PPE

  • Required rpm: Nothing
  • Summary: Outputting from PPE program.
  • Execution Method: Execute the “ppe-main” from a shell prompt.
  • Source Code: Under the “ppe” directory

Hello World using SPE

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe execution environment and elfspe (1 or 2)
  • Summary: Outputting from SPE program.
  • Execution Method: Execute “spe-main” from a shell prompt
  • Source Code: Under the “spe” directory

Hello World libspe 1.X version using SPE

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe 1.X
  • Summary: Calling SPE program from PPE to output from the SPE program.
  • Execution Method: Confirm that ”spe-main” exists in the current directory, and execute the “ppe-main” from a shell prompt.
  • Source Code: Under the “libspe1” directory

Hello World libspe 1.X + embedspu versions using SPE

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe 1.X
  • Summary: Calling SPE program embedded in PPE binary from PPE to output from the SPE program.
  • Execution Method: Execute the “ppe-main” from a shell prompt.
  • Source Code: Under the “libspe1-embedspu” directory

Hello World libspe 1.X version using multiple SPEs

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe 1.X
  • Summary: Calling multiple SPE programs from PPE, and sending the "Hello World" message to SPE through DMA transfer to output from the SPE program.
  • Execution Method: Confirm that ”spe-main” exists in the current directory, and execute the “ppe-main” from a shell prompt.
  • Source Code: Under the “libspe1-multi” directory

Hello World libspe 2.0.X version using SPE

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe 2.0.X
  • Summary: Calling SPE program from PPE to output from SPE program.
  • Execution Method: Confirm that ”spe-main” exists in the current directory, and execute the “ppe-main” from a shell prompt.
  • Source Code: Under the “libspe2” directory

Hello World libspe 2.0.X + embedspu versions using SPE

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe 2.0.X
  • Summary: Calling SPE program embedded in PPE binary from PPE to output from the SPE program.
  • Execution Method: Execute the “ppe-main” from a shell prompt.
  • Execution Method: Execute the “ppe-main” from a shell prompt.

Hello World libspe 2.0.X version using multiple SPEs

  • Required rpm: Development tools for SPE (spu-gcc, etc. + SPU newlib), libspe 2.0.X
  • Summary: Calling multiple SPE programs from PPE, sending the memory address storing "Hello World" message to SPE using mbox, and then sending the message to SPE through DMA transfer to output from the SPE program.
  • Execution Method: Confirm that ”spe-main” exists in the current directory, and execute the “ppe-main” from a shell prompt.
  • Source Code: Under the “libspe2-multi” directory

Back To Libspe: PS3 Programming Environment


© 2007 Fixstars Corporation. © 2007 Sony Computer Entertainment Inc.


Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

DISCLAIMER

THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

表示
個人用ツール
Open Source Projects