initialise L0 Memory from simulator memory
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 6 Jun 2020 18:34:16 +0000 (19:34 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 6 Jun 2020 18:34:16 +0000 (19:34 +0100)
src/soc/fu/compunits/test/test_compunit.py

index b32f43da748f2ac0b999eaebfbca3f862aec6df3..602a99843a6e563e51b93084bbbd98ee4892535d 100644 (file)
@@ -146,6 +146,16 @@ class TestRunner(FHDLTestCase):
                 gen = program.generate_instructions()
                 instructions = list(zip(gen, program.assembly.splitlines()))
 
+                # initialise memory
+                if self.funit == Function.LDST:
+                    mem = l0.mem.mem
+                    memlist = []
+                    for i in range(mem.depth):
+                        memlist.append(sim.mem.ld(i*8, 8))
+                    mem.init = memlist
+                    print (mem, mem.depth, mem.width)
+                    print ("mem init", list(map(hex,memlist)))
+
                 index = sim.pc.CIA.value//4
                 while index < len(instructions):
                     ins, code = instructions[index]