It is not in the same league as MAME, but related is
z88dk-ticks which is a command line emulator for z80 (also 8085, z180 and z80n) that can be used to time execution speed of code, or test programs on a host computer.
z88dk-ticks includes a debugger and disassembler in addition to supporting hotspot analysis. It doesn't get much air-time, because it sort of disappears inside the z88dk, but I use it all the time.
It supports a very simple RC2014 machine model, using the ACIA Module on the standard ports. It also supports the APU Module at the correct 3:1 clock ratio, so trade-offs can be calculated.
The RC2014 support is enabled simply by including "rc2014" in the name of the binary file loaded. The
code is very simple, so can be extended for specific applications if anyone is interested.
It also supports CP/M applications, simply by feeding in a file with ".COM" in the name of the file.
I used this recently to check the Hi-Tech C v7.80p2 performance, for example, and also to update the SDCC results for the below release.
SDCC recently (in upcoming
4.2.0 release) has started issuing new library calls, where two
int are multiplied to a
long, in both signed and unsigned versions.
I wanted to include these calls in the am9511 APU Module math library for the RC2014, but previously I'd tested that the APU was slower than the RC2014 z80 when handling integers.
So, z88dk-ticks was useful to analyse the performance of the two alternatives for 32_16x16 multiplies, and it turned out that the z80 is faster with unsigned multiplies, but the APU is faster with signed multiplies. Not something you would just guess, unless you're counting a lot of lines of code.
The hotspot analysis (enabled in the debugger) is also useful for working out what code is being used all the time, and therefore can benefit from optimisation.
Whether it is in-lining a code fragment, or simply exchanging a jr for a jp, you can get a concrete analysis based on the benchmarks or other test code.
Anyway, hope that's useful info, and an option for emulations when you don't have an RC2014 machine to hand.
Cheers, Phillip
$ z88dk-ticks
Ticks v0.14c beta, a silent Z80 emulator by Antonio Villena, 10 Jan 2013
ticks [-pc X] [-start X] [-end X] [-counter X] [-output <file>] <input_file>
<input_file> File between 1 and 65536 bytes with Z80 machine code
-tape <file> emulates ZX tape in port $FE from a .WAV file
-trace outputs register values and disassembly while executing
-pc X X in hexadecimal is the initial PC value
-start X X in hexadecimal is the PC condition to start the counter
-end X X in hexadecimal is the PC condition to exit
-counter X X in decimal is another condition to exit
-int X X in decimal are number of cycles for periodic interrupts
-w X Maximum amount of running time (400000000 cycles per unit)
-d Enable debugger
-l X Load file to address
-b <model> Memory model (zxn/zx/z180)
-m8080 Emulate an 8080
-m8085 Emulate an 8085 (mostly)
-mgbz80 Emulate a gbz80 (mostly)
-mz80 Emulate a z80
-mz180 Emulate a z180
-mr2ka Emulate a Rabbit 2000
-mr3k Emulate a Rabbit 3000
-mz80n Emulate a Spectrum Next z80n
-mez80 Emulate an ez80 (z80 mode)
-x <file> Symbol file to read
-ide0 <file> Set file to be ide device 0
-ide1 <file> Set file to be ide device 1
-iochar X Set port X to be character input/output
-output <file> dumps the RAM content to a 64K file
-rom X write-protect memory, X in hexadecimal is first RAM address
Default values for -pc, -start and -end are 0000 if omitted. When the program exits, it'll show the number of cycles between start and end trigger in decimal
$