next up previous
Next: Appendix Up: CS161L Fall 2005 Previous: Cache Simulator

SimpleScalar

In this lab, you will install and use the most popular processor simulator of computer architecture research - SimpleScalar. Please find the introduction of SimpleScalar at http://www.simplescalar.com/.

Please follow the directions on http://www.cs.ucr.edu/$\sim$yluo/cs162/lab1.html to install SimpleScalar.

Next you will compile and run two programs with different compiler optimizations. Make observations on the impact of compiler optimizations on the performance (execution time) of the program.

  1. Compare gcc's optimization level options ``-O0'', ``-O1'', ``-O2'', ``-O3''. Use this example program http://www.cs.ucr.edu/$\sim$yluo/cs161L/labs/example1.c.

    To compile a program, use ``gcc'' from SimpleScalar package as follows:

    /usr/local/pkgs/ss/sslittle-na-sstrix/bin/gcc -O0 example1.c -o example1

    To run a program, use ``sim-outorder'' simulator:

    /usr/local/pkgs/ss/simplesim-3.0/bin/sim-outorder example1

  2. Compare gcc's optimization level options ``-O3 -funroll-loops'', ``-O3''.

    Use this example program http://www.cs.ucr.edu/$\sim$yluo/cs161L/labs/example2.c.

    To compile a program, use ``gcc'' from SimpleScalar package as follows:

    /usr/local/pkgs/ss/sslittle-na-sstrix/bin/gcc -O3 example2.c -o example2

    To run the program:

    /usr/local/pkgs/ss/simplesim-3.0/bin/sim-outorder example2

Record the ``sim_cycle'' number in the output of your simulations. Put these numbers into a bar graph in your report. Discuss the results.


next up previous
Next: Appendix Up: CS161L Fall 2005 Previous: Cache Simulator
Yan Luo
2005-01-20