Skip to content

Commit

Permalink
Move off old m.bit_vectorg
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed Oct 15, 2018
1 parent ccf9ec4 commit e447855
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions silica/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import magma as m
from magma import Bit, zext, concat, Array, Bits, UInt
from magma.bit_vector import BitVector
from bit_vector import BitVector
import bit_vector
import operator


Expand All @@ -16,12 +17,12 @@ def __repr__(self):

class Memory(list):
def __getitem__(self, key):
if isinstance(key, m.bit_vector.BitVector):
if isinstance(key, bit_vector.BitVector):
key = key.as_int()
return super().__getitem__(key)

def __setitem__(self, key, value):
if isinstance(key, m.bit_vector.BitVector):
if isinstance(key, bit_vector.BitVector):
key = key.as_int()
return super().__setitem__(key, value)

Expand All @@ -42,7 +43,7 @@ def zext(value, n):
return BitVector(value, num_bits=n + value.num_bits)

def add(a, b, cout=False):
assert isinstance(a, m.bit_vector.BitVector) and isinstance(b, m.bit_vector.BitVector)
assert isinstance(a, bit_vector.BitVector) and isinstance(b, bit_vector.BitVector)
assert len(a) == len(b)
if cout:
width = len(a)
Expand Down

0 comments on commit e447855

Please sign in to comment.