EEL6892 Spring 11 HW 2: Understanding Simics

From Grid-Appliance Wiki

Jump to: navigation, search

Contents

Introduction

The objective of this assignment is to integrate you with the core utilities of this class: Grid Appliance and Simics. Expect this project to take 10 hours of your time and 20 hours of your computers time, thus do NOT procrastinate! By the end of this assignment you should be comfortable with the following:

  • Interacting with the Grid Appliance in order to run software locally
  • Interacting disk images
  • Booting a Simics system
  • Creating Simics checkpoints
  • Using Simics to profile caches

The questions following the assignment will verify that you have ascertained this knowledge.

I want to emphasize that because this is an upper level graduate course, you are expected to be independent and creative. The directions given over time will be less and less verbose. Your submissions are to be thoughtful and concise.

Reading

Part 1 - Accessing the Grid Appliance

  • At a minimum, go through Archer Global, if not Archer Express as well.
  • For Archer Global, you will join the “EEL6892-SP11” group
  • Make sure to download Archer version of the Grid Appliance
  • To verify everything works, type “condor_status” at a prompt, you should be connect to a system of well over 100 machines.
  • Notes: the memory allocated to the Grid Appliance should be on the order of 2 GB and a minimum of 1 GB

Part 2 - Preparing an Image

  • This assumes you have successfully completed phase 1 and are currently using the Grid Appliance
  • Create a Simics workspace, note: Simics is already installed in /opt/virtutech/simics3
  • Download the image and configuration file that will be used in this class (hint: wget)
  • Extract the contents of the file into your workspace
  • change the root into the disk image:
    • mkdir mnt
    • You must be root to mount a disk, so type sudo bash
    • mount -oloop,offset=1048576 ubuntu-xen.img mnt
    • mount -tproc none mnt/proc
    • mount --bind /dev/ mnt/dev
    • chroot mnt
  • Your system will now be rooted into the disk image
  • Download and extract the contents of packages for SPEC CPU's swim and gcc into /root
  • Hint: This image does not have unzip. You will need to install unzip through apt-get or aptitude. Use the man pages to figure out how to do it.
  • See questions 1
  • End the chroot
    • exit
    • umount mnt/dev
    • umount mnt/proc
    • umount mnt
    • exit (this will exit the sudo)

Part 3 - Simulating with Simics

  • This assumes you have successfully completed phases 1 and 2 and are currently inside the workspace created in phase 2
  • Start simics: ./simics ubuntu-xen.simics
  • I recommend that you select the Ubuntu, non-Xen, kernel for this assignment, but you are free to choose either the 1st or 2nd entree from within grub. Grub will pause until you select one and press enter.
  • Prepare to run the benchmarks
    • Login to Simics: ubuntu / password
    • Access root via sudo bash
    • cd /root
    • See question 3
  • Create checkpoints (see the simics user manual)
    • You should have one checkpoint for each benchmark
    • You should start the benchmark from the Simics console using:
      • con0.input "./runme.sh\n"
      • c 2_000_000_000 # Note: this is chosen to ensure that actual program code is executing and not binary startup code
      • Then create your checkpoint
  • Prepare for cache simulation by adding this file to your workspace: gcache.simics
  • To run simics with gcache enabled use: ./simics "name_of_checkpoint" -x gcache.simics -stall

Part 4 - Questions

  1. Run the benchmarks (via ./runme.sh) inside the chrooted environment and answer the following questions:
    1. How long did they take to run?
    2. How did you measure how long it took to run?
  2. This problem deals with the use of chroot:
    1. What is chroot?
    2. What would be the difference if we had executed all the commands without using chroot first?
    3. What was the purpose of the mount offset?
    4. Why do we mount the proc and dev directories inside the chroot?
  3. Repeat question 1 running the benchmark GCC inside of Simics. Swim takes an extraordinarly long time instead of running it, describe why it runs so much slower in Simics.
  4. What is a Simics checkpoint?
  5. What are swim and gcc (hint spec cpu)?
  6. What is the purpose of the "-stall" when doing cache simulations?
  7. During checkpoint creation:
    1. What is con0?
    2. What does this do: c 2_000_000_000?
  8. Inside gcache.simics:
    1. What is the default size of the cache in KB?
    2. How would we obtain an 8 KB cache by only modifying the number of cache lines?
  9. Run gcc and swim using a gcache of 16 KB, 256 KB, and 1 MB. Specify which parameters you used to obtain the cache size and the associativity. Plot the results for both instruction fetch, data write, and data read. Describe the behavior.
  10. Describe in one or two paragraphs the difference between Simics, whole-system emulator, and a virtual machine.

Hints / Tips

  • You are expected to use the Internet to help you answer some of these questions. (Hint: google)
  • Running simulations inside of Simics can be slow, be patient, consider switching the system to disable-real-time-mode
    • ctrl-c inside of the simics control window
    • disable-real-time-mode
    • c
  • Plan to do other things while Simics is running. Write a bash script to execute everything and then come back later to see it has completed.
  • You can ssh into your Grid Appliance using the IP published in the console, when you boot.
  • You can use the Grid Appliance in VirtualBox, but the tutorial is outdated.
Personal tools