introduction to ps3 cell be programming
DESCRIPTION
Narate Taerat. Introduction to PS3 Cell BE Programming. Cell BE Architecture. Picture ref: http://gamasutra.com/features/20060721/chow_01.shtml. Cell BE Architecture in PS3. PPEs. SPEs. PPEs. PowerPC Processor Element Main Processor 64 bit Also support Vector/SIMD - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/1.jpg)
March 12, 2007
Introduction to PS3 Cell BE Programming
Narate Taerat
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
![Page 2: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/2.jpg)
March 12, 2007
Cell BE Architecture
Picture ref: http://gamasutra.com/features/20060721/chow_01.shtml
![Page 3: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/3.jpg)
March 12, 2007
Cell BE Architecture in PS3
PPEs
SPEs
![Page 4: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/4.jpg)
March 12, 2007
PPEs
• PowerPC Processor Element• Main Processor• 64 bit• Also support Vector/SIMD• Run the OS, Manage SPE
![Page 5: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/5.jpg)
March 12, 2007
SPEs
• Synergistic Processor Element• 128-bit RISC, SIMD (vector) processor• 256 KB local storage memory• Use DMA to transfer data between local storage
and main memory
![Page 6: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/6.jpg)
March 12, 2007
Yellow Dog Linux
Easiest Linux installation on PS 3
Support to only Cell BE SDK 2.0
![Page 7: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/7.jpg)
March 12, 2007
Fedora Core 6
• Support Cell BE SDK 2.1
• More difficult to install• See instruction at
– www.ps3coderz.com/index2.php?option=com_content&do_pdf=1&id=73
![Page 8: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/8.jpg)
March 12, 2007
Cell Programming
• Main Process run on PPE• Threads run on SPEs• PPE Centric programming paradigm
PPE process
SPE thread
SPE thread
SPE thread
...
![Page 9: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/9.jpg)
March 12, 2007
PPE programming basic
• To create a SPE thread• speid_t spe_create_thread (
spe_gid_t gid, spe_program_handle_t *spe_program_handle, void
*argp, void *envp,
unsigned long *mask, int flags) • To wait a thread to complete• void speid_wait (
speid_t id, int *status, int option)
![Page 10: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/10.jpg)
March 12, 2007
SPE Programming basic
• To put data to and get data from PPE• mfc_get(ls, ea, size, tag, tid, rid) • mfc_put(ls, ea, size, tag, tid, rid)
void* ls: Local Storagevoid* ea: Effective Address (of PPE)size_t size: size, in byte, of transfer memoryint tag: DMA tag (0-31)int tid, rid: ???
![Page 11: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/11.jpg)
March 12, 2007
Compiling + Linking
• First compile SPE– spu-gcc spe_src.c -o spe_bin
• Embed it to a specific variable– embedspu spe_handle_var spu_bin embeded_spe.o
• Compile PPE and link to SPE– gcc ppe_src.c embeded_spe.o -lspu -o ppe_bin
![Page 12: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/12.jpg)
March 12, 2007
Reference & Sources
• CBE Programming Tutorialhttp://www-306.ibm.com/chips/techlib/techlib.nsf/techdocs/FC857AE550F7EB83872571A80061F788
• Cell SDK & Linux installation tutorialwww.ps3coderz.com/index2.php?option=com_content&do_pdf=1&id=73
http://www-128.ibm.com/developerworks/power/library/pa-linuxps3-1/
http://www-128.ibm.com/developerworks/power/library/pa-linuxps3-2/
http://www-128.ibm.com/developerworks/power/library/pa-linuxps3-3/
• Resources– http://hpci.latech.edu
![Page 13: Introduction to PS3 Cell BE Programming](https://reader035.vdocuments.site/reader035/viewer/2022062221/568144de550346895db1ab6f/html5/thumbnails/13.jpg)
March 12, 2007
Demo