當前位置: 首頁>>代碼示例>>Python>>正文


Python Signal._eventWaiters方法代碼示例

本文整理匯總了Python中myhdl.Signal._eventWaiters方法的典型用法代碼示例。如果您正苦於以下問題:Python Signal._eventWaiters方法的具體用法?Python Signal._eventWaiters怎麽用?Python Signal._eventWaiters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在myhdl.Signal的用法示例。


在下文中一共展示了Signal._eventWaiters方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testUpdateNoEvent

# 需要導入模塊: from myhdl import Signal [as 別名]
# 或者: from myhdl.Signal import _eventWaiters [as 別名]
 def testUpdateNoEvent(self):
     """ update without value change should not return event waiters """
     s1 = Signal(1)
     s1.next = 4
     s1._update()
     s1.next = 4
     s1._eventWaiters = self.eventWaiters[:]
     s1._posedgeWaiters = self.posedgeWaiters[:]
     s1._negedgeWaiters = self.negedgeWaiters[:]
     waiters = s1._update()
     self.assertEqual(waiters, [])
     self.assertEqual(s1._eventWaiters, self.eventWaiters)
     self.assertEqual(s1._posedgeWaiters, self.posedgeWaiters)
     self.assertEqual(s1._negedgeWaiters, self.negedgeWaiters)
開發者ID:Cadavis8,項目名稱:myhdl,代碼行數:16,代碼來源:test_Signal.py

示例2: testUpdateNegedge

# 需要導入模塊: from myhdl import Signal [as 別名]
# 或者: from myhdl.Signal import _eventWaiters [as 別名]
 def testUpdateNegedge(self):
     """ update on negedge should return event and negedge waiters """
     s1 = Signal(1)
     s1.next = 1
     s1._update()
     s1.next = 0
     s1._eventWaiters = self.eventWaiters[:]
     s1._posedgeWaiters = self.posedgeWaiters[:]
     s1._negedgeWaiters = self.negedgeWaiters[:]
     waiters = s1._update()
     expected = self.eventWaiters + self.negedgeWaiters
     self.assertEqual(set(waiters), set(expected))
     self.assertEqual(s1._eventWaiters, [])
     self.assertEqual(s1._posedgeWaiters, self.posedgeWaiters)
     self.assertEqual(s1._negedgeWaiters, [])
開發者ID:Cadavis8,項目名稱:myhdl,代碼行數:17,代碼來源:test_Signal.py

示例3: testUpdateEvent

# 需要導入模塊: from myhdl import Signal [as 別名]
# 或者: from myhdl.Signal import _eventWaiters [as 別名]
 def testUpdateEvent(self):
     """ update on non-edge event should return event waiters """
     s1 = Signal(1)
     s1.next = 4
     s1._update()
     s1.next = 5
     s1._eventWaiters = self.eventWaiters[:]
     s1._posedgeWaiters = self.posedgeWaiters[:]
     s1._negedgeWaiters = self.negedgeWaiters[:]
     waiters = s1._update()
     expected = self.eventWaiters
     self.assertEqual(set(waiters), set(expected))
     self.assertEqual(s1._eventWaiters, [])
     self.assertEqual(s1._posedgeWaiters, self.posedgeWaiters)
     self.assertEqual(s1._negedgeWaiters, self.negedgeWaiters)
開發者ID:Cadavis8,項目名稱:myhdl,代碼行數:17,代碼來源:test_Signal.py

示例4: testUpdatePosedge

# 需要導入模塊: from myhdl import Signal [as 別名]
# 或者: from myhdl.Signal import _eventWaiters [as 別名]
 def testUpdatePosedge(self):
     """ update on posedge should return event and posedge waiters """
     s1 = Signal(1)
     s1.next = 0
     s1._update()
     s1.next = 1
     s1._eventWaiters = self.eventWaiters[:]
     s1._posedgeWaiters = self.posedgeWaiters[:]
     s1._negedgeWaiters = self.negedgeWaiters[:]
     waiters = s1._update()
     expected = self.eventWaiters + self.posedgeWaiters
     assert set(waiters) == set(expected)
     assert s1._eventWaiters == []
     assert s1._posedgeWaiters == []
     assert s1._negedgeWaiters == self.negedgeWaiters
開發者ID:Aravind-Suresh,項目名稱:myhdl,代碼行數:17,代碼來源:test_Signal.py


注:本文中的myhdl.Signal._eventWaiters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。