convert HDLState.get_mem() to a dictionary of memory state results
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 21 Sep 2021 14:46:16 +0000 (15:46 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 21 Sep 2021 14:46:23 +0000 (15:46 +0100)
src/soc/simple/test/teststate.py

index 37a2ebb914d01dd586dd80a82d184f52d29f770b..3a65c9dc7628f27c72963392c72470e003411777 100644 (file)
@@ -52,10 +52,10 @@ class HDLState(State):
     def get_mem(self):
         # get the underlying HDL-simulated memory from the L0CacheBuffer
         hdlmem = get_l0_mem(self.core.l0)
-        self.mem = []
+        self.mem = {}
         for i in range(hdlmem.depth):
             value = yield hdlmem._array[i] # should not really do this
-            self.mem.append(((i*8), value))
+            self.mem[i*8] = value
 
 
 # add to State Factory