Steps to perform memory hierarchy simulation using Simics

Cache configuration files:

Simics is a full-system simulator used to run production binaries of the target hardware at high-performance speeds.

In simics terminology, host defines the computer on which you are running simics and target refers to the computer simulated by simics. Commands are submitted to the simulator using the .

Instructions to start simics:

Please note that each of the following commands are typed either on the host terminal or target terminal or on the simics command window. Where to type a particular command is indicated below.
  1. cd to the simics workspace directory
    <= on the host

  2. run ./ ; type password - comparch
    <= on the host

  3. ./simics-gui
    <= on the host
    <= to start simics

  4. supply the checkpoint image - linux-tango_booted to the simulator
    <= quick start

  5. type c (continue)
    <= on the simics command prompt
    <= to check if the target has started

  6. stop the simulator to get the control back to the simics command prompt

  7. hfs0.root dir = host-directory-path
    <= on the simics command prompt
    <= sets the host directory for mounting on target

  8. mount /host
    <= on the target

Instructions to gather cache statistics:

  1. istc-disable and dstc-disable
    <= on the simics command prompt
    <= to disable simics internal caching

  2. enable-magic-breakpoint
    <= on the simics command prompt
    <= to enable magic breakpoints

  3. run-command-file cache-l1-uni
    <= on the simics command prompt
    <= to configure the cache

    <= on the simics command prompt

  5. run the program with proper inputs
    <= on the target

  6. the program will stop when it encounters the magic instruction. Control will then get transfered to simics command prompt

  7. c 100_000_000
    <= on the simics command prompt
    <=to warm the cache

  8. cache.reset-statistics then c 1_000_000
    <= on the simics command prompt

  9. cache.statistics
    <= on the simics command prompt

  10. take a snapshot of the stats

Assignment 1
Finding the working set size of a program. This is done by executing the program several times on simics, each time with a different cache configuration. Programs currently available for experimentation are: partition and ESFF . You are also highly encouraged to use any of your own program. To be a good candidate for this experiment your program should continuously perform large number of memory accesses and should execute most of the time in user mode.

Assignment 2
Perform the following set of cache-related tests using simics. Analyze and explain the cache behavior:
  1. Configure cache-level2 and see how changing the parameters of level 1 cache changes the miss/hit rate of level-2 cache.
  2. Analyze how cache replacement policies affect cache performance.
  3. Analyze how write-back/write-through policy affect cache performance.
  4. Use cache-l1-split to study and compare the "locality of reference" property of a given program with respect to instruction and data.

Assignment 3 (open-ended)
Given a program use the profiling support in simics to find possible cache-unfriendly memory access patterns. Modify the code to fix the problem. Show the performance gain.


Last modified: 09 April 09