sim: fix slice assign
authorSebastien Bourdeauducq <sb@m-labs.hk>
Tue, 22 Sep 2015 12:33:44 +0000 (20:33 +0800)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Tue, 22 Sep 2015 12:33:44 +0000 (20:33 +0800)
migen/sim/core.py

index c9da09ccf52acb81e96cfd52f7b5c49c8eb927d8..e9d3c5608c96e130f0f5c122b52efe9b679f0e97 100644 (file)
@@ -162,13 +162,13 @@ class Evaluator:
                 self.assign(element, value & (2**nbits-1))
                 value >>= nbits
         elif isinstance(node, _Slice):
-            full_value = self.eval(node, True)
+            full_value = self.eval(node.value, True)
             # clear bits assigned to by the slice
             full_value &= ~((2**node.stop-1) - (2**node.start-1))
             # set them to the new value
             value &= 2**(node.stop - node.start)-1
             full_value |= value << node.start
-            self.assign(node, full_value)
+            self.assign(node.value, full_value)
         elif isinstance(node, _ArrayProxy):
             self.assign(node.choices[self.eval(node.key)], value)
         elif isinstance(node, _MemoryLocation):