sim/core: fix Cat bitshift
This commit is contained in:
parent
28962ff438
commit
6d6f91a02b
|
@ -156,10 +156,11 @@ class Evaluator:
|
||||||
value -= 2**node.nbits
|
value -= 2**node.nbits
|
||||||
self.modifications[node] = value
|
self.modifications[node] = value
|
||||||
elif isinstance(node, Cat):
|
elif isinstance(node, Cat):
|
||||||
|
nbits = 0
|
||||||
for element in node.l:
|
for element in node.l:
|
||||||
|
value >>= nbits
|
||||||
nbits = len(element)
|
nbits = len(element)
|
||||||
self.assign(element, value & (2**nbits-1))
|
self.assign(element, value & (2**nbits-1))
|
||||||
value >>= nbits
|
|
||||||
elif isinstance(node, _Slice):
|
elif isinstance(node, _Slice):
|
||||||
full_value = self.eval(node.value, True)
|
full_value = self.eval(node.value, True)
|
||||||
# clear bits assigned to by the slice
|
# clear bits assigned to by the slice
|
||||||
|
|
Loading…
Reference in New Issue