illegal = name != asmop
if illegal:
- print ("name %s != %s - calling ILLEGAL trap" % (name, asmop))
self.TRAP(0x700, PI.ILLEG)
self.namespace['NIA'] = self.trap_nia
self.pc.update(self.namespace)
+ print ("name %s != %s - calling ILLEGAL trap, PC: %x" % \
+ (name, asmop, self.pc.CIA.value))
return
info = self.instrs[name]
instructions = list(zip(gen, insncode))
sim = ISA(simdec2, test.regs, test.sprs, test.cr, test.mem,
test.msr,
- initial_insns=gen, respect_pc=False,
+ initial_insns=gen, respect_pc=True,
disassembly=insncode,
bigendian=self.bigendian)
yield from setup_test_memory(l0, sim)
index = sim.pc.CIA.value//4
+ msr = sim.msr.value
while True:
+ print("instr index", index)
try:
yield from sim.setup_one()
except KeyError: # indicates instruction not in imem: stop
# ask the decoder to decode this binary data (endian'd)
yield pdecode2.dec.bigendian.eq(self.bigendian) # le / be?
+ yield pdecode2.msr.eq(msr)
yield instruction.eq(ins) # raw binary instr.
yield Settle()
fn_unit = yield pdecode2.e.do.fn_unit
yield from sim.execute_one()
yield Settle()
index = sim.pc.CIA.value//4
+ msr = sim.msr.value
# get all outputs (one by one, just "because")
res = yield from get_cu_outputs(cu, code)
from soc.fu.test.common import ALUHelpers
from soc.fu.compunits.compunits import TrapFunctionUnit
from soc.fu.compunits.test.test_compunit import TestRunner
-
+from soc.config.endian import bigendian
class TrapTestRunner(TestRunner):
def __init__(self, test_data):
super().__init__(test_data, TrapFunctionUnit, self,
- Function.TRAP)
+ Function.TRAP, bigendian)
def get_cu_inputs(self, dec2, sim):
"""naming (res) must conform to TrapFunctionUnit input regspec