Supported 55 instructions:
'addi', 'addiu', 'addu', 'and', 'andi',
'b', 'beq', 'beqz', 'bgez', 'bgtz', 'blez', 'bltz', 'bne', 'bnez',
'clz', 'divu',
'j', 'jal', 'jalr', 'jr',
'lb', 'lbu', 'lui', 'lw', 'lwr',
'mfhi', 'mflo', 'move', 'movn', 'movz', 'mtlo', 'mul', 'multu',
'negu', 'nop', 'not', 'or', 'ori',
'sb', 'sll', 'sllv', 'slt', 'slti', 'sltiu', 'sltu', 'sra', 'srl', 'srlv', 'subu', 'sw', 'swr', 'sync', 'syscall',
'xor', 'xori'
To run:
- Load a program into a state, e.g. using
LoadELF
. - Patch the program if necessary: e.g. using
PatchGo
for Go programs,PatchStack
for empty initial stack, etc. - Implement the
PreimageOracle
interface - Instrument the emulator with the state, and pre-image oracle, using
NewInstrumentedState
- Step through the instrumented state with
Step(proof)
, whereproof==true
if witness data should be generated. Steps are faster withproof==false
. - Optionally repeat the step on-chain by calling
MIPS.sol
andPreimageOracle.sol
, using the above witness data.