@@ -102,31 +102,30 @@ async def test_project(dut):
102102 dut ._log .info ("Does the scan chain capture the input data ?" )
103103 dut .ui_in .value = 20 # 00010100
104104 await pulse (dut , SC_RESET , SC_GET )
105- # sc_dout should be 1 right ?
105+ # sc_dout should be 0 right ?
106106
107107 dut ._log .info ("Dumping the scan chain" )
108108 # Flush the chain. Fed with 1, should output 1s after 24*8 cycles
109109 await pulse8x (dut , 4 * 8 , SC_RESET + SC_DIN )
110110
111-
112- # fill the output port with 1s
111+ dut ._log .info ("fill the output port with 1s" )
113112 await pulse (dut , SC_RESET , SC_SET )
114113
115- # see if it works better now ?
114+ # it's not possible to "get" when the chain is all-1s
116115 await pulse (dut , SC_RESET , SC_GET )
117116
118-
117+ dut . _log . info ( "flush the chain, fill with 0s" )
119118 await pulse8x (dut , 4 * 8 , SC_RESET )
120119
121-
122120 # fill the output port with 0s
123121 await pulse (dut , SC_RESET , SC_SET )
124122
125- #dut.uio_in.value = SC_RESET + SC_SET
126- #await ClockCycles(dut.clk, 1)
127- #dut.uio_in.value = Count_Enable + SC_GET
128- #await ClockCycles(dut.clk, 1)
129- # Set the input values you want to test
130- #dut.ui_in.value = 20
131- #dut.uio_in.value = 30
132- # assert dut.uo_out.value == 50
123+ # let the LFSR run again a bit
124+ dut .uio_in .value = Count_Enable + SC_RESET
125+ dut ._log .info ("Let's see if the LFSR works." )
126+ await ClockCycles (dut .clk , 48 )
127+ dut ._log .info ("Sample more input data" )
128+ dut .ui_in .value = 235 # ~00010100
129+ await pulse (dut , SC_RESET , SC_GET )
130+ dut ._log .info ("flush the chain again, fill with 0s" )
131+ await pulse8x (dut , 4 * 8 , SC_RESET )
0 commit comments