SESC Sample Use

From Vlsiwiki
Jump to: navigation, search

Checkout Code (at UCSC)

First create a working directory to checkout and compile the QEMU and SESC source code in. For example to create a working directory called sesc-qemu execute the commands:

mkdir sesc-qemu
cd sesc-qemu

Checkout QEMU

To checkout QEMU from the svn repository execute the following command:

svn co svn+ssh://mada0.cse.ucsc.edu/mada/server/svn/sesc/qemu

After the command executes you will be prompted for your password twice and then the files will be copied from the svn repository to the qemu directory in your working directory.

Checkout SESC

To checkout SESC from the svn repository execute the following command.

svn co svn+ssh://mada0.cse.ucsc.edu/mada/server/svn/sesc/sesc

After the command executes you will be prompted for your password twice and then the files will be copied from the svn repository to the sesc directory in your working directory.

Compile QEMU for SESC

The next step is to compile QEMU to use with SESC. Execute the following series of commands:

cd qemu
./configure --target-list=sparc-softmmu --enable-sesc
gmake

The ./configure command will complete quickly while the gmake will take longer because it causes the QEMU files to be compiled and linked. The compiliation process currently ends with a link error that looks similiar to the following:

collect2: ld returned 1 exit status
make[1]: *** [qemu-system-sparc] Error 1
make[1]: Leaving directory `/mada/users/xxx/sesc-qemu/qemu/sparc-softmmu'
gmake: *** [subdir-sparc-softmmu] Error 2

This can be safely ignored for now, although it should eventually be fixed.

Compile SESC

The next step is to compile SESC. To do this execute the following series of commands:

cd ..
mkdir build
cd build
../sesc/configure --enable-qemu
gmake

This creates a working directory to compile SESC in, uses configure to create the Makefile and then runs gmake to control the compilation and linking process. The compilation process creates an executable called sesc.mem that is used to execute SESC.

Create SESC configuration

To create an initial configuration file execute the command

gmake sesc.conf

This will create a new default configuration file.

Execute sample SESC run

The following command can be used as a simple test to make sure SESC runs. Note that this command should be typed on a single line, it is split over multiple lines here so that it is readable.

./sesc.mem -xqemu -y10000000 -L ../qemu/pc-bios/ 
-kernel ../qemu/sparc-test/vmlinux-2.6.11+tcx 
-initrd ../qemu/sparc-test/linux.img 
-append "root=/dev/ram console=ttyS0 video=tcxfb" 
-nographic

If you have X11 graphics the "-nographic" parameter can be ommitted. This causes QEMU to load in a separate window and makes it easier to differentiate OS functionality from QEMU/SESC debugging and logging data. This is a simple single processor kernel with limited functionality, but it does demonstrate that SESC works with QEMU. This example is limited to 10 million instructions, at which time the simulation will stop (this is not even enough instructions for the BIOS to finish loading).

To view a report with simulation results from SESC execute the following command:

../sesc/scripts/report.pl -a

Compete OS simulation (at UCSC)

To test full system simulation using an OS image execute the following commands:

mkdir ../os
cp /mada/software/scoore/hda.img ../os

This command is shown on multiple lines, but should be typed on a single line:

./sesc.mem -xqemu -y100000000 -L ../qemu/pc-bios
-hda ../os/hda.img -smp 2 -M SS-10 -nographic

These commands copy a debian Linux installation to your working directory and then load it with SESC and QEMU. The -y parameter specifies the number of instructions to execute. It takes nearly 2 billion instructions for Linux to finish booting so the -y parameter should be followed by a suitably large number depending on what benchmarks you hope to run.

The -w parameter can be added to execute the first x instructions in QEMU only and not perform timing analysis with SESC. After these instructions complete SESC will start analyzing the timing of the remaining instructions. However, there may be a bug with this feature because depending on the number of instructions skipped sometime SESC never starts running. This is still being tested, but it may help with speeding up boot time for some simulations.

The current hda.img has a single processor kernel. We are currently working on upgrading the kernel to a multiprocessor kernel. The current OS image also requires the -nographic parameter because the keyboard is not mapped properly otherwise. This will also be fixed in the new OS image.