Assignment #2, Due April 30th
For this assignment, you will use SimpleScalar to examine the
performance of an application called ADPCM, and the potential
performance gains if the computation kernel could be speed up
by having a custom accelerator or co-processor.
Accounts and Machines
Everyone should have an account on the CSE architecture lab. See the
instructor if this is not the case. This account will let you log
into the following two machines in our lab (if your job takes a long
time to run, please nice it at -19):
cycletron20.ucsd.edu
cycletron21.ucsd.edu
These are the two machines you can use to complete this assignment.
Software
To complete the assignment you'll need to use the following software:
- ARM gcc, objdump, etc... The compiler tools are located at:
/home/cse291-sp02/project/arm/bin/
- ARM SimpleScalar simulator. The source code is located at:
/home/cse291-sp02/project/arm/simplesim-arm/
- The APDCM application to be optimized. The source code is located in:
/home/cse291-sp02/project/assign2/adpcm
You should put the compiler bin directory in your path, and copy the
source tree for ARM SimpleScalar to your own directory for your
SimpleScalar modifications. Compiling SimpleScalar will produce the
ARM simulator called sim-outorder.
You will need to compile ADPCM with the ARM gcc compiler, and compile
simplescalar with the linux x86 gcc compiler (/usr/local/bin/gcc).
To run ADPCM on simplescalar execute the following command:
../sim-outorder -config xscale.cfg rawdaudio < clinton.adpcm > clinton.pcm
This will decode the clinton.adpcm file producing a PCM file. You
will use the above configuration, program and input for all of the
results for this assignment.
The xscale.cfg file is found in:
/home/cse291-sp02/project/arm/simplesim-arm/config/
The clinton.adpcm file is found in:
/home/cse291-sp02/project/assign2/adpcm/data
Questions to Answer
Once you are able to run sim-outorder on the ADPCM program, you will
then need to modify SimpleScalar to answer the following questions:
- How many cycles (using SimpleScalar) does it take to execute the above program with
its input ("rawdaudio < clinton.adpcm > clinton.pcm") on an Xscale processor?
- How many cycles from SimpleScalar are
spent inside each call to routine "adpcm_decoder" on average, when running the
rawdaudio with the above input? "adpcm_decoder" is the kernel
in which all of the decoding is performed. You can use the program
"arm-linux-objdump" provided with the ARM compiler to find out the
static PCs for procedure calls and the starting and ending PCs of routines. Print
the average number of cycles per call, and the total number of cycles spent
in adpcm_decoder using the "stat_reg_counter" routine in SimpleScalar.
- How many times does the routine "adpcm_decoder" get called?
- How many loop iterations does the for loop in "adpcm_decoder"
execute on average per call to the routine "adpcm_decoder"?
- Assume you have built a coprocessor to specialize the execution
of the routine adpcm_decoder. This coprocessor takes as input the
params to adpcm_decoder and returns a buffer of results. Also
assume that you've done a detailed analysis of the timing for this
accelerator. This shows that each tall to the routine
"adpcm_decoder" will execute 50% faster on the customized
co-processor than on the XScale processor. How many cycles does
it take to execute the program adding this co-processor to Xscale?
What is the speedup for the execution of adpcm for this design?
What to turn in:
- Answers to the above questions.
- The 2-3 pages showing what code you changed/added in SimpleScalar, and where
you made the modifications.
April 18, 2002