Shade - A brief Overview
Overview
Shade is a library of Instruction Set simulator tools for the SPARC V8 (and V9)
architecture. It provides a set of routines so that you can easily
write a program that takes as input normal executables on the Sun's.
The framework it presents is that it gives you access to each
instruction, before and after it has been executed. At those times
you can write your own statistics routines based on:
- the instruction,
- the register file
- the state of the condition codes
- the results of branches, and if instructions are annulled
- the software trap numbers
There is some more detailed information
here.
LICENSE note
Members of cse548 have a license to use Shade. The distribution is in
/cse/www/education/courses/cse548/96w/tools/Shade. In that directory,
LICENSE.txt describes the license. The key sentance is:
This Software may not be redistributed by the Licensee in
either source or binary form.
Which I interpret to mean you aren't supposed to allow other people to
copy bits.
Available Simulators
There are a number of simulators that have already been written to
measure some basic statistics about programs. They are located in
/cse/www/education/courses/cse548/96w/tools/Shade/shade.v8/bin.
The basic invocation of a simulator is:
[simulator name] -c "name of program to simulate"
So to run the instruction counter on the date program, type:
icount -c "date"
The following simulators are available:
cachesim5 simulates a cache heirarchy on an
application program. You can specify the heirarchy of data,
instruction, and unified caches, as well as cache size, block size,
sub-block size, set associativity, set replacement algorithm (random
or lru), and write policy (write-back or write-allocate). It supports
some form of inclusion, but appears to only allow you to include
either the insturction or data cache as part of a unified cache, but
not both.
icount counts the number of executed instructions in
a program.
ifreq prints the number of instructions (by opcode) executed
and/or annuled in a program.
pairs prints statistics about frequency of sequences
of two instructions by instruction pair.
trips does the same analysis as pairs execept for
triplets of insturctions.
window prints statistics about register window usage
including over/underflow counts and save/restore run lengths.
Building your own analyzer
There is an introduction to Shade in the www directory:
/cse/www/education/courses/cse548/96w/tools/Shade/shade.v8/doc/intro/intro.ps.
For example, to compile your tool, type:
(Assuming $SHADE is /cse/www/education/courses/cse548/96w/tools/Shade/shade.v8)
(Assuming $SPIX is /cse/www/education/courses/cse548/96w/tools/Shade/spixtools.v8)
cc -I$SHADE/src/include -I$SPIX/src/include myprog.c -o myprog \
$SHADE/lib/libshade.a $SPIX/lib/libspix.a
If you use the simulator as mentioned in the Introuction guide, your
analyzer will read commands to analyze from standard input. Two
example programs are in Shade/shade.v8/eg. One is from the
introuction, and the other is a stand-alone/stripped version of
icount.c To compile the example programs in $SHADE/src/bin,
use the makefile in that directory.