IBM Assembly Visualizer for Cell Broadband Engine
A tool that provides a graphical user interface (GUI) for viewing the static analysis results of a Synergistic Processing Element (SPE) program and that enables safe, interactive hand-tuning of assembly.
Date Posted: May 10, 2007
|
|
 |
 |
|
 |  Go to the directory where you usually build your SPE program and type SPU_TIMING=1 make foo.s, but replace foo with the name of your program. | | |
 |  Make sure that you have a Java level of at least 6 installed. Also note that GNU Java (gij) is not supported at this time because it does not currently support Swing. | | |
 |  Instructions from the even (compute) pipeline are listed along the far left column, and instructions from the odd pipeline are listed along the far right column. If a single row contains both an even and odd instruction, it means that a dual issue will successfully take place.
The vertical x's represent clock cycles. A column of x's correspond to the cycles consumed by the instruction that is in the same row as the first x. Successive cycles of the even pipeline form a diagonal towards the lower right, and the odd pipeline forms a diagonal towards the lower left. The two diagonals meet in the middle and then wrap back around.
Veteran spu_timing users know that a well-tuned program forms a steep diagonal line from the upper left to the lower right. In the Assembly Visualizer, a good program instead forms steep V shapes towards the center. | | |
 |  Stalls are colored in bright red and are denoted with a pipe symbol (|) instead of an x.
If you select an instruction with the mouse, it will be highlighted in black. The chain of dependencies preceding and proceeding that instruction are then highlighted in light red.
The first previous instruction that can legally swapped with the current one is shown in green, and the next swappable instruction is shown in blue. If you attempt an illegal swap, it will not be allowed.
Branch targets are in yellow, and branches to subroutines are in brown. | | |
 |  You can attempt to move an instruction by selecting the instruction, pressing ALT, and using the up and down arrow keys.
If a move would destroy the correctness of the progam, it will not be allowed. Such illegal moves usually arise because it would violate a register dependency, but it can also arise if you try to move an instruction to the other side of a branch instruction. | | |
 |  Make sure that the functions were not inlined. | | |
 |  The precise steps you must take for this will vary depending on your Makefile configuration; therefore, the following is a high-level description.
- Save your modified assembly using the File > Save menu item.
- Send your compiler the assembly in the place of the *.c or *.cpp file. If you cut and paste foo.s in place of foo.c in the compiler command that your Makefile generates, it should work. This action will generate a foo.o object file, so running make now should invoke only the linker and other post-compilation steps. Your modified assembly should now be successfully integrated into the SPE binary.
- Call make from the PPE directory in order to incorporate the new SPE binary into your overall program.
| | |
 |  Changing the instruction order also changes the locations where no-ops should be inserted in order to maximize the number of dual issues. The Assembly Visualizer recalculates the locations where no-ops should be inserted every time an instruction is moved; therefore, you may see several instructions move because new no-ops were inserted or deleted. | | |
 |  Some subtle compiler optimization has probably been invalidated. Although an effort has been made to get Assembly Visualizer to preserve these optimizations, some are simply impractical to enforce on an assembly level without the original source code. Please revert to the original assembly.
Cell Broadband Engine and Cell/B.E. are trademarks of Sony Computer Entertainment, Inc., in the United States, other countries, or both and are used under license therefrom.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
IBM is a trademark of IBM Corporation in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
| |
|
|
 |
|
View screenshots:
 |
| |