Introduction to SimpleScalar Tool Set
description
Transcript of Introduction to SimpleScalar Tool Set
Introduction to SPIM and SimpleScalar
Introduction to SimpleScalar Tool Set
CPEG323 Tutorial
Long Chen
September, 2005
CPEG323 FALL, 2005
Outline
Why this tutorial?What is SimpleScalar Tool Set?Where to get it?How
to install it?How to use it?Demo
CPEG323 FALL, 2005
Why This Tutorial?
Course Labs and projects are based on SimpleScalar tool set.
It will help you develop the ability to practice what you
learned in class.
CPEG323 FALL, 2005
Outline
Why this tutorial?What is SimpleScalar Tool Set?Where to get it?How
to install it?How to use it?Demo
CPEG323 FALL, 2005
What is SimpleScalar Tool Set?
A Complete Computer Architecture Test BedSimulatorsCompiler,
assembler, linkerTargeted to the SimpleScalar PISA architectureA
sourcelevel debugger.
CPEG323 FALL, 2005
A Computer Architecture Simulator Primer
What is an architecture simulator?A tool that reproduces the
behaviors of a computer device
Why use a simulator?Leverage faster, more flexible S/W
development cycle
CPEG323 FALL, 2005
Simulators
sim-fast-> a very fast functional (i.e., no timing)
simulatorsim-safe-> the minimal functional SimpleScalar
simulatorsim-profile-> a program profiling
simulatorsim-cache-> a multi-level cache
simulatorsim-cheetah-> a single-pass multi-configuration cache
simulatorsim-bpred-> a branch predictor
simulatorsim-outorder-> a detailed out-of-order issue
performance (timing) simulator with a multi-level memory
system
CPEG323 FALL, 2005
Compiler & Other Utilities
Compiler: ported from GNU gccAssembler: asLinker & Loader:
ldBinary Utilities: ar, nm, objdump, objcopy, ranlib, size,
strings, strip, ...C library: pre-built glibc-1.09
CPEG323 FALL, 2005
Outline
Why this tutorial?What is SimpleScalar Tool Set?Where to get it?How
to install it?How to use it?Demo
CPEG323 FALL, 2005
Where to Get It?
simplesim-3v0d.tgz: SimpleScalar simulator source code;simpletools-2v0.tgz: gcc compiler and glibc;simpleutils-2v0.tgz: binary utilities;
Obtain tar balls from www.simplescalar.com or
www.capsl.udel.edu/courses/cpeg323/2005/
CPEG323 FALL, 2005
Outline
Why this tutorial?What is SimpleScalar Tool Set?Where to get it?How
to install it?How to use it?Demo
CPEG323 FALL, 2005
Preparation
Logon the Linux machine in the Computer Lab, 132 Evans HallCreate
an empty directory in you home directory, say,
$HOME/simplescalar/Copy all three tar balls to that directory.cd
$HOME/simplescalar/tar xzvf simplesim-3v0d.tgztar xzvf
simpletools-2v0.tgztar xzvf simpleutils-2v0.tgz
CPEG323 FALL, 2005
Directories
simplesim-3.0/: the sources of the SimpleScalar
simulators.binutils-2.5.2/: the GNU binary utilities code, ported
to the SimpleScalar architecture.sslittle-na-sstrix/: the root
directory for the tree in which little-endian SimpleScalar binary
utilities and compiler tools will be installed. The unpacked
directories contain header files and a pre-compiled copy of
libc.ssbig-na-sstrix/: the same as above, except that it holds
big-endian staffs.gcc-2.6.3/: the GNU C compiler code, ported to
SimpleScalar architecture.glibc-1.09/: the GNU libraries code,
ported to SimpleScalar architecture.
CPEG323 FALL, 2005
Build GNU Binary Utilitiescd
$HOME/simplescalar/binutil-2.5.2./configure
--host=i386-\*-gnu/linux --target=sslittle-na-sstrix --with-gnu-as
--with-gnu-ld --prefix=$HOME/simplescalarmakemake install
Build & Install Steps - 1
CPEG323 FALL, 2005
Build Simulatorscd $HOME/simplescalar/simplesim-3.0make
config-pisamake
Build & Install Steps - 2
CPEG323 FALL, 2005
Build the Compilercd $HOME/simplescalar/gcc-2.6.3./configure
--host=i386-\*-gnu/linux --target=sslittle-na-sstrix --with-gnu-as
--with-gnu-ld --prefix=$HOME/simplescalarmake
LANGUAGE=c../simplesim-3.0/sim-safe ./enquire -f >!
float.h-crossmake install
Build & Install Steps - 3
CPEG323 FALL, 2005
Got Error Messages!
Do not panic! Try to solve these problems by yourself first. You
will gain valuable experience in this procedure. If you REALLY need
help, please refer to the appendix of the simplescalar build
memo.If you STILL have difficulty to install the tool set, you
might seek help from TA.
CPEG323 FALL, 2005
Check Your Installation
Check $HOME/simplescalar/bin for the complier, assembler, linker,
and other binary utilities.Write simple program to verify itCheck
$HOME/simplescalar/simplesim-3.0 for simulatorscd
$HOME/simplescalar/simplesim-3.0make sim-tests
CPEG323 FALL, 2005
Outline
Why this tutorial?What is SimpleScalar Tool Set?Where to get it?How
to install it?How to use it?Demo
CPEG323 FALL, 2005
How to Use it?
Write programWrite C code.Or, just write assembly code (you will
learn how to do it in the following lectures)Compile the source
codesslittle-na-sstrix-gcc o foo foo.cC code to binary
codesslittle-na-sstrix-gcc o foo.s S foo.cC code to Assemble
codesslittle-na-sstrix-gcc o foo foo.sAssemble code to binary
codeUse the simulator to run the binary codesim-fast foo
CPEG323 FALL, 2005
Hints for Lab1
Do Problem 2 firstGenerate the assembly code from C codeInvestigate
the assembly codeTry to modify the assembly code by your own (for
Problem 1)Compile the modified assembly code, run the binary code,
find the difference between outputs
CPEG323 FALL, 2005
Outline
Why this tutorial?What is SimpleScalar Tool Set?Where to get it?How
to install it?How to write program for it?Demo
CPEG323 FALL, 2005
SimpleScalar Demo
CPEG323 FALL, 2005