Measure execution time, using SPIM

3.3k views Asked by At

I need to measure execution time of Hanoi Towers program, written in assembly language. Is there any function or specific register value used to do this task..?

1

There are 1 answers

0
xwin On

I don't know specifically about SPIM but any mips processor has a Count register which increments at half CPU clock. If SPIM emulates this register you can easy measure program execution time. Just read its content before and after program was executed.

If SPIM does not emulate this register or counts instructions, MARS mips emulator does. In general measuring time in emulator is pointless since depending on the host hardware time would be different for the same program. Instruction counter is a better measure of performance since it would be the same independent of emulator host.

MARS has an instruction counter and I think it would run SPIM program.

After a short search I found this: http://www.cs.colostate.edu/~mstrout/spim/keepstats.html

Modified SPIM that counts instructions.