270 likes | 478 Views
Introduction to SimpleScalar Tool Set. CPEG323 Tutorial Long Chen. September, 2005. Outline. Why this tutorial? What is SimpleScalar Tool Set? Where to get it? How to install it? How to use it? Demo. Why This Tutorial?. Course Labs and projects are based on SimpleScalar tool set.
E N D
Introduction to SimpleScalar Tool Set CPEG323 Tutorial Long Chen September, 2005
Outline • Why this tutorial? • What is SimpleScalar Tool Set? • Where to get it? • How to install it? • How to use it? • Demo
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.
Outline • Why this tutorial? • What is SimpleScalar Tool Set? • Where to get it? • How to install it? • How to use it? • Demo
What is SimpleScalar Tool Set? A Complete Computer Architecture Test Bed • Simulators • Compiler, assembler, linker • Targeted to the SimpleScalar PISA architecture • A source–level debugger.
System output Device Simulator System input System metrics 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
Simulators • sim-fast -> a very fast functional (i.e., no timing) simulator • sim-safe -> the minimal functional SimpleScalar simulator • sim-profile -> a program profiling simulator • sim-cache -> a multi-level cache simulator • sim-cheetah -> a single-pass multi-configuration cache simulator • sim-bpred -> a branch predictor simulator • sim-outorder -> a detailed out-of-order issue performance (timing) simulator with a multi-level memory system
Compiler & Other Utilities • Compiler: ported from GNU gcc • Assembler: as • Linker & Loader: ld • Binary Utilities: ar, nm, objdump, objcopy, ranlib, size, strings, strip, ... • C library: pre-built glibc-1.09
Outline • Why this tutorial? • What is SimpleScalar Tool Set? • Where to get it? • How to install it? • How to use it? • Demo
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.comorwww.capsl.udel.edu/courses/cpeg323/2005/
Outline • Why this tutorial? • What is SimpleScalar Tool Set? • Where to get it? • How to install it? • How to use it? • Demo
Preparation • Logon the Linux machine in the Computer Lab, 132 Evans Hall • Create an empty directory in you home directory, say, “$HOME/simplescalar/” • Copy all three tar balls to that directory. • cd $HOME/simplescalar/ • tar xzvfsimplesim-3v0d.tgz • tar xzvf simpletools-2v0.tgz • tar xzvf simpleutils-2v0.tgz
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.
Build & Install Steps - 1 • Build GNU Binary Utilities • cd $HOME/simplescalar/binutil-2.5.2 • ./configure --host=i386-\*-gnu/linux --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$HOME/simplescalar • make • make install
Build & Install Steps - 2 • Build Simulators • cd $HOME/simplescalar/simplesim-3.0 • make config-pisa • make
Build & Install Steps - 3 Build the Compiler • cd $HOME/simplescalar/gcc-2.6.3 • ./configure --host=i386-\*-gnu/linux --target=sslittle-na-sstrix --with-gnu-as --with-gnu-ld --prefix=$HOME/simplescalar • make LANGUAGE=c • ../simplesim-3.0/sim-safe ./enquire -f >! float.h-cross • make install
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.
Check Your Installation • Check $HOME/simplescalar/bin for the complier, assembler, linker, and other binary utilities. • Write simple program to verify it • Check $HOME/simplescalar/simplesim-3.0 for simulators • cd $HOME/simplescalar/simplesim-3.0 • make sim-tests
Outline • Why this tutorial? • What is SimpleScalar Tool Set? • Where to get it? • How to install it? • How to use it? • Demo
How to Use it? • Write program • Write C code. • Or, just write assembly code (you will learn how to do it in the following lectures) • Compile the source code • sslittle-na-sstrix-gcc –o foo foo.c C code to binary code • sslittle-na-sstrix-gcc –o foo.s –S foo.c C code to Assemble code • sslittle-na-sstrix-gcc –o foo foo.s Assemble code to binary code • Use the simulator to run the binary code • sim-fast foo • …
Hints for Lab1 • Do Problem 2 first • Generate the assembly code from C code • Investigate the assembly code • Try 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
Outline • Why this tutorial? • What is SimpleScalar Tool Set? • Where to get it? • How to install it? • How to write program for it? • Demo