{name:"multu",funct:uint32(0x19),rs:Word(0x1),rt:Word(0xFF_FF_FF_FF),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0x0),expectLo:Word(0xFF_FF_FF_FF)},// multu t1, t2
{name:"multu",funct:uint32(0x19),rs:Word(0x1),rt:Word(0xFF_FF_FF_FF),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0x0),expectLo:Word(0xFF_FF_FF_FF)},// multu t1, t2
{name:"multu",funct:uint32(0x19),rs:Word(0xFF_FF_FF_FF),rt:Word(0xFF_FF_FF_FF),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0xFF_FF_FF_FE),expectLo:Word(0x1)},// multu t1, t2
{name:"multu",funct:uint32(0x19),rs:Word(0xFF_FF_FF_FF),rt:Word(0xFF_FF_FF_FF),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0xFF_FF_FF_FE),expectLo:Word(0x1)},// multu t1, t2
{name:"multu",funct:uint32(0x19),rs:Word(0xFF_FF_FF_D3),rt:Word(0xAA_BB_CC_DD),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0xAA_BB_CC_BE),expectLo:Word(0xFC_FC_FD_27)},// multu t1, t2
{name:"multu",funct:uint32(0x19),rs:Word(0xFF_FF_FF_D3),rt:Word(0xAA_BB_CC_DD),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0xAA_BB_CC_BE),expectLo:Word(0xFC_FC_FD_27)},// multu t1, t2
{name:"multu",funct:uint32(0x19),rs:Word(0xFF_FF_FF_D3),rt:Word(0xAA_BB_CC_BE),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(0xAA_BB_CC_9F),expectLo:Word(0xFC_FD_02_9A)},// multu t1, t2
{name:"div",funct:uint32(0x1a),rs:Word(5),rt:Word(2),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(1),expectLo:Word(2)},// div t1, t2
{name:"div",funct:uint32(0x1a),rs:Word(5),rt:Word(2),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(1),expectLo:Word(2)},// div t1, t2
{name:"div by zero",funct:uint32(0x1a),rs:Word(5),rt:Word(0),rdReg:uint32(0x0),opcode:uint32(0),expectRevert:"instruction divide by zero",errMsg:"MIPS: division by zero"},// div t1, t2
{name:"div by zero",funct:uint32(0x1a),rs:Word(5),rt:Word(0),rdReg:uint32(0x0),opcode:uint32(0),panicMsg:"instruction divide by zero",revertMsg:"division by zero"},// div t1, t2
{name:"divu",funct:uint32(0x1b),rs:Word(5),rt:Word(2),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(1),expectLo:Word(2)},// divu t1, t2
{name:"divu",funct:uint32(0x1b),rs:Word(5),rt:Word(2),rdReg:uint32(0x0),opcode:uint32(0),expectHi:Word(1),expectLo:Word(2)},// divu t1, t2
{name:"divu by zero",funct:uint32(0x1b),rs:Word(5),rt:Word(0),rdReg:uint32(0x0),opcode:uint32(0),expectRevert:"instruction divide by zero",errMsg:"MIPS: division by zero"},// divu t1, t2
{name:"divu by zero",funct:uint32(0x1b),rs:Word(5),rt:Word(0),rdReg:uint32(0x0),opcode:uint32(0),panicMsg:"instruction divide by zero",revertMsg:"division by zero"},// divu t1, t2
{name:"illegal instruction",nextPC:0,insn:0b111110<<26,errMsg:testutil.CreateErrorStringMatcher("invalid instruction"),memoryProofAddresses:[]Word{0x0}},// memoryProof for the zero address at register 0 (+ imm)
{name:"branch in delay-slot",nextPC:8,insn:0x11_02_00_03,errMsg:testutil.CreateErrorStringMatcher("branch in delay slot")},
{name:"branch in delay-slot",nextPC:8,insn:0x11_02_00_03,errMsg:testutil.CreateErrorStringMatcher("branch in delay slot")},
{name:"jump in delay-slot",nextPC:8,insn:0x0c_00_00_0c,errMsg:testutil.CreateErrorStringMatcher("jump in delay slot")},
{name:"jump in delay-slot",nextPC:8,insn:0x0c_00_00_0c,errMsg:testutil.CreateErrorStringMatcher("jump in delay slot")},
{name:"Count of 0",addr:0x00_00_FF_03,count:0,writeLen:0,preimageOffset:8,prestateMem:prestateMem,postateMem:0xEE_EE_EE_EE_FF_FF_FF_FF},
{name:"Count greater than 8",addr:0x00_00_FF_00,count:15,writeLen:8,preimageOffset:8,prestateMem:prestateMem,postateMem:0x12_34_56_78_98_76_54_32},
{name:"Count greater than 8, unaligned",addr:0x00_00_FF_01,count:15,writeLen:7,preimageOffset:8,prestateMem:prestateMem,postateMem:0xEE_12_34_56_78_98_76_54},
{name:"Offset at last byte",addr:0x00_00_FF_00,count:8,writeLen:1,preimageOffset:15,prestateMem:prestateMem,postateMem:0x32_EE_EE_EE_FF_FF_FF_FF},
{name:"Offset just out of bounds",addr:0x00_00_FF_00,count:4,writeLen:0,preimageOffset:16,prestateMem:prestateMem,postateMem:0xEE_EE_EE_EE_FF_FF_FF_FF,shouldPanic:true},
{name:"Offset out of bounds",addr:0x00_00_FF_00,count:4,writeLen:0,preimageOffset:17,prestateMem:prestateMem,postateMem:0xEE_EE_EE_EE_FF_FF_FF_FF,shouldPanic:true},
{name:"Store word left",opcode:0b10_1010,base:0xFF_00_00_00,offset:0x10,effAddr:0xFF_00_00_10,preMem:^Word(0),postMem:0x12_34_56_78_FF_FF_FF_FF},
{name:"Store word left lower",opcode:0b10_1010,base:0xFF_00_00_00,offset:0x14,effAddr:0xFF_00_00_10,preMem:^Word(0),postMem:0xFF_FF_FF_FF_12_34_56_78},
{name:"Store word lower",opcode:0b10_1011,base:0xFF_00_00_00,offset:0x14,effAddr:0xFF_00_00_10,preMem:^Word(0),postMem:0xFF_FF_FF_FF_12_34_56_78},
{name:"Store word right",opcode:0b10_1110,base:0xFF_00_00_00,offset:0x10,effAddr:0xFF_00_00_10,preMem:^Word(0),postMem:0x78_FF_FF_FF_FF_FF_FF_FF},
{name:"Store word right lower",opcode:0b10_1110,base:0xFF_00_00_00,offset:0x14,effAddr:0xFF_00_00_10,preMem:^Word(0),postMem:0xFF_FF_FF_FF_78_FF_FF_FF},
{name:"Offset just out of bounds",addr:0x00_00_FF_00,count:4,writeLen:0,preimageOffset:16,prestateMem:0xFF_FF_FF_FF,postateMem:0xFF_FF_FF_FF,shouldPanic:true},
{name:"Offset just out of bounds",addr:0x00_00_FF_00,count:4,writeLen:0,preimageOffset:16,prestateMem:0xFF_FF_FF_FF,postateMem:0xFF_FF_FF_FF,shouldPanic:true},
{name:"Offset out of bounds",addr:0x00_00_FF_00,count:4,writeLen:0,preimageOffset:17,prestateMem:0xFF_FF_FF_FF,postateMem:0xFF_FF_FF_FF,shouldPanic:true},
{name:"Offset out of bounds",addr:0x00_00_FF_00,count:4,writeLen:0,preimageOffset:17,prestateMem:0xFF_FF_FF_FF,postateMem:0xFF_FF_FF_FF,shouldPanic:true},
// Note: parameters are written as 64-bit values. For 32-bit architectures, these values are downcast to 32-bit
cases:=[]struct{
cases:=[]struct{
namestring
namestring
addressParamWord
addressParamuint64
effAddrWord
effAddruint64
targetValueWord
targetValueuint64
actualValueWord
actualValueuint64
timeoutWord
timeoutuint64
shouldFailbool
shouldFailbool
shouldSetTimeoutbool
shouldSetTimeoutbool
}{
}{
{name:"successful wait, no timeout",addressParam:0x1234,effAddr:0x1234,targetValue:0x01,actualValue:0x01},
{name:"successful wait, no timeout",addressParam:0xFF_FF_FF_FF_FF_FF_12_38,effAddr:0xFF_FF_FF_FF_FF_FF_12_38,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_01},
{name:"successful wait, no timeout, unaligned addr",addressParam:0x1235,effAddr:0x1234,targetValue:0x01,actualValue:0x01},
{name:"successful wait, no timeout, unaligned addr",addressParam:0xFF_FF_FF_FF_FF_FF_12_39,effAddr:0xFF_FF_FF_FF_FF_FF_12_38,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_01},
{name:"memory mismatch, no timeout",addressParam:0x1200,effAddr:0x1200,targetValue:0x01,actualValue:0x02,shouldFail:true},
{name:"memory mismatch, no timeout",addressParam:0xFF_FF_FF_FF_FF_FF_12_00,effAddr:0xFF_FF_FF_FF_FF_FF_12_00,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_02,shouldFail:true},
{name:"memory mismatch, no timeout, unaligned",addressParam:0x1203,effAddr:0x1200,targetValue:0x01,actualValue:0x02,shouldFail:true},
{name:"memory mismatch, no timeout, unaligned",addressParam:0xFF_FF_FF_FF_FF_FF_12_03,effAddr:0xFF_FF_FF_FF_FF_FF_12_00,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_02,shouldFail:true},
{name:"successful wait w timeout",addressParam:0x1234,effAddr:0x1234,targetValue:0x01,actualValue:0x01,timeout:1000000,shouldSetTimeout:true},
{name:"successful wait w timeout",addressParam:0xFF_FF_FF_FF_FF_FF_12_38,effAddr:0xFF_FF_FF_FF_FF_FF_12_38,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_01,timeout:1000000,shouldSetTimeout:true},
{name:"successful wait w timeout, unaligned",addressParam:0x1232,effAddr:0x1230,targetValue:0x01,actualValue:0x01,timeout:1000000,shouldSetTimeout:true},
{name:"successful wait w timeout, unaligned",addressParam:0xFF_FF_FF_FF_FF_FF_12_32,effAddr:0xFF_FF_FF_FF_FF_FF_12_30,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_01,timeout:1000000,shouldSetTimeout:true},
{name:"memory mismatch w timeout",addressParam:0x1200,effAddr:0x1200,targetValue:0x01,actualValue:0x02,timeout:2000000,shouldFail:true},
{name:"memory mismatch w timeout",addressParam:0xFF_FF_FF_FF_FF_FF_12_00,effAddr:0xFF_FF_FF_FF_FF_FF_12_00,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_02,timeout:2000000,shouldFail:true},
{name:"memory mismatch w timeout, unaligned",addressParam:0x120F,effAddr:0x120C,targetValue:0x01,actualValue:0x02,timeout:2000000,shouldFail:true},
{name:"memory mismatch w timeout, unaligned",addressParam:0xFF_FF_FF_FF_FF_FF_12_0F,effAddr:0xFF_FF_FF_FF_FF_FF_12_10,targetValue:0xFF_FF_FF_FF_FF_FF_FF_01,actualValue:0xFF_FF_FF_FF_FF_FF_FF_02,timeout:2000000,shouldFail:true},
{name:"Traverse right, no left threads",addressParam:0x6784,effAddr:0x6784,activeThreadCount:2,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, no left threads",addressParam:0xFF_FF_FF_FF_FF_FF_67_84,effAddr:0xFF_FF_FF_FF_FF_FF_67_84,activeThreadCount:2,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, no left threads, unaligned addr",addressParam:0x678E,effAddr:0x678C,activeThreadCount:2,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, no left threads, unaligned addr",addressParam:0xFF_FF_FF_FF_FF_FF_67_8E,effAddr:0xFF_FF_FF_FF_FF_FF_67_8C,activeThreadCount:2,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, single thread",addressParam:0x6788,effAddr:0x6788,activeThreadCount:1,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, single thread",addressParam:0xFF_FF_FF_FF_FF_FF_67_88,effAddr:0xFF_FF_FF_FF_FF_FF_67_88,activeThreadCount:1,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, single thread, unaligned",addressParam:0x6789,effAddr:0x6788,activeThreadCount:1,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse right, single thread, unaligned",addressParam:0xFF_FF_FF_FF_FF_FF_67_89,effAddr:0xFF_FF_FF_FF_FF_FF_67_88,activeThreadCount:1,inactiveThreadCount:0,traverseRight:true},
{name:"Traverse left, single thread",addressParam:0x6788,effAddr:0x6788,activeThreadCount:1,inactiveThreadCount:0,traverseRight:false,expectTraverseRight:true},
{name:"Traverse left, single thread",addressParam:0xFF_FF_FF_FF_FF_FF_67_88,effAddr:0xFF_FF_FF_FF_FF_FF_67_88,activeThreadCount:1,inactiveThreadCount:0,traverseRight:false,expectTraverseRight:true},
{name:"Traverse left, single thread, unaligned",addressParam:0x6789,effAddr:0x6788,activeThreadCount:1,inactiveThreadCount:0,traverseRight:false,expectTraverseRight:true},
{name:"Traverse left, single thread, unaligned",addressParam:0xFF_FF_FF_FF_FF_FF_67_89,effAddr:0xFF_FF_FF_FF_FF_FF_67_88,activeThreadCount:1,inactiveThreadCount:0,traverseRight:false,expectTraverseRight:true},