Cell processor lab
Upcoming SlideShare
Loading in...5
×
 

Cell processor lab

on

  • 709 views

by Mansoor Mirza

by Mansoor Mirza
Tools Required
Cross compilers
Simulator
Cell SDK
Introduced by IBM
Contains
Cross compilers
Debuggers
Assemblers
Profilers

Statistics

Views

Total Views
709
Slideshare-icon Views on SlideShare
709
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Cell processor lab Cell processor lab Presentation Transcript

    • Cell Processor Lab
    • Cell Processor Lab
      • Tools Required
        • Cross compilers
        • Simulator
      • Cell SDK
        • Introduced by IBM
        • Contains
          • Cross compilers
          • Debuggers
          • Assemblers
          • Profilers
    • Cell Processor Lab
      • Cross Compilers
        • spu-gcc
        • ppu-gcc
        • ppu-embedspu
      • Simulator
        • IBM Full System Simulator
    • Cell Processor Lab
      • Code requirement
        • SPU code
        • PPU code
      • SPU code
        • Performs basic work
        • Data required by code has to be transferred to SPU using DMA or mailboxes
        • One SPU can only access LS directly
    • Cell Processor Lab
      • PPU code
        • Any code that runs on Linux can run on PPU
        • PPU distributes the work to SPUs
        • PPU should contain SPU handler
        • PPU should contain context of each SPU
    • Cell Processor Lab
      • PPU program flow
        • Declare SPU program handler
        • Declare SPU context for each SPU used
        • Create SPU context
        • Load SPU context
          • Loads SPU context to handler
        • Run SPU context
          • Runs the SPU code on SPU
    • Cell Processor Lab
      • SPU code
      • #include <stdio.h>
      • int main (unsigned long long spe_id,
      • unsigned long long argp,
      • unsigned long long envp) {
      • printf(&quot;Hello World! My thread id is %lldn&quot;,
      • spe_id);
      • return 0;
      • }
      • PPU Code
      Design and Animation Game Programming Graphics Programming Matthew Scarpino
    • Cell Processor Lab #include <stdio.h> #include <stdlib.h> #include <libspe2.h> extern spe_program_handle_t spu_basic; /* SPE program handle */ int main(int argc, char **argv) { spe_context_ptr_t spe; /* SPE context */ unsigned int entry_point; /* SPE start address */ int retval; /* Return value */ Design and Animation Game Programming Graphics Programming Matthew Scarpino
    • Cell Processor Lab /* Create the SPE Context */ spe = spe_context_create(0, NULL); if (!spe) { perror(&quot;spe_context_create&quot;); exit(1); } /* Load the program handle into the context */ retval = spe_program_load(spe, &spu_basic); if (retval) { perror(&quot;spe_program_load&quot;); exit(1); } Design and Animation Game Programming Graphics Programming Matthew Scarpino
    • Cell Processor Lab /* Run the program inside the context */ entry_point = SPE_DEFAULT_ENTRY; retval = spe_context_run(spe, &entry_point, 0, NULL, NULL, &stop_info); if (retval < 0) { perror(&quot;spe_context_run&quot;); exit(1); } /* Deallocate the context */ retval = spe_context_destroy(spe); if (retval) { perror(&quot;spe_context_destroy&quot;); exit(1); } return 0; } Design and Animation Game Programming Graphics Programming Matthew Scarpino
    • Cell Processor Lab
      • Setting the environment variable
        • Make sure that CellSDK and Full System Simulator is installed on you machine
          • Check whether /opt/cell/ is available
          • Check that /opt/cell/ibm is avaiable
        • Export path to SDK and simulator
          • export PATH=$PATH:/opt/cell/toolchain/bin
          • export PATH=$PATH:/opt/ibm/system-cell/bin
    • Cell Processor Lab
      • Building an application
        • Build SPU code
          • spu-gcc <spu_source_file.c> -o <outfile>
        • Embed SPU code to PPU
          • ppu-embedspu <spu handler> <outfile> <embedfile>
        • Build PPU code
          • ppu-gcc <ppu_source_file.c> <embedfile> -lspe2 -o <cell_executable_file>
        • Copy the executable at appropriate location
          • cp <cell_executable_file> /tmp
    • Cell Processor Lab
      • Starting the simulator
        • Conform that the PATH variable is updated as described earlier
        • Initialize the simulator
          • systemsim –g
        • Run the simulator as “systemsim%” interface appears
    • Cell Processor Lab
      • Starting the simulator
        • It will show two windows
          • Processor GUI dialog
          • Simulated terminal
      • Import the Cell executable to simulated environment
        • Issue following command in simulated terminal
          • callthru source /tmp/<cell_executable_file> > <file_name>
    • Cell Processor Lab
      • Import the Cell executable to simulated environment
        • Make file executable
          • chmod +x <file_name>
        • Run the file
          • ./<file_name> [options]
    • Cell Processor Lab
      • Running MPAC Cell benchmarks
        • Go to MPAC parent directory
          • cd /path/to/mpac/parent/directory
        • Make MPAC for Cell
          • make cell
        • Go to CPU benchmark directory
          • cd cbe/cpu_bench
        • Move the executable to appropriate location
          • cp mpac_cell_cpu /tmp
    • Cell Processor Lab
      • Running MPAC Cell benchmarks
        • Import the CPU benchmark executable to simulator
          • callthru source /tmp/mpac_cell_cpu > mpac_cell_cpu
        • Make the file executable
          • chmod +x mpac_cell_cpu
        • Execute the benchmark with appropriate options
          • ./mpac_cell_bm [options]
    • Cell Processor Lab
      • Running MPAC Cell benchmarks
        • Repeat the procedure for memory benchmarks
      • Why network benchmark is not ported for Cell processor?
      • MPAC benchmark architecture for Cell processor