SimpleScalar is a computer system architecture simulator. There happens to be different benchmarks that you can simulate on specific architecture with the help of the SimpleScalar simulator. In addition, you can simulate architecture performance for your own source code. SimpleScalar tool set can be download from http://www.simplescalar.com/
In our test machine the cross compiler and SimpleScalar utilities are installed. In case, these are not installed, you can follow the Installation guide provided in the below link to install SimpleScalar toolset.
Ubuntu 10.04.40 (Test Machine).
Untar the tgz file , simplesim-3v0e.tgz
- $ tar xzvf simplesin-3v0e.tgz
Go to the directory that is created after untarring
Install SimpleScalar for PISA architecture.
For other architectures you can use config- pisabig, config- pisalit, config- alpha.
Steps to use SimpleScalar:
The basic steps are,
- Compile source code (C, C++) and make binary executable file that is compatible for PISA architecture of SimpleScalar simulator. For doing this, you will need cross compiler of SimpleScalar Simulator.
- Simulate the binary executable file with SimpleScalar simulator. Different types of simulation options are available. For instance, sim-fast ,sim-outorder etc.
- Analyze the obtained result for the specific architecture.
*1. Compilation of source code
For using the cross compiler to compile source code in to SimpleScalar compatible binary executable file, you need to follow a format at the time of compiling. An example is shown below:
Compile it with cross compiler of SimpleScalar
- $ sslittle-na-sstrix-gcc –o hello hello.c
In the above command, the string, “sslittle-na-sstrix-gcc” is the command of the cross compiler. If the cross compiler is installed in another directory then you will have to set Path. In our test machine the compiler is installed in the directory /simplesim/bin/. You can use the command, $PATH=$PATH:/simplesim/bin/ .
The string, “sslittle-na-sstrix-gcc” is followed by the string “-o”. This describes the optimization technique of the compiler. You can use “-O2”, “-O3” flag for better compiler optimization. To know more about these, you can search google with the keyword, “compiler optimization levels”.
The next string, “hello” is the name of the binary executable file that will be created after compilation. The next following string, “hello.c” is the source file.
At the time of using benchmarks like MIBENCH, SPEC95 you will have to edit, “Makefile” in the above mentioned format.
2. Simulate the binary executable file:
Different simulation techniques are available in SimpleScalar Simulator. If you want to use for instance, sim-outorder simulation technique and the executable file “hello” is in the same directory, “simplesim-3.0” then you can use the following command.
- If the executable file, “hello” is in another directory then you can set the path of the simplesim-3.0 by the command $ PATH=$PATH:/simplesim-3.0/. And then you can write the command, $ sim-outorder hello
For simulating executable files of a particular benchmark you need to follow the format specified in the “runme” file provided in the benchmark directory. For instance, “qsort_large input_large.dat > output_large.txt” is specified in the “runme” file of the qsort folder of the automotive group of MIBENCH benchmark. For this, the simulation command will be,
3. Analyze the obtained Result:
- $ sim-outorder qsort_large input_large.dat > output_large.txt
Analyze the obtained result for the PISA architecture. For different compiler optimizations, the performance of the simulated architecture will vary.This includes, simulation time, number of instructions executed, L1/L2 cache misses/hit rate etc.
- security - blowfish(ranlib path, cc)