move main python code to src directory
[soc.git] / src / TLB / test / test_lfsr.py
1 import sys
2 sys.path.append("../src")
3 sys.path.append("../../TestUtil")
4
5 from nmigen.compat.sim import run_simulation
6
7 from LFSR import LFSR
8
9 from test_helper import assert_eq, assert_ne, assert_op
10
11 def testbench(dut):
12 yield dut.enable.eq(1)
13 yield dut.o.eq(9)
14 yield
15 yield
16 yield
17 yield
18 yield
19 yield
20 yield
21 yield
22 yield
23 yield
24 yield
25 yield
26
27 if __name__ == "__main__":
28 dut = LFSR()
29 run_simulation(dut, testbench(dut), vcd_name="Waveforms/test_lfsr.vcd")
30 print("LFSR Unit Test Success")