self.add_case(Program(lst, bigendian),
initial_regs, initial_sprs)
+ def case_cmp(self):
+ lst = ["subf. 1, 6, 7",
+ "cmp cr2, 1, 6, 7"]
+ initial_regs = [0] * 32
+ initial_regs[6] = 0xffffffffaaaaaaaa
+ initial_regs[7] = 0x00000000aaaaaaaa
+ self.add_case(Program(lst, bigendian), initial_regs, {})
+
def case_cmp(self):
lst = ["subf. 1, 6, 7",
"cmp cr2, 1, 6, 7"]
# increment counter, Stop after 100000 cycles
uptime = Signal(64)
self.sync += uptime.eq(uptime + 1)
- self.sync += If(uptime == 100000000, Finish())
+ #self.sync += If(uptime == 1000000000000, Finish())
dmifsm = FSM()
self.submodules += dmifsm
)
# limit range of pc for debug reporting
- self.comb += active_dbg.eq((0x51b0 < pc) & (pc < 0x51dc))
+ self.comb += active_dbg.eq((0x5108 <= pc) & (pc <= 0x5234))
#self.comb += active_dbg.eq((0x0 < pc) & (pc < 0x58))
# get the MSR
if ack:
break
yield
+ yield
yield dmi.req_i.eq(0)
yield dmi.addr_i.eq(0)
yield dmi.din.eq(0)
yield dmi.we_i.eq(0)
+ yield
def get_dmi(dmi, addr):
yield dmi.req_i.eq(1)
yield dmi.addr_i.eq(addr)
yield dmi.din.eq(0)
- yield dmi.we_i.eq(1)
+ yield dmi.we_i.eq(0)
while True:
ack = yield dmi.ack_o
if ack:
yield dmi.req_i.eq(0)
yield dmi.addr_i.eq(0)
yield dmi.we_i.eq(0)
+ yield
return data
yield
# test of dmi reg get
- int_reg = 9
- yield from set_dmi(dmi, DBGCore.GSPR_IDX, int_reg) # int reg 9
- value = yield from get_dmi(dmi, DBGCore.GSPR_DATA) # get data
+ for int_reg in range(32):
+ yield from set_dmi(dmi, DBGCore.GSPR_IDX, int_reg)
+ value = yield from get_dmi(dmi, DBGCore.GSPR_DATA)
- print ("after test %s reg %x value %s" % \
- (test.name, int_reg, value))
+ print ("after test %s reg %2d value %x" % \
+ (test.name, int_reg, value))
sim.add_sync_process(process)
with sim.write_vcd("issuer_simulator.vcd",
suite.addTest(TestRunner(DivTestCases().test_data))
# suite.addTest(TestRunner(AttnTestCase.test_data))
suite.addTest(TestRunner(GeneralTestCases.test_data))
- # suite.addTest(TestRunner(LDSTTestCase().test_data))
+ suite.addTest(TestRunner(LDSTTestCase().test_data))
# suite.addTest(TestRunner(CRTestCase().test_data))
# suite.addTest(TestRunner(ShiftRotTestCase.test_data))
suite.addTest(TestRunner(LogicalTestCase().test_data))
def test_0_litex_bios_cmp(self):
"""litex bios cmp test
"""
- lst = [ "addis 26, 0, 21845",
- "ori 26, 26, 21845",
- "addi 5, 26, 0",
- "rldicr 5,5,32,31",
+ lst = [ "addi 26, 0, 43690",
+ "ori 26, 26, 43690",
"addi 5, 26, 0",
+ #"rldicr 5,5,32,31",
+ #"addi 5, 26, 0",
"cmp 0, 0, 5, 26",
"bc 12, 2, 28",
"addis 6, 0, 1",
with Program(lst, bigendian) as program:
self.run_tst_program(program, [1, 2, 3])
- @unittest.skip("disable")
+ #@unittest.skip("disable")
def test_st_rev_ext(self):
lst = ["addi 1, 0, 0x5678",
"addi 2, 0, 0x1234",