# libre-soc has own SPR unit
# other instructions here -> must be load/store
+ def cse_dcbz(self):
+ lst = [
+ "dcbz 1,2",
+ ]
+
+ initial_regs = [0] * 32
+ initial_regs[1] = 0x2
+ initial_regs[2] = 0x2020
+
+ self.add_case(Program(lst, bigendian),
+ initial_regs, initial_mem={})
+
def case_mmu_dar(self):
lst = [
- "mfspr 1, 720", # DAR to reg 1
- "addi 7, 0, 1",
+ "mfspr 1, 720", # DAR to reg 1
"mtspr 19, 3", # reg 3 to DAR
- "mulli 7, 0, 1",
]
initial_regs = [0] * 32
initial_sprs = {'DAR': 0x87654321,
}
self.add_case(Program(lst, bigendian),
- initial_regs, initial_sprs)
+ initial_regs, initial_sprs, initial_mem={})
- def cse_mmu_ldst(self):
+ def case_mmu_ldst(self):
lst = [
- "dcbz 1,2",
+ "dcbz 1,0",
"tlbie 0,0,0,0,0", # RB,RS,RIC,PRS,R
"mtspr 18, 1", # reg 1 to DSISR
"mtspr 19, 2", # reg 2 to DAR
initial_sprs = {'DSISR': 0x12345678, 'DAR': 0x87654321,
'PIDR': 0xabcd, 'PRTBL': 0x0def}
self.add_case(Program(lst, bigendian),
- initial_regs, initial_sprs)
+ initial_regs, initial_sprs, initial_mem={})
if __name__ == "__main__":
comb += self.imem.f_i_valid.eq(1)
with m.Else():
# not busy: instruction fetched
- insn = get_insn(self.imem.f_instr_o, cur_state.pc+4)
+ if hasattr(core, "icache"):
+ # blech, icache returns actual instruction
+ insn = self.imem.f_instr_o
+ else:
+ insn = get_insn(self.imem.f_instr_o, cur_state.pc+4)
sync += dec_opcode_o.eq(insn)
m.next = "INSN_READY"
# TODO: probably can start looking at pdecode2.rm_dec
yield from setup_i_memory(imem, pc, instructions, self.dut.rom)
yield from setup_tst_memory(l0, self.test.mem)
else:
- insert_into_rom(pc, instructions, self.dut.rom)
+ insert_into_rom(pc, instructions, self.dut.default_mem)
print("about to setup regs")
yield from setup_regs(pdecode2, core, self.test)
#print("setup mem and regs done")