forked from cirosantilli/vcdvcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
executable file
·32 lines (28 loc) · 845 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
import unittest
from vcdvcd import VCDVCD
class Test(unittest.TestCase):
def test_data(self):
vcd = VCDVCD('counter_tb.vcd')
signal = vcd['counter_tb.out[1:0]']
self.assertEqual(
signal.tv[:6],
[
( 0, 'x'),
( 2, '0'),
( 6, '1'),
( 8, '10'),
(10, '11'),
(12, '0'),
]
)
self.assertEqual(signal[0], 'x')
self.assertEqual(signal[1], 'x')
self.assertEqual(signal[2], '0')
self.assertEqual(signal[3], '0')
self.assertEqual(signal[6], '1')
self.assertEqual(signal[7], '1')
self.assertEqual(signal[24], '10')
self.assertEqual(signal[25], '10')
if __name__ == '__main__':
unittest.main()