self.r3 = Register(random.randrange(32))
def generate_instruction(self):
- string = "{} {}, {}, {}\n".format(self.opcodestr,
- self.r1.num,
- self.r2.num,
- self.r3.num)
+ string = "%s %s, %s, %s\n" % (self.opcodestr,
+ self.r1.num,
+ self.r2.num,
+ self.r3.num)
return string
def check_results(self, pdecode2):
self.imm = random.randrange(32767)
def generate_instruction(self):
- string = "{} {}, {}, {}\n".format(self.opcodestr,
- self.r1.num,
- self.r2.num,
- self.imm)
+ string = "%s %s, %s, %s\n" % (self.opcodestr,
+ self.r1.num,
+ self.r2.num,
+ self.imm)
return string
def check_results(self, pdecode2):
imm = yield pdecode2.e.imm_data.data
in2_sel = yield pdecode2.dec.op.in2_sel
imm_expected = self.get_imm(in2_sel)
- msg = "imm: got {:x}, expected {:x}".format(imm, imm_expected)
+ msg = "imm: got %x, expected %x" % (imm, imm_expected)
assert imm == imm_expected, msg
rc = yield pdecode2.e.rc.data
self.imm = random.randrange(32767)
def generate_instruction(self):
- string = "{} {}, {}({})\n".format(self.opcodestr,
- self.r1.num,
- self.imm,
- self.r2.num)
+ string = "%s %s, %s(%s)\n" % (self.opcodestr,
+ self.r1.num,
+ self.imm,
+ self.r2.num)
return string
def check_results(self, pdecode2):
self.cr = Register(random.randrange(8))
def generate_instruction(self):
- string = "{} {}, 0, {}, {}\n".format(self.opcodestr,
- self.cr.num,
- self.r1.num,
- self.r2.num)
+ string = "%s %s, 0, %s, %s\n" % (self.opcodestr,
+ self.cr.num,
+ self.r1.num,
+ self.r2.num)
return string
def check_results(self, pdecode2):
self.me = random.randrange(32)
def generate_instruction(self):
- string = "{} {},{},{},{},{}\n".format(self.opcodestr,
- self.r1.num,
- self.r2.num,
- self.shift,
- self.mb,
- self.me)
+ string = "%s %s,%s,%s,%s,%s\n" % (self.opcodestr,
+ self.r1.num,
+ self.r2.num,
+ self.shift,
+ self.mb,
+ self.me)
return string
def check_results(self, pdecode2):
self.addr = random.randrange(2**23) * 4
def generate_instruction(self):
- string = "{} {}\n".format(self.opcodestr,
- self.addr)
+ string = "%s %s\n" % (self.opcodestr,
+ self.addr)
return string
def check_results(self, pdecode2):
self.bi = random.randrange(32)
def generate_instruction(self):
- string = "{} {},{},{}\n".format(self.opcodestr,
- self.bo,
- self.bi,
- self.addr)
+ string = "%s %s,%s,%s\n" % (self.opcodestr,
+ self.bo,
+ self.bi,
+ self.addr)
return string
def check_results(self, pdecode2):
assert(aa == 0)
cr_sel = yield pdecode2.e.read_cr1.data
- assert cr_sel == (self.bi//8), f"{cr_sel} {self.bi}"
+ assert cr_sel == (self.bi//8), "%s %s" % (cr_sel, self.bi)
self.bi = random.randrange(32)
def generate_instruction(self):
- string = "{} {},{},{}\n".format(self.opcodestr,
- self.bo,
- self.bi,
- self.bh)
+ string = "%s %s,%s,%s\n" % (self.opcodestr,
+ self.bo,
+ self.bi,
+ self.bh)
return string
def check_results(self, pdecode2):
self.bt = random.randrange(32)
def generate_instruction(self):
- string = "{} {},{},{}\n".format(self.opcodestr,
- self.bt,
- self.ba,
- self.bb)
+ string = "%s %s,%s,%s\n" % (self.opcodestr,
+ self.bt,
+ self.ba,
+ self.bb)
return string
def check_results(self, pdecode2):
# extra new-line so it's easier to visually separate each
# instruction in output
- log(f"\n0x{sim.pc.CIA.value:04X}: {ins % (1 << 32):08X} {code}",
+ log("\n0x%04X: %08X %s" % (sim.pc.CIA.value,
+ ins % (1 << 32), code),
kind=LogKind.InstrInOuts)
log("sim instr: 0x{:X} pc=0x{:X}".format(ins & 0xffffffff,
state = yield from TestState("sim", sim, dut, code)
sim_states.append(state)
- log(f"final pc: 0x{sim.pc.CIA.value:X}", kind=LogKind.InstrInOuts)
+ log("final pc: 0x%X" % (sim.pc.CIA.value,), kind=LogKind.InstrInOuts)
if self.dut.allow_overlap:
# get last state, at end of run
if signed == "i" and \
value & (1 << (sz - 1)) != 0:
value -= 1 << sz
- values += f" {signed}{sz}:{value}"
- out.append(f"r{i} = 0x{v:X} {values}")
+ values += " %s%d:%d" % (signed, sz, value)
+ out.append("r%d = 0x%X %s" % (i, v, values))
return "\n".join(out)
log("regs:", format_regs(test.regs),
kind=LogKind.InstrInOuts)
pc = 0
out = []
for line in assembly.splitlines():
- out.append(f"pc=0x{pc:04X}: {line}")
+ out.append("pc=0x%04X: %s" % (pc, line))
if not line.startswith(".set ") and \
line.partition('#')[0].strip() != "":
pc += 4