EEL6892 Fall 09 HW 2: Instructions for getting started with Archer and running Simics
From Grid-Appliance Wiki
Contents |
Introduction
HOW-TO Author: Girish Venkatasubramanian, girish, Renato Figueiredo, renato
Overview: This document provides instructions for the students of EEL 6892 (Fall 2008) for the class project.
Pre-Requisites to using Simics on Archer
- This writeup assumes that the user has signed up for an account on Simics Website. to access the very helpful message boards on the Simics website. Accounts can be obtained by applying at this link https://www.simics.net/register/register.php. It is not necessary to apply for a Personal Academic License as the Simics on Archer infrastructure will be used for the project.
- This writeup also assumes that EEL6892 Fall 09 HW 1: Instructions for getting familiar with the Xen image has been completed.
- Three types of consoles are referred to in this document
- console means the normal shell
- Simics console means the shell in which simics is running, i.e. the shell with the simics command prompt
- Simulated console means the console of the simulated machine. Note that this is visible only for simulations running on the local grid appliance (not for remote jobs) and only if the -no-win option is not specified
- In this manual, all commands which are preceded by "simics >" have to be typed at the Simics command prompt i.e. in the Simics Console.
Setup
Please go through the following tutorial that guides you through the execution of Simics on your Archer Appliance:
Questions
- Describe in one or two paragraphs what is the difference between Simics and a whole-system emulator.
- Describe briefly the difference between the Xen hypervisor and a Classic VM.
- What was the virtual IP address obtained for your Archer Global appliance?
- Run the Simics simulation for 20 million cycles. How many domain switches have you observed? How many cycles are executed in domain zero versus in the idle domain?
- Stop the simulation, exit Simics. Copy the python script to /opt/virtutech/simics-3.0.31/workspace/targets/x86-440bx/ and rename it as magic-hap-handler-modified.py. Edit this script to enable logging of TLB flushes and page fault events. Restart Simics and run the simulation for 20 million cycles. How many TLB flushes have you observed? Are they correlated with domain switches? Explain.
- Stop the simulation and exit Simics. Now you will run the nbench benchmark in both Xen domain 0 (dom0) and domain 2 (domU). To do this, you will need to change the con0.input sequence to start nbench in the background in dom0, and to ssh into domU (10.10.0.14) to run nbench there (as shown in the next section). Repeat the previous step, and analyze the results you obtained when two domains are active.
Helpful Tips
These tips show how to use some often used Simics commands. More information about these commands is in the Simics manual and the Simics message boards/discussion forums.
- When running for a large number of cycles, it is a good idea to write the messages to a file rather than the Simics console. To do this, the magic-hap-handler-modified.py script can be edited by replacing
print s
with
f=open('logfile','a')
f.write(s)
f.close()
- To use con0.input to start workloads on dom0 and domU
./simics -c local_mount/homework2/xen-dom0-domu simics > con0.input "cd /root/nbench-byte-2.2.3; ./nbench -cCOM.DAT &\n" simics > con0.input "ssh 10.10.0.14 'cd /root/nbench-byte-2.2.3; echo Starting nbench; ./nbench -cCOM.DAT' \n" simics > c 900_000_000 simics > run-python-file local_mount/homework2/magic-hap-handler.py
At this point, nbench has started and is running in both the domains.
- The default TLB model being simulated in the checkpoint is the ideal (no size limitations, fully associative) model. To change the model to a slightly more realistic one (64 entry - 4 way associative), use the command
simics > cpu0_tlb->type="normal" To change back to the ideal model, use simics > cpu0_tlb->type="unlimited"
- The contents of the TLB can be examined by using the command
simics > cpu0_tlb.status
- In order to read a CPU register (say CR3 register) we need to do two things
- Get the number of the register (54 for CR3)
- Read the register using the number
simics > @SIM_get_register_number(conf.cpu0, "cr3") 54 simics > @SIM_read_register(conf.cpu0, 54) 413675520
- To read the contents of a 4 byte memory word starting from an address (say 413675520)
simics > @SIM_read_phys_memory(conf.cpu0, 413675520, 4)
- The trace module is a Simics component which provides a trace of all the instructions and memory requested executed by the processor. To use the trace module the following steps have to be done
- Create the trace modules
- Start the trace module
- Continue the simulation and observe the trace
simics > new-tracer Trace object 'trace0' created. Enable tracing with 'trace0.start' simics > trace0.start Tracing enabled. Writing text output to standard output. simics > c 10

