Archer:FeS2

From Grid-Appliance Wiki

Jump to: navigation, search

Contents

Introduction

HOW-TO Author: Girish Venkatasubramanian, Girish

Overview: FeS2 is a timing-first, multiprocessor, x86 simulator, implemented as a module for Virtutech Simics. The highlights of FeS2 are

  • Full System simulation with an accurate execution-driven timing-model that includes a cache hierarchy, branch predictors and a superscalar out-of-order core for x86 ISA
  • Provides multiprocessor (Ruby from GEMS) support
  • Uses PTLSim model to decode the x86 instructions to micro-operations

More about FeS2 can be found at the FeS2 website.

Pre-Requisites to using Simics on Archer

  • Archer Global VM with Simics 3.0.1
  • Qt 3.0 or higher
  • SCons - a python based replacement tool for make
  • Subversion - a version control tool
  • Libraries/packages - bison, flex, m4 are also needed.

Obtaining Archer VM

Obtain the Archer Global Image by following this tutorial (http://www.grid-appliance.org/wiki/index.php/Archer:Global). Setup the VM with Simics module.

The tutorial at http://www.grid-appliance.org/wiki/index.php/Archer:Simics gives an idea of how to connect your Archer VM to the existing pool of machines and run a Simics simulation (either locally on the machine running the VM image or remotely on the Archer infrastructure).

Note: Whenever using the VM image, it may be a good idea to flush the existing iptables filter periodically using the command

sudo iptables --flush

Installing Other Prerequisites

sudo apt-get update
sudo apt-get --reinstall install defoma
sudo apt-get install bison m4 flex libqt3-mt qt3-dev-tools scons subversion

Checking Out FeS2 code

Open a command terminal and type the following commands.

cd /home/griduser
svn co http://subversion.cs.uiuc.edu/pub/svn/FeS2/trunk FeS2
cd FeS2

Setting Environment Variables

In the following sequence of commands replace <SimicsInstallDir> with the actual path where Simics is installed on your system. Typically this would be /opt/virtutech/simics-3.0.x.

cd /home/griduser/FeS2
export FES2_HOME=${PWD}
export PACG_HOME=${PWD}/external
export PYTHONPATH=${PACG_HOME}:${FES2_HOME}/python_lib:${PYTHONPATH}
export SIMICS_INSTALL_DIR=<SimicsInstallDir>
export LD_LIBRARY_PATH=/usr/share/qt3/lib/

Configure and Build FeS2

cd /home/griduser/FeS2
./install.py
make

Testing the Build

In order to test the build the user has to create a Simics checkpoint. Archer users can use the checkpoint at /mnt/ganfs/C124004016/fes2-checkpoint/

Set up the batch script for Simics

A Simics script file, for running the simpletest binary inside the checkpoint, and some related files can be found in the /home/griduser/FeS2/test/example/simpletest directory. To use them, copy the files into your FeS2-workspace directory and build the test program.

cd /home/griduser/FeS2/
cp test/example/simpletest/* simics/FeS2-workspace

Run the Simulation

Note: The checkpoint in /mnt/ganfs/C124004016/fes2-checkpoint/ already has simpletest.c compiled in it. So the con0.input lines in simpletest_notrace.simics to mount /host, copy simpletest and unmount /host can be commented out.

cd /home/griduser/FeS2/simics/FeS2-workspace
./simics -quiet /mnt/ganfs/C124004016/fes2-checkpoint/tango_booted_standalone -x simpletest_notrace.simics

This will use the magic instructions compiled into the sample program as markers for starting the simulator in warmup, switching to timing mode and finally terminating the simulation.

Viewing the results

Two statistic files will be generated: one for the warmup (named simpletest.stats.warmup) and one for the timing run (named simpletest.stats). These statistics files are formatted such that they can be directly parsed by a python script for analysis, as demonstrated by the included example script.

cd /home/griduser/FeS2/simics/FeS2-workspace
./simpletest_stats_parser.py simpletest.stats

You will see an output similar to what is shown below.

--------------------------------------------------------------------------------
infile: simpletest.stats
total cycles: 45602
total UOps: 144481 ( UPC: 3.168 ),
total X86 Ops: 92473 ( IPC: 2.028 ),
error rate: 0.0530% ,
branch prediction: 99.61% ,
--------------------------------------------------------------------------------

This verifies the build.

References

  1. The FeS2 website http://fes2.cs.uiuc.edu/index.html
  2. The FeS2 developers mailing list http://lists.cs.uiuc.edu/mailman/listinfo/fes2-devel
  3. Archer wiki at http://www.grid-appliance.org/wiki/index.php/Archer:Index
Personal tools