Cycle counting for SPIM 7.2.1
We use SPIM for the
graduate compiler course at CSU.
Francis Hsu provided a copy of Spim 6.5, which
had been modified
for use with Alex Aiken's
COOL project.
Their modifications count
the number of instructions executed, reads, writes, and branches that
occur within a Mips program as it is simulated with SPIM.
I applied the same modifications to SPIM 7.2.1.
Example usage
% ./spim -keepstats file.s
SPIM Version 7.2.1 of August 28, 2005
Copyright 1990-2004 by James R. Larus (larus@cs.wisc.edu).
All Rights Reserved.
See the file README for a full copyright notice.
Loaded: /usr/local/share/xspim/CPU/exceptions.s
Stats -- #instructions : 149
#reads : 43 #writes 42 #branches 13 #other 51
Download
spim-7.2.1-keepstats.tgz
Change Log
August 13, 2007:
- xspim now compiles with keepstats update.
- Changed float output format to %g to enable MiniJava compiler with
floats that compares with output from code compiled with javac.
Michelle Strout
.... August 13, 2007