5i, ki, vi, qi – instruction simulators
simulates the execution of a MIPS binary in
a Plan 9 environment.
It has two main uses: as
a debugger and as a statistics gatherer.
Programs running under
execute about two hundred times
slower than normalbut faster than
single stepping under
are similar to
but interpret ARM, SPARC, and PowerPC binaries.
The following discussion refers to
but applies to the others
will simulate the execution of a named
It will also make a copy of an existing process with process id
and simulate its continuation.
As a debugger
offers more complete information
Tracing can be performed at the level of instructions,
system calls, or function calls.
allows breakpoints to be triggered when specified addresses
in memory are accessed.
A report of instruction counts,
load delay fills and distribution is produced for
simulates the CPU’s caches and MMU
to assist the optimization of compilers and programs.
The command interface mirrors the interface to
for a detailed description.
Data formats and addressing are compatible with
offers only MIPS
offers both Plan 9 and Sun SPARC formats.
Several extra commands allow
extended tracing and printing of statistics:
command controls tracing. Zero cancels all tracing
Enable instruction tracing
Enable call tracing
Enable system call tracing
command prints statistics accumulated by
all code run in this session.
Print instruction counts and frequency.
Print cycle profile.
only) Print TLB and cache statistics.
Print memory reference, working set and size statistics.
allows breakpoints to be set on any memory location.
These breakpoints monitor when a location is
accessed, read, written, or equals a certain value.
For equality the compared value is the
supplied to the command.
The code generated by
is well supported, but some unusual instructions are unimplemented.
Some Plan 9 system calls such as
cause simulated traps.
The floating point simulation makes assumptions about the interpreting
machine’s floating point support. The floating point conversions performed
may cause a loss of precision.