from openpower.decoder.power_decoder2 import PowerDecode2, get_rdflags
from openpower.decoder.power_enums import Function
from openpower.decoder.isa.all import ISA
+from openpower.decoder.isa.mem import Mem
from soc.experiment.compalu_multi import find_ok # hack
from soc.config.test.test_loadstore import TestMemPspec
return mem.mem
-def setup_tst_memory(l0, sim):
+def setup_tst_memory(l0, test_mem):
+ # create independent Sim Mem from test values
+ sim_mem = Mem(initial_mem=test_mem)
mem = get_l0_mem(l0)
print("before, init mem", mem.depth, mem.width, mem)
for i in range(mem.depth):
- data = sim.mem.ld(i*8, 8, False)
+ data = sim_mem.ld(i*8, 8, False)
print("init ", i, hex(data))
yield mem._array[i].eq(data)
yield Settle()
- for k, v in sim.mem.mem.items():
+ for k, v in sim_mem.mem.items():
print(" %6x %016x" % (k, v))
print("before, nmigen mem dump")
for i in range(mem.depth):
# initialise memory
if self.funit == Function.LDST:
- yield from setup_tst_memory(l0, sim)
+ yield from setup_tst_memory(l0, test.mem)
pc = sim.pc.CIA.value
index = pc//4
gen = program.generate_instructions()
instructions = list(zip(gen, program.assembly.splitlines()))
- yield from setup_tst_memory(l0, sim)
+ yield from setup_tst_memory(l0, test.mem)
yield from setup_regs(core, test)
index = sim.pc.CIA.value // 4
from soc.simple.test.test_core import (setup_regs, check_regs,
wait_for_busy_clear,
wait_for_busy_hi)
-from soc.fu.compunits.test.test_compunit import (setup_tst_memory,
- check_sim_memory,
+from soc.fu.compunits.test.test_compunit import (check_sim_memory,
get_l0_mem)
from soc.simple.test.test_runner import setup_i_memory
# blech! put the same listing into the data memory
data_mem = get_l0_mem(l0)
yield from setup_i_memory(data_mem, pc, instructions)
- # yield from setup_tst_memory(l0, sim)
yield from setup_regs(core, test)
yield pc_i.eq(pc)
counter = 0 # test to pause/start
yield from setup_i_memory(imem, pc, instructions)
- yield from setup_tst_memory(l0, sim)
+ yield from setup_tst_memory(l0, test.mem)
yield from setup_regs(pdecode2, core, test)
# set PC and SVSTATE