Skip to content

Commit

Permalink
Update python simulator to return BitVector instead of bool list
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Aug 2, 2018
1 parent 3c2a31b commit 9942fab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions magma/simulator/python_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ def value_initialized(self, bit):

def get_value(self, bit):
if isinstance(bit, ArrayType):
return [self.get_value(b) for b in bit]
return BitVector([self.get_value(b) for b in bit])

if bit.isinput():
bit = bit.value()

if bit.const():
return True if bit is VCC else False
return BitVector(True, 1) if bit is VCC else BitVector(False, 1)

return self.value_map[bit]
return BitVector(self.value_map[bit], 1)

def set_value(self, bit, newval):
if isinstance(bit, ArrayType):
Expand Down

0 comments on commit 9942fab

Please sign in to comment.