SimpleScalar Tutorial

Slides:



Advertisements
Similar presentations
ITK-Overview Insight Software Consortium. What is ITK Image Processing Segmentation Registration No Graphical User Interface (GUI) No Visualization.
Advertisements

Java Testing Tools. junit is a testing harness for unit testing. emma is a code coverage tool. The tools can be used in concert to provide statement and.
Installing the MATLAB Add-On
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
MySQL Installation Guide. MySQL Downloading MySQL Installer.
CS3350B Computer Architecture Winter 2015 Lecture 4
DHCP -Ameeta and Haripriya -cmsc 691x. DHCP ► Dynamic Host Configuration Protocol ► It controls vital networking parameters of hosts with the help of.
Cygwin Linux for Windows Desktop Paul Stuyvesant.
SimpleScalar CS401. A Computer Architecture Simulator Primer What is an architectural simulator? – Tool that reproduces the behavior of a computing device.
Introduction to Java Lab CS110A – Lab Section 004 Instructor: Duo Wei.
Tutorial 0 SimpleScalar Installation CPEG-323 Intro. To Computer Engineering Tom St. John September 19, 2008.
1 Introduction to Programming Environment Using MetroWerks CodeWarrior and Palm Emulator.
NDT Tools Tutorial: How-To setup your own NDT server Rich Carlson Summer 04 Joint Tech July 19, 2004.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Building a Cross Compiler, Assembler and Linker Designed by Prof. Peng-Sheng Chen.
F13 Forensic tool analysis Dr. John P. Abraham Professor UTPA.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
1 Intro to Linux - getting around HPC systems Himanshu Chhetri.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course provides an overview of the installation and.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
SimpleScalar Tool Set, Version 2 CSE 323 Department of Computer Engineering.
1 Introduction to SimpleScalar (Based on SimpleScalar Tutorial) CPSC 614 Texas A&M University.
CSC 215 : Procedural Programming with C C Compilers.
How to Install and Run Prepared by: Shubhra Kanti Karmaker Santu Lecturer CSE Department BUET.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Introduction to Linux ( I ) Sidney Fong 4 th Feb 2006.
Cygwin Tutorial 1. What is Cygwin? Cygwin offers a UNIX like environment on top of MS-Windows. Gives the ability to use familiar UNIX tools without losing.
Cygwin Linux for Windows Desktop Paul Stuyvesant.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
The FPX KCPSM Module Exercise 1 Henry Fu The FPX KCPSM Module Exercise: Network Data Encryption / Decryption Using ROT13 Algorithm Henry Fu Washington.
MIPS Project -- Simics Yang Diyi Outline Introduction to Simics Simics Installation – Linux – Windows Guide to Labs – General idea Score Policy.
Advanced BioPSE NCRR How to Install and Configure J. Davison de St. Germain Chief Software Engineer SCI Institute December 2003 J. Davison.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
PostgreSQL Installation By: Keerthi Nelaturu Previous version by Ahmed Jeddah & Miguel Garzon.
Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Cygwin Tutorial 1. What is Cygwin? Cygwin offers a UNIX like environment on top of MS-Windows. Gives the ability to use familiar UNIX tools without losing.
HW/SW Co-design Lecture 3: Lab 1 – Getting Started with the Tools Course material designed by Professor Yarsun Hsu, EE Dept, NTHU RA: Yi-Chiun Fang, EE.
ECE 544 Software Project 1 Kuo-Chun Huang (KC). Environment Linux (Ubuntu or others) Windows with Cygwin
Introduction to SimpleScalar Tool Set CPEG323 Tutorial Long Chen September, 2005.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
 CSC 215 : Procedural Programming with C C Compilers.
