本文整理匯總了Python中myhdl.Signal.next[k:]方法的典型用法代碼示例。如果您正苦於以下問題:Python Signal.next[k:]方法的具體用法?Python Signal.next[k:]怎麽用?Python Signal.next[k:]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類myhdl.Signal
的用法示例。
在下文中一共展示了Signal.next[k:]方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testSliceAssign
# 需要導入模塊: from myhdl import Signal [as 別名]
# 或者: from myhdl.Signal import next[k:] [as 別名]
def testSliceAssign(self):
s = Signal(intbv(min=-24, max=34))
for i in (-24, -2, 13, 33):
for k in (6, 9, 10):
s.next[:] = 0
s.next[k:] = i
self.assertEqual(s.next, i)
for i in (-25, -128, 34, 35, 229):
for k in (0, 9, 10):
try:
s.next[k:] = i
# s._update()
except ValueError:
pass
else:
self.fail()
s = Signal(intbv(5)[8:])
for v in (0, 2**8-1, 100):
s.next[:] = v
for v in (-1, 2**8, -10, 1000):
try:
s.next[:] = v
# s._update()
except ValueError:
pass
else:
self.fail()
示例2: testSliceAssign
# 需要導入模塊: from myhdl import Signal [as 別名]
# 或者: from myhdl.Signal import next[k:] [as 別名]
def testSliceAssign(self):
s = Signal(intbv(min=-24, max=34))
for i in (-24, -2, 13, 33):
for k in (6, 9, 10):
s.next[:] = 0
s.next[k:] = i
assert s.next == i
for i in (-25, -128, 34, 35, 229):
for k in (0, 9, 10):
with pytest.raises(ValueError):
s.next[k:] = i
s = Signal(intbv(5)[8:])
for v in (0, 2**8-1, 100):
s.next[:] = v
for v in (-1, 2**8, -10, 1000):
with pytest.raises(ValueError):
s.next[:] = v