Esempio n. 1
0
def test_execute_movcond(is16bit, val):
    state = new_state(AZ=1, rf1=val)
    instr = (opcode_factory.movcond16(condition=0b0000, rd=0, rn=1) if is16bit
             else opcode_factory.movcond32(condition=0b0000, rd=0, rn=1))
    name, executefn = decode(instr)
    executefn(state, Instruction(instr, None))
    pc_expected = (2 if is16bit else 4) + RESET_ADDR
    expected_state = StateChecker(pc=pc_expected, rf0=val)
    expected_state.check(state)
Esempio n. 2
0
 ('fsub16',      opcode_factory.fsub16(rd=1, rn=0, rm=0)),
 ('fmul16',      opcode_factory.fmul16(rd=1, rn=0, rm=0)),
 ('fmadd16',     opcode_factory.fmadd16(rd=1, rn=0, rm=0)),
 ('fmsub16',     opcode_factory.fmsub16(rd=1, rn=0, rm=0)),
 ('float16',     opcode_factory.float16(rd=1, rn=0, rm=0)),
 ('fix16',       opcode_factory.fix16(rd=1, rn=0, rm=0)),
 ('fabs16',      opcode_factory.fabs16(rd=1, rn=0, rm=0)),
 ('fadd32',      opcode_factory.fadd32(rd=1, rn=0, rm=0)),
 ('fsub32',      opcode_factory.fsub32(rd=1, rn=0, rm=0)),
 ('fmul32',      opcode_factory.fmul32(rd=1, rn=0, rm=0)),
 ('fmadd32',     opcode_factory.fmadd32(rd=1, rn=0, rm=0)),
 ('fmsub32',     opcode_factory.fmsub32(rd=1, rn=0, rm=0)),
 ('float32',     opcode_factory.float32(rd=1, rn=0, rm=0)),
 ('fix32',       opcode_factory.fix32(rd=1, rn=0, rm=0)),
 ('fabs32',      opcode_factory.fabs32(rd=1, rn=0, rm=0)),
 ('movcond32',   opcode_factory.movcond32(condition=0b0000, rd=0, rn=0)),
 ('movcond16',   opcode_factory.movcond16(condition=0b0000, rd=0, rn=0)),
 ('movtimm32',   opcode_factory.movtimm32(rd=0b1111, imm=0)),
 ('movimm32',    opcode_factory.movimm32(rd=0b1111, imm=0)),
 ('movimm16',    opcode_factory.movimm16(rd=0b1111, imm=0)),
 ('movfs32',     opcode_factory.movfs32(rn=0b110, rd='IRET')),
 ('movfs16',     opcode_factory.movfs16(rn=0b110, rd='IRET')),
 ('movts32',     opcode_factory.movts32(rn='IRET', rd=0b011)),
 ('movts16',     opcode_factory.movts16(rn='IRET', rd=0)),
 ('gie16',       opcode_factory.gie16()),
 ('gid16',       opcode_factory.gid16()),
 ('nop16',       opcode_factory.nop16()),
 ('idle16',      opcode_factory.idle16()),
 ('bkpt16',      opcode_factory.bkpt16()),
 ('mbkpt16',     opcode_factory.mbkpt16()),
 ('sync16',      opcode_factory.sync16()),