1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

Merge from default

--HG--
branch : 0.9-dev
This commit is contained in:
Jan Decaluwe 2014-08-11 22:42:30 +02:00
commit ff28c3c2d0
2 changed files with 11 additions and 5 deletions

View File

@ -37,7 +37,10 @@ def concat(base, *args):
val = base
elif isinstance(base, _Signal):
basewidth = base._nrbits
val = base._val
if isinstance(base._val, intbv):
val = base._val._val
else:
val = base._val
elif isinstance(base, str):
basewidth = len(base)
val = long(base, 2)
@ -52,7 +55,10 @@ def concat(base, *args):
v = arg._val
elif isinstance(arg, _Signal):
w = arg._nrbits
v = arg._val
if isinstance(arg._val, intbv):
v = arg._val._val
else:
v = arg._val
elif isinstance(arg, bool):
w = 1
v = arg
@ -65,8 +71,8 @@ def concat(base, *args):
if not w:
raise TypeError, "concat: arg on pos %d should have length" % (i+1)
width += w
val = val*(2**w) + v
val = val << w | v & (1L << w)-1
if basewidth:
return intbv(val, _nrbits=basewidth + width)
else:

View File

@ -245,7 +245,7 @@ class CosimulationTest(TestCase):
cosim._getMode = 1
cosim._get()
for n in toSignames:
self.assertEqual(toSigs[n].next, None)
self.assertEqual(toSigs[n].next, 0)
def cosimToSignalVals(self):