Monday, November 7, 2011

SESC Simulator: First Time Installation

Note: I am using LINUX with following specifications, g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1.

SESC: Cycle Accurate Architectural Simulator is the official website for SESC Simulator which contains; documentation, SescUtils Package informaiton.

Downloading SESC:
To download pre-compiled binaries of SESC Simulator, use the following instructions in LINUX Shell.
  • > sudo cvs -d:pserver:anonymous@sesc.cvs.sourceforge.net:/cvsroot/sesc login (When password is requested, just press enter) 
  • > cvs -z3 -d:pserver:anonymous@sesc.cvs.sourceforge.net:/cvsroot/sesc co -P sesc (By default, ‘sesc’ folder will be checked out in home folder)
Requirements:
  • Be sure that flex and bison is already installed 
  • > sudo apt-get install zlib1g-dev 
Building SESC:
Make new directory ‘build’ in ‘sesc’ folder;
Simulator can be configured as many set of operations, so recommendation is to create different ‘build’ directory for each configuration.
> mkdir build
> cd build

Configuring SESC:
SESC provides different configuration options, which can be checked using the following command;
> ../sesc/configure --help

Without any simulator configuration option, by default, all sesc directories are build.
> ../sesc/configure
> make

Errors during ‘make’:
  • ‘USHRT_MAX’ was not declared in this scope in [/sesc/src/libcore/FetchEngine.cpp and /sesc/src/libcore/Cluster.cpp] 
          Sol: Add #include <limits.h>
  • linux/dirent.h: No such file or directory in [/sesc/src/libmint/subst.cpp] 
          Sol: Change #include <linux/dirent.h> to #include <dirent.h>
  • ‘LONG_MAX’ was not declared in this scope, ‘uint32_t’ was not declared in this scope in [/sesc/src/libsuc/Config.cpp] 
          Sol: Add #include <limits.h>, Add #include <stdint.h>
  • ‘/usr/bin/ld’: cannot find -lz” 
          Sol: sudo apt-get install zlib1g-dev

Executable SESC:
> make sesc
’sesc.mem’ is the executable file for further testing.

Test Simulation with Crafty Benchmark:
There are few benchmark applications are available in ‘/sesc/tests’ folder to test previously build simulator. While running test simulation, by default, crafty benchmark is used.
> make testsim

Output:
The generated simulator output file will be with the name ‘sesc_crafty.xxxxxx’. The extension ‘xxxxxx’ is random and will be different every time benchmark is tested.

cp /home/user/build/../sesc/confs/mem.conf sesc.conf
cp /home/user/build/../sesc/confs/shared.conf .
./sesc.mem -h0x800000 -csesc.conf /home/user/build/../sesc/tests/crafty < /home/user/build/../sesc/tests/tt.in
static[0x1008db40-0x101b3dd4] heap[0x101b4000-0x109b4000] stack[0x109b4000-0x111ac000] -> [0x41000000-0x4211e4c0]

Crafty v14.3

sesc_simulation_mark 0 (simulated) @30176688
White(1): sesc_simulation_mark 1 (simulated) @30226193
White(1): pondering disabled.
sesc_simulation_mark 2 (simulated) @30297416
White(1): noise level set to 0.
sesc_simulation_mark 3 (simulated) @30320969
White(1): search time set to 99999.00.
sesc_simulation_mark 4 (simulated) @30423178
White(1): verbosity set to 5.
sesc_simulation_mark 5 (simulated) @30448529
White(1): sesc_simulation_mark 6 (simulated) @30749553
White(1): search depth set to 2.
sesc_simulation_mark 7 (simulated) @30765858
White(1): 
              clearing hash tables

              depth   time  score   variation (1)
                1   ###.##  -0.67   axb5 c6xb5
                1   ###.##  -0.08   a4a5
sesc_simulation_mark 8 (simulated) @33088274
                1-> ###.##  -0.08   a4a5
                2   ###.##     --   a4a5
                2   ###.##  -0.65   a4a5 f6f5
                2   ###.##  -0.58   axb5 c6xb5 Ne4c5
                2   ###.##  -0.46   Rf1c1 f6f5
                2   ###.##  -0.43   Ra1c1 f6f5
sesc_simulation_mark 9 (simulated) @37835514
                2-> ###.##  -0.43   Ra1c1 f6f5
              time:###  cpu:###  mat:-1  n:833  nps: ####
              ext-> checks:18 recaps:4 pawns:0 1rep:6
              predicted:0  nodes:833  evals:372
              endgame tablebase-> probes done: 0  successful: 0
              hashing-> trans/ref:17%  pawn:83%  used:w0% b0%

White(1): Ra1c1 
              time used: ###.##
sesc_simulation_mark 10 (simulated) @38876221
Black(1): execution complete.

Reports:
The generated output file in the previous step is based on type of configuration file. By changing parameters in the configuration file, the output file will be different.
There is ‘report.pl’ script file located in ‘/sesc/scripts/’ folder, is to view the outcome of the benchmark.
Keep in mind that we are still in build directory, that we created in the start. So, by executing the following command;
> ../sesc/scripts/report.pl -last

The detailed information based on the configuration file will be visible in the terminal. But by changing the script file, we can manage to write the output in text file as well.

Other Links:

4 comments:

  1. Hello Mr.Ali,

    I am installing Sesc for the first time and this tutorial is very, very helpfull. Thank you.
    But during ‘make’ the following error appear: ‘__getdelim’ was not declared in this scope
    make.

    Could you please help me?

    Raquel

    ReplyDelete
    Replies
    1. Hi Raquel!
      Currently, I am not using Ubuntu anymore. But there shouldn't be this error. You can remove previous installation and try compiling again. I hope you will succeed.
      Have good day.

      Delete
    2. Hi Raquei,

      I don't know if you fixed this but I just got sesc built on Ubuntu 12.10. It was quite painful but I quickly noted the steps for you and anyone else trying to do the same here: http://handsomemike.com/wp/?p=74

      Good luck!

      Mike

      Delete
    3. Thank you both. Problem solved!

      Delete

Integration of SQLite3 and Netbeans C/C++ IDE

Few days back, I wanted to use SQLite database for one of my project. I spend couple of hours to find a way to integrate with Netbeans. Mayb...