190 likes | 416 Views
SimpleScalar. CS401. A Computer Architecture Simulator Primer . What is an architectural simulator? – Tool that reproduces the behavior of a computing device. Simulation Suite Overview. Global Simulator Options (cont.). • Supported on all simulators
E N D
SimpleScalar CS401
A Computer Architecture Simulator Primer • What is an architectural simulator? • – Tool that reproduces the behavior of a computing device
Global Simulator Options (cont.) • • Supported on all simulators • -h - print simulator help message • -d - enable debug message • -i - start up in DLite! debugger • -q - quit immediately • -config <file> - read config parameters from <file> • -dumpconfig <file> - save config parameters into <file>
Global Simulator Options • • Configuration files • – To generate a configuration file • • Specify non-default options on command line • • And, include “-dumpconfig <file>” to generate • configuration file • – Comments allowed in configuration files, all after • “#” ignored • – Reload configuration files using “-config <file>”
sim-cheetah …(cont.) • -R <string> • # replacement policy, i.e., lru or opt • -C <string> • # cache configuration, i.e., fa, sa, or dm • -a <int> # min number of sets (log base 2, line size for DM) • -b <int> # max number of sets (log base 2, line size for DM) • -l <int> # line size of the caches (log base 2) • -n <int> # max degree of associativity to analyze (log base 2)
sim-cheetah (example) • Configurations: • least-recently-used (LRU) replacement policy • 128 to 2048 sets • 1-way to 4-way associativity • 16-byte cache lines • Configuration file: • -R lru # replacement policy is lru. • -a 7 # min number of sets (log 128) • -b 11 # max number of sets (log 2048) • -l 4 # line size of the caches (log 16) • -n 2 # max degree of associativity to analyze (log 4)
sim-cache …(cont.) • -cache:dl1 <string> • # l1 data cache config, i.e., {<config>|none} • -cache:dl2 <string> • # l2 data cache config, i.e., {<config>|none} • -cache:il1 <string> • # l1 inst cache config, i.e., {<config>|dl1|dl2|none} • -cache:il2 <string> • # l2 instruction cache config, i.e., {<config>|dl2|none} • -tlb:itlb <string> • # instruction TLB config, i.e., {<config>|none} • -tlb:dtlb <string> • # data TLB config, i.e., {<config>|none}
sim-bpred • -bpred <string> • # branch predictor type {nottaken|taken|bimod|2lev|comb} • -bpred:bimod <int> • # bimodal predictor config (<table size>) • -bpred:2lev <int list...> • # 2-level predictor config (<l1size> <l2size> <hist_size> <xor>) • -bpred:comb <int> • # combining predictor config (<meta_table_size>) • * Predictor `comb' combines a bimodal and a 2-level predictor. • -bpred:ras <int> • # return address stack size (0 for no return stack)
Running SimpleScalar Tools …(cont.) • The tool set takes binaries compiled for the SimpleScalar architecture and simulates their execution on one of several provided processor simulators. • sets of precompiled binaries (including SPEC95) • a modified version of GNU GCC (with associated utilities) that allows you to compile your own SimpleScalar test binaries from FORTRAN or C code.
Running SimpleScalar Tools (The SPEC95 Benchmark Binaries) • The Standard Performance Evaluation Corporation (SPEC) provides (for a fee) a set of benchmarks that are used to evaluate processors. • You can find information about these benchmarks on the Web at • http://www.spec.org/osg/cpu95/.
Running SimpleScalar Tools(compile your own test binaries ) • Compiling a C program, e.g. • ssbig-na-sstrix-gcc -g -O -o foo foo.c –lm • Compiling a Fortran program, e.g. • ssbig-na-sstrix-f77 -g -O -o foo foo.f -lm
Running SimpleScalar Tools …(cont.) • • Running a program ./sim-cheetah -config <file> <executable file for SimpleScalar> <parameters> • • Example ./sim-cheetah -config test go.ss 2 8 go.in
Running SimpleScalar Tools • • Example ./sim-cheetah -config <arguments> go.ss 2 8 go.in • • Where • <arguments> : the list of sim-cheetah parameters needed to • produce results for the specified cache configurations. • go.ss : the SimpleScalar binary for the "go" benchmark. • "2 8“ : the play quality and the board size for the go simulation. • "go.in" : a file that specifies the starting board position • (in this case an empty file.)
More Information • http://www.simplescalar.com • For more information about simplescalar, you can download userguide and hackguide for it.