DOC PREVIEW
NYU CSCI-GA 2243 - SimpleScalar Familiarization Exercise

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Part I: Installing SimpleScalar 3.0c Part II: Using a SimpleScalar simulator Option NameArg TypeDefault ValueDescriptionPart III: Writing your own program to run through a SimpleScalar simulator Part IV: Writing your own simulatorG22.2233-001 Spring 2007 G22.2243: High Performance Computer Architecture SimpleScalar Familiarization Exercise Due date: February 14, 2007 This exercise is chiefly meant to help you install and familiarize yourself with the SimpleScalar 3.0c Toolset. Part I: Installing SimpleScalar 3.0c 1. Download the SimpleScalar simulator toolset by following the Course Materials tab on the course web page (http://www.cs.nyu.edu/courses/spring07/G22.2233-001). Install and build the simulator on either a SPARC/Solaris machine (one of the department Suns) or on any x86/Linux platform. See the README files for additional details. We will be working with the PISA instruction set throughout the course, so make sure that you configure the simulator for this before building the executables: make config-pisa 2. Test the simulator installation. make sim-tests As the README file says, this will take some time. If the installation has been done correctly, the output will show no differences. Part II: Using a SimpleScalar simulator 1. Simulators in SimpleScalar are named with “sim” as a prefix. If you peruse your simplesim-3.0 directory, you will see there are several simulators packaged with SimpleScalar including sim-safe, sim-fast, sim-eio, sim-outorder to name a few. This exercise will use the simplest simulator, sim-safe. 2. From your simplesim3.0 directory, execute sim-safe with no command-line arguments. Information about the usage, description of the simulator and default values for the command-line options will print to the screen. The name of the option and the type of values it takes appears as the first item on each line. The next items on the line are the option’s default values, and then a description of the option. Take note of the following options: Option Name Arg Type Default Value Description -redir:sim <string> <null> redirect simulator output to file -redir:prog <string> <null> redirect simulated program output to file -nice <int> 0 simulator scheduling priority -max:inst <uint> 0 maximum number of inst's to execute 3. Make a results subdirectory in your simplesim3.0 directory: mkdir results 1G22.2233-001 Spring 2007 4. Run sim-safe with command line arguments for redirecting simulator output and program output to the results directory. In this case, the benchmark we will be using is a test program called test-math. It is located in the following subdirectory: simplesim-3.0/tests/bin.big. The commandline is as follows: sim-safe –redir:sim results/sim1.out –redir:prog results/prog1.out tests/bin.big/test-math Note: On the x86/Linux install, you should use the little-endian version of this program (available in the tests/bin.little subdirectory). 5. Change directories to the results directory and examine sim1.out and prog1.out. In sim1.out, in the first part of the file, you should see the same information as when you ran sim-safe without any arguments. The lower half of the file contains various statistics that sim-safe collects. In particular, note sim_num_insn (total number of instructions executed) and sim_num_refs (number of loads and stores). It should read similar to the following: sim_num_insn 216084 # total number of instructions executed sim_num_refs 56936 # total number of loads and stores executed 6. Rerun sim-safe on test-math, but this time, also set the –max:inst option to 50000 instructions. Redirect simulator output to results/sim2.out and program output to results/prog2.out. When you examine sim2.out, you should see something similar to the following: sim_num_insn 50000 # total number of instructions executed sim_num_refs 15626 # total number of loads and stores executed Part III: Writing your own program to run through a SimpleScalar simulator 1. Write a c program that prints “Hello World!” (or any other small program of your choice). For the purposes of this exercise, it is assumed that the file is called hello.c. 2. Use SimpleScalar’s version of gcc (cross-compiler) to compile this program for the PISA instruction set. A copy of this version of gcc, called ssbig-na-sstrix-gcc (on the department SUNs) is located at: /home/mb/CompArch/bin To compile your program to allow its execution using sim-safe: /home/mb/CompArch/bin/ssbig-na-sstrix-gcc –o hello hello.c 3. Now you have a compiled version of your hello world program, which sim-safe can simulate. 4. Run sim-safe on hello, redirecting simulator output to results/hello.sim.out and program output to results/hello.prog.out: sim-safe –redir:sim results/hello.sim.out –redir:prog results/hello.prog.out hello 5. Examine hello.sim.out and hello.prog.out. If you chose to go with the program described in #1 above, you should see the string “Hello World!” printed out in the hello.prog.out file. 2G22.2233-001 Spring 2007 Part IV: Writing your own simulator 1. Copy the following file into your simulator directory (the path below refers to the department SUNs): /home/mb/CompArch/assign0.tar and unpack it using the command: tar xvf assign0.tar You should see a file sim-base.c, which is a baseline simulator that we will be extending as part of the assignments in this course. sim-base.c has been derived from sim-safe.c: all unnecessary code has been removed. One consequence of these changes however is that you can no longer start the simulator in the Dlite debugger tool, so you will have to rely on print statements or a source-level debugger like gdb for debugging your program this semester. sim-base is a functional simulator in that it just executes the instructions of a program against a simulated register set and memory. As part of the assignments in this course, you will extend this simulator to add (simulated) timing information to estimate how different architectural features impact program execution time. 2. Modify the Makefile in the simulator directory to include sim-base in the list of sources, objects, and targets. You should be able to just follow the pattern used for the other simulators (e.g., sim-safe). Build the sim-base executable (by typing ‘make’) and test that it works by using it to simulate one of the


View Full Document

NYU CSCI-GA 2243 - SimpleScalar Familiarization Exercise

Download SimpleScalar Familiarization Exercise
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view SimpleScalar Familiarization Exercise and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view SimpleScalar Familiarization Exercise 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?