Topic
  • 3 replies
  • Latest Post - ‏2010-07-06T12:19:28Z by jadamcze
abn252
abn252
14 Posts

Pinned topic instruction count on playstation 3

‏2010-07-03T21:33:58Z |
Hello
If a C code is executed on PS3 is it possible to find the instruction executed in SPU.
I am interested in instruction count in SPU. Using spufs we may read next instruction address using npc but how to find total number of instructions. Kindly guide me if any tool or method available.
thanks
Updated on 2010-07-06T12:19:28Z at 2010-07-06T12:19:28Z by jadamcze
  • jadamcze
    jadamcze
    219 Posts

    Re: instruction count on playstation 3

    ‏2010-07-06T01:30:15Z  
    Look at the generated code.

    Either add the -S option to the GCC command line to generate an assembler source listing (.s file), or disassemble the generated code with something like objdump -d
  • abn252
    abn252
    14 Posts

    Re: instruction count on playstation 3

    ‏2010-07-06T10:41:52Z  
    • jadamcze
    • ‏2010-07-06T01:30:15Z
    Look at the generated code.

    Either add the -S option to the GCC command line to generate an assembler source listing (.s file), or disassemble the generated code with something like objdump -d
    A code consists of branch instruction and jump instructions. suggested type of instruction count will give all instructions. i require a specific path taken by the program while running. Instruction count for code and running program will definitely different.
  • jadamcze
    jadamcze
    219 Posts

    Re: instruction count on playstation 3

    ‏2010-07-06T12:19:28Z  
    • abn252
    • ‏2010-07-06T10:41:52Z
    A code consists of branch instruction and jump instructions. suggested type of instruction count will give all instructions. i require a specific path taken by the program while running. Instruction count for code and running program will definitely different.
    If you know what path is being taken (i.e. what the input is), it's not too difficult to count only those instructions that would be executed.

    Presumably you could do the sort of thing that you want with the simulator.

    Otherwise, the decrementer provides a resolution of 40 processor clock cycles. You should be able to make some reasonable estimates with that.

    I guess it depends on how many instructions you're trying to count, and how accurate you need that count to be. Instruction count alone isn't all that meaningful without taking into account how they are actually issued.