CACI Proprietary Information | Date 1 Upgrading to webMethods Product Suite Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8,
Developing Portable Applications ● Introduction GNU autotools – GNU toolchain ● Goals - cross-platform ● Supported platforms (POSIX compliant) ● GNU autotools.
Cygwin: getting the setup tool
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
Cygwin Tutorial 1.
CSC 215 : Procedural Programming with C
??? ple r B Amulya Sai EDM14b005 What is simple scalar?? Simple scalar is an open source computer architecture simulator developed by Todd.
Design Lab with SystemC
Introduction to SimpleScalar
Introduction to SimpleScalar (Based on SimpleScalar Tutorial)
Software Development with uMPS
Introduction to SimpleScalar (Based on SimpleScalar Tutorial)
Lecture 4: MIPS Instruction Set
Software Installation
Download and Installation of code::blocks
Cygwin.
Cygwin Tutorial 1.
Software Setup & Validation
Cygwin Tutorial 1.
Yung-Hsiang Lu Purdue University
Computer System Laboratory
Cygwin: getting the setup tool
Presentation transcript:

SimpleScalar Tutorial COMP4611 Tutorial 4 Oct 8,9, 2014

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Installing gcc cross-compiler & objdump for PISA Objdump demo Instruction count and CPI calculation

What is SimpleScalar A tool set for users to build modeling applications that simulate real programs running on a range of modern processors and systems SimpleScalar tool set includes a set of sample simulators to simulate different operations of processors (e.g. branch prediction) ( Recommended reading: “Overview” in http://www.simplescalar.com/ )

The SimpleScalar Suite sim-fast – fastest, least detailed functional simulator sim-safe – functional simulator with checks sim-outorder – most complicated and detailer simulator sim-cache – functional cache simulator sim-bpred – branch prediction simulator sim-profile – functional simulator that generates detailed profile information

Overview of the SimpleScalar Suite Figure from SimpleScalar version 2.0 tutorial presentation

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Instruction count and CPI calculation

Installing Cygwin What is Cygwin? A large collection of GNU and Open Source tools which provide functionality similar to the Linux distribution on Windows e.g. run gcc, make, wget, tar …etc on windows Does NOT run native Linux programs on Windows Users must rebuild their programs against Windows platform from source if they want to port them to Windows (Note later how the SimpleScalar is compiled against Windows through Cygwin and the executable is in .exe extension)

Installing Cygwin We will run SimpleScalar on Cygwin Go to http://cygwin.com/install.html to install Cygwin Download and Run the corresponding package: setup-x86.exe ( Even you are using 64-bit version of Windows ) Note: If you do not have a computer with Windows environment to install Cygwin: You can apply for an account on a virtual machine in Linux environment (network connection required during programming) for your group Please send a request email to Prof. Gu (lingu@ust.hk) With subject “COMP4611: Apply for an account on virtual machine” With names and UST email addresses of all group members

Installing Cygwin Run the package: Click next for the following window: Choose Install from Internet option and click “Next” button from following window

Installing Cygwin Enter the PATH for Cygwin software and click “Next” to continue

Installing Cygwin Choose your connection type, then “Next” Using ftp.iij.ad.jp(ftp) as a recommended mirror site, then “Next”

Installing Cygwin By default Cygwin installation will not contain some of the additional utilities which we need to use: E.g. gcc, make, wget, tar To install these extra utilities: for “Devel” click once to change it from default to install

Installing Cygwin Or another way to install the utilities: select Category (the default) package installation option search for the tool and click to change from “skip” to install it

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Instruction count and CPI calculation

Where to get SimpleScalar Go to http://www.simplescalar.com Go to Tools in the Downloads section to the left and download simplesim-3v0e.tgz. Download the package directly into Cygwin’s root directory (c:\cygwin) or your home directory (c:\cygwin\home\<user>\)

Installing SimpleScalar Open the Cygwin and go to the directory where the SimpleScalar is downloaded at Extract the SimpleScalar package: $ tar –xzvf simplesim-3v0e.tgz

Installing SimpleScalar for PISA binary Configure the installation target: $ cd simplesim-3.0/ $ make config-pisa This step will set up the files for building the PISA target. The other alternative is an Alpha target.

What is PISA and Alpha SimpleScalar can simulate programs in Alpha or PISA binary PISA (Portable ISA) instruction set is a simple MIPS-like instruction set. A GNU GCC-based cross-compiler and pre- built libraries are also available for this target. Alpha ISA is a 64-bit RISC ISA

Installing SimpleScalar Compile the source code of SimpleScalar: $ make

How to verify SimpleScalar works Verify if the installation is successful: $ make sim-tests

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Instruction count and CPI calculation

Structure of SimpleScalar Figure from SimpleScalar version 2.0 tutorial presentation Where to get SimpleScalar program binary?

SimpleScalar Usage Global options which are supported on all SimpleScalar simulators: -h print simulator help message -d enable debug message -i start up in Dlite! Debugger -q quit immediately (use with –dumpconfig) -config <file> read config parameters from <file> -dumpconfig <file> save config parameters to <file>

SimpleScalar Usage For example, running the test-math benchmark (in simplesim-3.0/tests/bin.little/test-math) : sim-safe $ ./sim-safe -v tests/bin.little/test-math $ ./sim-safe -redir:sim result.simout -redir:prog result.progout tests/bin.little/test-math (Hints: Read the Readme file!) -v  verbose operation: reporting the progress -redir:sim <file>  redirects simulator output to the file <file>, i.e. “result.simout” -redir:prog <file>  redirects simulated program output to the file <file>, i.e. “result.progout”

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Instruction count and CPI calculation

Exercise 1 How to install SimpleScalar for Alpha binary? $ make clean Clean the previous installation for PISA binary $ cd simplesim-3.0 $ make clean Configure the installation target: $ make config-alpha Compile the source code Verify the installation

Exercise 2 – Benchmark on SimpleScalar What is benchmark? A set of instructions for evaluation use Compose of different proportion of each type of instructions to simulate certain type of program

Exercise 2 – Benchmark on SimpleScalar Download some benchmark programs at http://www.eecs.umich.edu/~taustin/eecs573_public/instr uct-progs.tar.gz For example (in your home directory, e.g. /home/<user>/ ) $ wget http://www.eecs.umich.edu/~taustin/eecs573_public/instruct- progs.tar.gz Extract the benchmark package: $ tar –xzvf instruct-progs.tar.gz $ mv benchmarks simplesim-3.0/ $ cd simplesim-3.0 $ ls benchmarks/

Exercise 2 – Benchmark on SimpleScalar Run GCC Alpha binary on SimpleScalar $ cd benchmarks $ ../sim-safe cc1.alpha -O 1stmt.i Compare the simulation result: $ diff 1stmt.s 1stmt.s.ref simulator program Alpha binary Input file program that runs against the simulator

Exercise 2 – Benchmark on SimpleScalar Run GO Alpha binary on SimpleScalar $ cd benchmarks $ ../sim-safe go.alpha 50 9 2stone9.in > OUT Compare the simulation result: $ diff OUT go.out simulator program program that runs against the simulator Redirect output as OUT file

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Instruction count and CPI calculation

Install gcc cross-compiler and objdump for PISA In order to be able to compile programs to run on the simulator, you need a port of cross-compiler and libraries for Cygwin: Download gcc cross-compiler and objdump for PISA to your root directory (i.e. C:\cgywin) at http://www.eecg.toronto.edu/~moshovos/ACA07/files/ss- gcc.usrlocal.tar.bz Installation steps: $ cd / $ tar –xvf ss-gcc.usrlocal.tar.bz $ cd usr/local/bin $ ls ss-gcc ss-objdump

Introduction to PISA objdump A tool for disassembling PISA binary code into PISA assembly code Manual of objdump available at http://sourceware.org/binutils/docs/binutils/objdump.html

PISA objdump Demo int main() A simple C program – hello.c { int i, a; a = 2; for (i = 0; i < 1000; i++) a++; } Compile hello.c into PISA binary code – hello $ ss-gcc -o hello hello.c Disassemble hello into PISA assembly code – hello.asm $ ss-objdump -d hello > hello.asm $ less hello.asm

PISA assembly of main() 004001f0 <main> addiu/00 $sp[29],$sp[29],-32 004001f8 <main+8> sw/00 $ra[31],28($sp[29]) 00400200 <main+10> sw/00 $s8[30],24($sp[29]) 00400208 <main+18> addu/00 $s8[30],$zero[0],$sp[29] 00400210 <main+20> jal/00 00400468 <__main> 00400218 <main+28> addiu/00 $v0[2],$zero[0],2 00400220 <main+30> sw/00 $v0[2],20($s8[30]) 00400228 <main+38> sw/00 $zero[0],16($s8[30]) 00400230 <main+40> lw/00 $v0[2],16($s8[30]) 00400238 <main+48> slti/00 $v1[3],$v0[2],1000 00400240 <main+50> bne/00 $v1[3],$zero[0],00400250 <main+60> 00400248 <main+58> j/00 00400298 <main+a8> 00400250 <main+60> lw/00 $v1[3],20($s8[30])

PISA assembly of main() 00400258 <main+68> addiu/00 $v0[2],$v1[3],1 00400260 <main+70> addu/00 $v1[3],$zero[0],$v0[2] 00400268 <main+78> sw/00 $v1[3],20($s8[30]) 00400270 <main+80> lw/00 $v1[3],16($s8[30]) 00400278 <main+88> addiu/00 $v0[2],$v1[3],1 00400280 <main+90> addu/00 $v1[3],$zero[0],$v0[2] 00400288 <main+98> sw/00 $v1[3],16($s8[30]) 00400290 <main+a0> j/00 00400230 <main+40> 00400298 <main+a8> addu/00 $sp[29],$zero[0],$s8[30] 004002a0 <main+b0> lw/00 $ra[31],28($sp[29]) 004002a8 <main+b8> lw/00 $s8[30],24($sp[29]) 004002b0 <main+c0> addiu/00 $sp[29],$sp[29],32 004002b8 <main+c8> jr/00 $ra[31]

hello on SimpleScalar $ cp hello ~/simplesim-3.0 $ cd ~/simplesim-3.0 Simulate hello binary on SimpleScalar $ cp hello ~/simplesim-3.0 $ cd ~/simplesim-3.0 $ ./sim-safe –v hello &> hello.ss $ less hello.ss $ cat hello.ss | grep ‘bne’ | wc $ cat hello.ss | grep ‘ j ’ | wc

Outline Introduction to SimpleScalar SimpleScalar Installation and Usage Installing Cygwin Installing SimpleScalar for PISA SimpleScalar Usage Exercises Installing SimpleScalar for Alpha Benchmark on SimpleScalar PISA gcc and objdump Instruction count and CPI calculation

Instruction Statistics Static instruction statistics is the statistics about the program’s binary code (i.e. how many instructions are there in the program) Dynamic instruction statistics is the statistics of the dynamic instruction flow fetched and executed by the processor About hello What is the static instruction count in main() of hello? What is one instruction that is executed most frequently by processors in main() of hello?

Calculate CPI of hello For a given program, CPI = total program execution cycles / instruction count Is instruction count equal to static or dynamic instruction count? How to get instruction count? How to get total program execution cycles? (Hint : try different SimpleScalar simulators. What simulators do we have beside sim-safe ?)

References SimpleScalar LLC: www.simplescalar.com Setting up Cygwin: cygwin.com/cygwin-ug-net/setup-net.html Introduction to SimpleScalar: www.ecs.umass.edu/ece/koren/architecture/Simplescalar/SimpleScalar_intro duction.htm GCC port for SimpleScalar: www.eecg.toronto.edu/~moshovos/ACA07 GNU objdump: sourceware.org/binutils/docs/binutils/objdump.html