当前位置: 首页>>代码示例>>Python>>正文


Python Signal._update方法代码示例

本文整理汇总了Python中myhdl.Signal._update方法的典型用法代码示例。如果您正苦于以下问题:Python Signal._update方法的具体用法?Python Signal._update怎么用?Python Signal._update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在myhdl.Signal的用法示例。


在下文中一共展示了Signal._update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testUpdateNoEvent

# 需要导入模块: from myhdl import Signal [as 别名]
# 或者: from myhdl.Signal import _update [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 _update [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 _update [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 _update [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._update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。