コード例 #1
0
ファイル: test_Signal.py プロジェクト: Cadavis8/myhdl
 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)
コード例 #2
0
ファイル: test_Signal.py プロジェクト: vaizguy/myhdl-python
 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)
コード例 #3
0
 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
     assert set(waiters) == set(expected)
     assert s1._eventWaiters == []
     assert s1._posedgeWaiters == self.posedgeWaiters
     assert s1._negedgeWaiters == self.negedgeWaiters
コード例 #4
0
 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
     assert set(waiters) == set(expected)
     assert s1._eventWaiters == []
     assert s1._posedgeWaiters == self.posedgeWaiters
     assert s1._negedgeWaiters == []
コード例 #5
0
ファイル: test_Signal.py プロジェクト: Cadavis8/myhdl
 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)
コード例 #6
0
ファイル: test_Signal.py プロジェクト: Cadavis8/myhdl
 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, [])
コード例 #7
0
ファイル: test_Signal.py プロジェクト: Aravind-Suresh/myhdl
 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
コード例 #8
0
 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
     self.assertEqual(set(waiters), set(expected))
     self.assertEqual(s1._eventWaiters, [])
     self.assertEqual(s1._posedgeWaiters, [])
     self.assertEqual(s1._negedgeWaiters, self.negedgeWaiters)
コード例 #9
0
ファイル: test_Signal.py プロジェクト: vaizguy/myhdl-python
 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
     waiters.sort()
     expected.sort()
     self.assertEqual(waiters, expected)
     self.assertEqual(s1._eventWaiters, [])
     self.assertEqual(s1._posedgeWaiters, self.posedgeWaiters)
     self.assertEqual(s1._negedgeWaiters, self.negedgeWaiters)