SimpleScalar 설치 및 사용법 순천향대학교 정보기술공학부 이상정.

Slides:



Advertisements
Similar presentations
ECE ECE1773 Spring ‘02 © A. Moshovos (Toronto) Simplescalar’s out-of-order simulator (v3) ECE1773 Andreas Moshovos Visit for additional.
Advertisements

1 SS and Pipelining: The Sequel Data Forwarding Caches Branch Prediction Michele Co, September 24, 2001.
SimpleScalar Tutorial
SimpleScalar v3.0 Tutorial U. of Wisconsin, CS752, Fall 2004 Andrey Litvin (main source: Austin & Burger) (also Dana Vantrease’ slides)
5Z032 Processor Design SPIM, a MIPS simulator Henk Corporaal
Apr. 12, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 6: Branching and Procedures in MIPS* Jeremy R. Johnson Wed. Apr. 12, 2000.
Procedure call frame: Hold values passed to a procedure as arguments
ECE 0142 Recitation #5.
 Procedures (subroutines) allow the programmer to structure programs making them : › easier to understand and debug and › allowing code to be reused.
SimpleScalar CS401. A Computer Architecture Simulator Primer What is an architectural simulator? – Tool that reproduces the behavior of a computing device.
ECE200 – Computer Organization Chapter 2 - The Role of Performance.
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
20/06/2015CSE1303 Part B lecture notes 1 Functions, part 2 Lecture B15 Lecture notes, section B15.
Interrupt Processing Haibo Wang ECE Department
Chapter 4 H1 Assembly Language: Part 2. Direct instruction Contains the absolute address of the memory location it accesses. ld instruction:
Introduction to SimpleScalar (Based on SimpleScalar Tutorial)
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
Tutorial 0 SimpleScalar Installation CPEG-323 Intro. To Computer Engineering Tom St. John September 19, 2008.
Gdb is the GNU debugger on our CS machines. gdb is most effective when it is debugging a program that has debugging symbols linked in to it. With gcc and.
Introduction to SimpleScalar (Based on SimpleScalar Tutorial) TA: Kyung Hoon Kim CSCE614 Texas A&M University.
Compiled from SimpleScalar Tutorial
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.
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
Topic 2d High-Level languages and Systems Software
OCC - CS/CIS CS116-Ch00-Orientation Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 1CS 116 Fall 2003 Not quite finished Creating.
6.S078 - Computer Architecture: A Constructive Approach Introduction to SMIPS Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,
MicroComputer Engineering IntroLab1 page 1 Introduction Lab1  A crash course in assembler programming  Learn how a processor works!  Decode a coded.
Introduction to SimpleScalar (Based on SimpleScalar Tutorial) CSCE614 Hyunjun Jang Texas A&M University.
Power Profiling using Sim-Panalyzer Andria Dyess and Trey Brakefield CPE631 Spring 2005.
Intro to SPIM Justin Fiore Nathan Parish. Installing SPIM on Windows Download pcspim.zip from the SPIM website:
1 A Superscalar Pipeline [Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005 and Instruction Issue Logic, IEEETC, 39:3, Sohi,
Report1 Sim-profile 을 이용한 LI 벤치마크 과목명 : 컴퓨터 구조 특론 교수님 : 이상정 교수님 팀 원 : 강명숙, 박장수.
Superscalar Architecture Design Framework for DSP Operations Rehan Ahmed.
1 SimpleScalar3.0: Selected Topics aka Hopefully enough to get you started Michele Co September 10, 2001 Department of Computer Science University of Virginia.
MIPS Subroutines Subroutine Call – jal subname Saves RA in $31 and jumps to subroutine entry label subname Subroutine Return – jr $31 Loads PC with return.
1 간단한 C 프로그램 김희자, 최정욱. 2 목차 예제 소스 코드 컴파일 어셈블리 언어 Dlite 디버거 수행.
Sim-outorder 사용법 Brnach Prediction 순천향대학교 정보기술공학부 이상정.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
Internals of SimpleScalar Simulators CPEG323 Tutorial Long Chen November, 2005.
Introduction to SimpleScalar Tool Set CPEG323 Tutorial Long Chen September, 2005.
Simple Scalar 설치 및 사용법 일반대학원 전산학과 강서일 (2003 ) 손재락 ( )
??? ple r B Amulya Sai EDM14b005 What is simple scalar?? Simple scalar is an open source computer architecture simulator developed by Todd.
Spec2000 Optimization Level Result Report 순천향대학교.
CSCI206 - Computer Organization & Programming
Static and dynamic analysis of binaries
MIPS Assembly Language Programming
Prof. Hsien-Hsin Sean Lee
순천향대학교 전산학과 SimpleScalar 예제 프로그램 순천향대학교 전산학과
Debugging with gdb gdb is the GNU debugger on our CS machines.
Introduction to SimpleScalar
Introduction to SimpleScalar (Based on SimpleScalar Tutorial)
gdb gdb is the GNU debugger on our CS machines.
Topic 2e High-Level languages and Systems Software
Introduction to SimpleScalar (Based on SimpleScalar Tutorial)
Computer Architecture “Bomb Lab Hints”
CSCI206 - Computer Organization & Programming
Instructions - Type and Format
MIPS Instructions.
The University of Adelaide, School of Computer Science
Virtual Memory CSCI 380: Operating Systems Lecture #7 -- Review and Lab Suggestions William Killian.
Computer Organization and Design Assembly & Compilation
Lecture 20: OOO, Memory Hierarchy
CS334: Memory _ Mars simulator Lab 4(part2-2)
CSCI 380: Operating Systems William Killian
Computer Architecture
Caches & Memory.
MIPS R3000 Subroutine Calls and Stack
Presentation transcript:

SimpleScalar 설치 및 사용법 순천향대학교 정보기술공학부 이상정

SimpleScalar 설치 설치 내용 simulator 3.0 : 시뮬레이터 gcc-2.6.3 : C 컴파일러 gnu binutils-2.5.2 : GNU utilities 순천향대학교 정보기술공학부 이 상 정 2

simulator 3.0 설치 cd /edu gzip -d simplesim3.0b.tar.gz tar -xvf simplesim3.0b.tar make config-pisa pisa => Portable ISA make cd /edu/simplesim-3.0 ./sim-safe 순천향대학교 정보기술공학부 이 상 정 3

gnu binutils-2.5.2 설치 cd /edu tar -zxvf simpleutils.tar.gz cd binutils-2.5.2 ./configure -host=i386-*-gnu/linux -target=sslittle-na-sstrix -with-gnu-as -with-gnu-ld -prefix=/edu make make install 순천향대학교 정보기술공학부 이 상 정 4

gcc-2.6.3 설치 cd /edu tar -zxvf simpletools.tar,gz cd gcc-2.6.3 ./configure -host=i586-*-gnu/linux -target=sslittle-na-sstrix -with-gnu-as -with-gnu-ld -prefix=/edu make install => error cd /edu/gcc-2.6.3/bin ./sslittle-na-sstrix-gcc -o test.ss test.c ./sslittle-na-sstrix-gcc -S test.c => test.s /edu/simplesim-3.0/sim-safe test.ss 순천향대학교 정보기술공학부 이 상 정 5

gcc-2.6.3 설치 에러내용 예 gcc-2.6.3/cccp.c: line 191 : declaration of sys_errlist not correct -> #if changed to: #if …. || defined (__linux__) gcc-2.6.3/sdbout.c: line 58 : no syms.h -> use gsysms.h gcc-2.6.3/gcc.c : line 172 : sys_errlist : conflicting types, cft. cccp.c -> #if changed to: #if … || defined (__linux__) gcc-2.6.3/cp/g++.c line 88: sys_errlist, I -> #if changed to: #if …. || defined (__linux__) 순천향대학교 정보기술공학부 이 상 정 6

예제 프로그램 test.c #include <stdio.h> int a=3, b; main() { int x,y; x = a; y = 4; b = x + y; printf("%d\n", b); } 순천향대학교 정보기술공학부 이 상 정 7

컴파일 예 ./sslittle-na-sstrix-gcc -o test.ss test.c ./sslittle-na-sstrix-gcc -S test.c test.s .file "test.c" gcc2_compiled.: __gnu_compiled_c: .globl a .sdata .align 2 # 22 = 4 a: # a = 3 .word 3 .align 2 순천향대학교 정보기술공학부 이 상 정 8

컴파일 예 $LC0: .ascii "%d\n\000" .text .align 2 .globl main .comm b,4 # b .loc 1 4 .ent main main: .frame $fp,32,$31 # frame register(r30),frame size,return register .mask 0xc0000000,-4 # bitmask for register save .fmask 0x00000000,0 # bitmask for fp register save 순천향대학교 정보기술공학부 이 상 정 9

컴파일 예 subu $sp,$sp,32 # $sp(r29), stack push for next frame sw $31,28($sp) # save return register sw $fp,24($sp) # save frame register move $fp,$sp # set current frame register jal __main lw $2,a # x = a; sw $2,16($fp) li $2,0x00000004 # y = 4 sw $2,20($fp) lw $2,16($fp) # b = x + y lw $3,20($fp) addu $2,$2,$3 sw $2,b la $4,$LC0 # printf(“%d\n”,b); lw $5,b jal printf 순천향대학교 정보기술공학부 이 상 정 10

컴파일 예 Gas 매뉴얼 http://www.gnu.org/manual/gas-2.9.1/as.html $L1: move $sp,$fp lw $31,28($sp) # restore return address lw $fp,24($sp) # restore frame register addu $sp,$sp,32 # stack pop j $31 # return .end main Gas 매뉴얼 http://www.gnu.org/manual/gas-2.9.1/as.html 순천향대학교 정보기술공학부 이 상 정 11

sim-safe 수행 예 /edu/simplesim-3.0/sim-safe test.ss sim-safe: SimpleScalar/PISA Tool Set version 3.0 of November, 2000. Copyright (c) 1994-2000 by Todd M. Austin. All Rights Reserved. ………………. # -config # load configuration from a file # -dumpconfig # dump configuration to a file # -h false # print help message # -v false # verbose operation # -d false # enable debug message # -i false # start in Dlite debugger -seed 1 # random number generator seed (0 for timer seed) # -q false # initialize and terminate immediately # -chkpt <null> # restore EIO trace execution from <fname> # -redir:sim <null> # redirect simulator output to file (non-interactive only) # -redir:prog <null> # redirect simulated program output to file -nice 0 # simulator scheduling priority -max:inst 0 # maximum number of inst's to execute sim: ** starting functional simulation ** 7 순천향대학교 정보기술공학부 이 상 정 12

sim-safe 수행 예 sim: ** simulation statistics ** sim_num_insn 6827 # total number of instructions executed sim_num_refs 3871 # total number of loads and stores executed sim_elapsed_time 1 # total simulation time in seconds sim_inst_rate 6827.0000 # simulation speed (in insts/sec) ld_text_base 0x00400000 # program text (code) segment base ld_text_size 70176 # program text (code) size in bytes ld_data_base 0x10000000 # program initialized data segment base ld_data_size 8192 # program init'ed `.data' and uninit'ed `.bss' size in bytes ld_stack_base 0x7fffc000 # program stack segment base (highest address in stack) ld_stack_size 16384 # program initial stack size ld_prog_entry 0x00400140 # program entry point (initial PC) ld_environ_base 0x7fff8000 # program environment base address address ld_target_big_endian 0 # target executable endian-ness, non-zero if big endian mem.page_count 26 # total number of pages allocated mem.page_mem 104k # total size of memory pages allocated mem.ptab_misses 26 # total first level page table misses mem.ptab_accesses 469920 # total page table accesses mem.ptab_miss_rate 0.0001 # first level page table miss rate 순천향대학교 정보기술공학부 이 상 정 13

sim-outorder 수행 예 /edu/simplesim-3.0/sim-outorder test.ss sim-outorder: SimpleScalar/PISA Tool Set version 3.0 of November, 2000. ………. # -ptrace <null> # generate pipetrace, i.e., <fname|stdout|stderr> <range> -fetch:ifqsize 4 # instruction fetch queue size (in insts) ………… -bpred bimod # branch predictor type {nottaken|taken|perfect|bimod|2lev|comb} -bpred:bimod 2048 # bimodal predictor config (<table size>) ………………. -decode:width 4 # instruction decode B/W (insts/cycle) -issue:width 4 # instruction issue B/W (insts/cycle) ……….. -ruu:size 16 # register update unit (RUU) size -lsq:size 8 # load/store queue (LSQ) size -cache:dl1 dl1:128:32:4:l # l1 data cache config, i.e., {<config>|none} -cache:dl1lat 1 # l1 data cache hit latency (in cycles) ……………….. sim: ** starting performance simulation ** 7 순천향대학교 정보기술공학부 이 상 정 14

sim-outorder 수행 예 sim: ** simulation statistics ** sim_num_insn 6827 # total number of instructions committed sim_num_refs 3871 # total number of loads and stores committed ………………… sim_total_insn 7574 # total number of instructions executed sim_total_refs 4032 # total number of loads and stores executed …………………. sim_cycle 13659 # total simulation time in cycles sim_IPC 0.4998 # instructions per cycle sim_CPI 2.0007 # cycles per instruction …………. bpred_bimod.bpred_dir_rate 0.8403 # branch direction-prediction rate (i.e., all-hits/updates) ………….. il1.miss_rate 0.0680 # miss rate (i.e., misses/ref) ………. dl1.miss_rate 0.1111 # miss rate (i.e., misses/ref) ……………….. ul2.miss_rate 0.5077 # miss rate (i.e., misses/ref) ld_text_base 0x00400000 # program text (code) segment base …………………….. 순천향대학교 정보기술공학부 이 상 정 15

Dlite! 디버거 사용 예 $ /edu/simplesim-3.0/sim-safe -i test.ss sim: ** starting functional simulation ** …….. [ 0] 0x00400140: lw r16,0(r29) DLite! > dis main 0x004001f0: addiu r29,r29,-32 # stack push 0x004001f8: sw r31,28(r29) # return register save 0x00400200: sw r30,24(r29) # frame register save 0x00400208: addu r30,r0,r29 # $fp = $sp 0x00400210: jal 0x400448 # jal __main 0x00400218: lw r2,-32768(r28) # x = a; 0x00400220: sw r2,16(r30) 0x00400228: addiu r2,r0,4 # y = 4; 0x00400230: sw r2,20(r30) 0x00400238: lw r2,16(r30) # b = x + y; 0x00400240: lw r3,20(r30) 순천향대학교 정보기술공학부 이 상 정 16

Dlite! 디버거 사용 예 0x00400248: addu r2,r2,r3 0x00400250: sw r2,-32416(r28) 0x00400258: addiu r4,r28,-32764 # printf() 0x00400260: lw r5,-32416(r28) 0x00400268: jal 0x400670 DLite! > break 0x400218 breakpoint #1 set @ @0x00400218:@0x00400219, class: exec DLite! > cont Stopping at code breakpoint #1 @ 0x00400218... [ 181] 0x00400218: lw r2,-32768(r28) DLite! > iregs PC: 0x00400490 NPC: 0x00400218 HI: 0x00000000 LO: 0x00000000 FCC: 0x00000000 순천향대학교 정보기술공학부 이 상 정 17

Dlite! 디버거 사용 예 $r0: 0/0x00000000 $r1: 0/0x00000000 $r4: 268440008/0x100011c8 $r5: 2147450884/0x7fff8004 ………… DLite! > step [ 182] 0x00400220: sw r2,16(r30) DLite! > iregs $r2: 3/0x00000003 $r3: 2/0x00000002 ……………… DLite! > break 0x400248 breakpoint #2 set @ @0x00400248:@0x00400249, class: exec 순천향대학교 정보기술공학부 이 상 정 18

Dlite! 디버거 사용 예 DLite! > cont Stopping at code breakpoint #3 @ 0x00400248... [ 187] 0x00400248: addu r2,r2,r3 DLite! > step [ 188] 0x00400250: sw r2,-32416(r28) DLite! > iregs PC: 0x00400248 NPC: 0x00400250 HI: 0x00000000 LO: 0x00000000 FCC: 0x00000000 $r0: 0/0x00000000 $r1: 0/0x00000000 $r2: 7/0x00000007 $r3: 4/0x00000004 $r4: 268440008/0x100011c8 $r5: 2147450884/0x7fff8004 $r6: 2147450892/0x7fff800c $r7: 268440000/0x100011c0 순천향대학교 정보기술공학부 이 상 정 19

Dlite! 디버거 사용 예 …………… $r28: 268473664/0x10009540 $r29: 2147450824/0x7fff7fc8 ……………. DLite! > step [ 189] 0x00400258: addiu r4,r28,-32764 DLite! > dump $r28-32416 0x100016a0: 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................] 0x100016b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................] 0x100016c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................] 0x100016d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................] DLite! > cont 7 순천향대학교 정보기술공학부 이 상 정 20

Dlite! 디버거 사용 예 sim: ** simulation statistics ** sim_num_insn 7300 # total number of instructions executed sim_num_refs 4060 # total number of loads and stores executed sim_elapsed_time 329 # total simulation time in seconds sim_inst_rate 22.1884 # simulation speed (in insts/sec) $ 순천향대학교 정보기술공학부 이 상 정 21

과제 간단한 테스트 C 프로그램을 작성하여 컴파일하여 어셈블리 언어를 생성하고 Dlite! 디버거를 사용하여 실행하여라. 발표자료 파워포인트 작성 제출 순천향대학교 정보기술공학부 이 상 정 22