mirror of
https://github.com/myhdl/myhdl.git
synced 2024-12-14 07:44:38 +08:00
make it work with 2.3 and 2.2
This commit is contained in:
parent
19c6397087
commit
febac06c8d
@ -37,10 +37,10 @@ from Cosimulation import Cosimulation
|
||||
from join import join
|
||||
from _Waiter import _Waiter
|
||||
from util import StopSimulation, SuspendSimulation
|
||||
try:
|
||||
import simrunc
|
||||
except:
|
||||
pass
|
||||
## try:
|
||||
## import simrunc
|
||||
## except:
|
||||
## pass
|
||||
|
||||
|
||||
schedule = _futureEvents.append
|
||||
|
@ -261,7 +261,9 @@ class intbv(object):
|
||||
self._val %= other
|
||||
return self
|
||||
|
||||
def __ipow__(self, other, modulo): # XXX why 3rd param required?
|
||||
def __ipow__(self, other, modulo=None):
|
||||
# XXX why 3rd param required?
|
||||
# unused but needed in 2.2, not in 2.3
|
||||
if type(other) is intbv:
|
||||
self._val **= other._val
|
||||
else:
|
||||
|
@ -261,11 +261,11 @@ class TestIntBvAsInt(TestCase):
|
||||
def binaryCheck(self, op, imin=0, imax=None, jmin=0, jmax=None):
|
||||
self.seqSetup(imin=imin, imax=imax, jmin=jmin, jmax=jmax)
|
||||
for i, j in zip(self.seqi, self.seqj):
|
||||
bi = intbv(i)
|
||||
bi = intbv(long(i))
|
||||
bj = intbv(j)
|
||||
ref = op(i, j)
|
||||
ref = op(long(i), j)
|
||||
r1 = op(bi, j)
|
||||
r2 = op(i, bj)
|
||||
r2 = op(long(i), bj)
|
||||
r3 = op(bi, bj)
|
||||
self.assertEqual(type(r1), intbv)
|
||||
self.assertEqual(type(r2), intbv)
|
||||
@ -278,13 +278,13 @@ class TestIntBvAsInt(TestCase):
|
||||
self.seqSetup(imin=imin, imax=imax, jmin=jmin, jmax=jmax)
|
||||
for i, j in zip(self.seqi, self.seqj):
|
||||
bj = intbv(j)
|
||||
ref = i
|
||||
ref = long(i)
|
||||
exec("ref %s j" % op)
|
||||
r1 = bi1 = intbv(i)
|
||||
r1 = bi1 = intbv(long(i))
|
||||
exec("r1 %s j" % op)
|
||||
r2 = i
|
||||
r2 = long(i)
|
||||
exec("r2 %s bj" % op)
|
||||
r3 = bi3 = intbv(i)
|
||||
r3 = bi3 = intbv(long(i))
|
||||
exec("r3 %s bj" % op)
|
||||
self.assertEqual(type(r1), intbv)
|
||||
self.assertEqual(type(r3), intbv)
|
||||
|
Loading…
x
Reference in New Issue
Block a user