5i, ki, vi, qi – instruction simulators|
vi [ textfile ]|
5i [ textfile ]
ki [ textfile ]
qi [ textfile ]
Vi 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 vi execute about two hundred times slower
than normal--but faster than single stepping under db. 5i, ki, and
qi are similar to vi but interpret ARM, SPARC, and
PowerPC binaries. The following discussion refers to vi but applies
to the others as well. |
Vi will simulate the execution of a named textfile. It will also make a copy of an existing process with process id pid and simulate its continuation.
As a debugger vi offers more complete information than db(1). Tracing can be performed at the level of instructions, system calls, or function calls. Vi 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 each run. Vi simulates the CPU's caches and MMU to assist the optimization of compilers and programs.
The command interface mirrors the interface to db; see db(1) for a detailed description. Data formats and addressing are compatible with db except for disassembly: vi offers only MIPS (db –mmipsco) mnemonics for machine instructions. Ki offers both Plan 9 and Sun SPARC formats.
Several extra commands allow extended tracing and printing of
The code generated by the compilers is well supported, but some
unusual instructions are unimplemented. Some Plan 9 system calls
such as rfork cause simulated traps. The floating point simulation
makes assumptions about the interpreting machine's floating point
support. The floating point conversions performed
by vi may cause a loss of precision.|