Archer:Simics NFS

From Grid-Appliance Wiki

Jump to: navigation, search

Introduction

HOW-TO Author: Girish Venkatasubramanian, girish, Renato Figueiredo, renato
Overview: This document shows step-by-step how to run Simics on Archer using a pre-configured Simics checkpoint stored in an Archer NFS file server.

Background

This tutorial assumes you have gone through introductory Archer Express or Archer Global tutorials. You need to be connected to Archer Global in order to go through this tutorial.

  • First, follow the steps 1 and 2 from Archer Express hands-on tutorial.
  • Register for Archer and download and setup the archer appliance by following the Archer Global tutorial. Complete step 8 under "Connecting to Archer Global" to setup the Simics module in your appliance.
    • Once this step is successfully completed, the Simics documentation including user guides and reference manuals will be present in /opt/virtutech/simics-3.0.31/doc/

Running Simics

Simics is a full system simulator capable of booting and running full operating systems. In this tutorial, the checkpoint image you will access is stored in a read-only Archer NFS server appliance (with virtual IP address 5.1.1.250, and name C001001250). For your convenience, a checkpoint (refer to Simics User Guide) has been prepared which has:

  • Booted Xen 3.0.2
  • Two virtual machines ("domains" in the Xen terminology)
    • A dom0 (management domain) with domid 0 and virtual IP 10.10.0.12 and 768MB memory
    • A domU (user domain) with domid 2 virtual IP 10.10.0.14 and 256 MB memory
    • SSH with RSA keys (no need of passwords) set up between the two domains
  • Two workloads in each domain

Xen has been compiled including Simics specific hooks to identify Domain Switches, TLB Flushes and Page Faults. A python script to catch these hooks has also been provided.

The checkpoint and the script can be accessed by mounting the Archer NFS shared directory exported by C001001250 to a local mount point on your grid appliance, as follows:

cd /opt/virtutech/simics-3.0.31/
mkdir workspace
/opt/virtutech/simics-3.0.31/bin/workspace-setup /opt/virtutech/simics-3.0.31/workspace
cd workspace
cd targets/x86-440bx
ln -s ../../simics 
ln -s /mnt/ganfs/C001001250 local_mount

If the nfs exported local_mount directory has been mounted properly, you should see the following files inside local_mount:

ls local_mount
local_mount:
homework2

local_mount/homework2:
magic-hap-handler.py
xen-dom0-domu
xen-dom0-domu-disk0_image-0.craff
xen-dom0-domu-ram0_image-0.craff
xen-dom0-domu.raw
xen-dom0-domu-rom0_image-0.craff
xen-dom0-domu-rom1_image-0.craff
xen-dom0-domu-vga0_prom_image-0.craff


Start up the simulation (on the your local grid appliance). The steps below accomplish the following goals:

  • start Simics and load the checkpointed system image with the Xen hypervisor and two domains pre-booted and ready to run applications
  • load the Python script magic-hap-handler.py, which contains the hooks described above
  • force a keyboard entry to the console that starts the execution of the nbench benchmark
  • run the simulation for one million processor cycles (In this mode, Simics executes one instruction per cycle, so this is equivalent of running the simulation for 1M instructions)
  • quit the simulation
./simics -c local_mount/homework2/xen-dom0-domu
simics > run-python-file local_mount/homework2/magic-hap-handler.py
simics > con0.input "cd /root/nbench-byte-2.2.3; ./nbench -cCOM.DAT \n"
simics > continue 1_000_000
simics > quit

(for details about con0.input, refer to the gfx-console in the Simics Reference Manual)

The details of the context switches happening will be displayed in the simics console and will look something like

Switching from 0 to 32767 at 226982799362
Switching from 32767 to 0 at 226982802018
Switching from 0 to 2 at 226983022800
Switching from 2 to 0 at 226983049827
[cpu0] cs:0xff108c5e p:0x00108c5e  mov ebx,dword ptr [ecx]

By uncommenting different portions of the magic-hap-handler.py script, different events, like tlb flushes etc, can be tracked. The python script can also be modified so that these messages can be written to a file.

Personal tools