@@ -160,37 +160,29 @@ async def test_enabled_with_window_close_no_start_with_pat_twice_then_expire(dut
160
160
assert dut .uo_out .value == 0b1011_1100
161
161
162
162
@cocotb .test ()
163
- async def test_enabled_with_window_close_and_start_not_enabled (dut ):
163
+ async def test_enabled_with_window_close_and_open_not_enabled_no_trigger (dut ):
164
+ "Setting WINDOW_OPEN and WINDOW_CLOSE and not enabling it should result in no trigger."
164
165
dut ._log .info ("Start" )
165
166
166
167
# Set the clock period to 100 ns (10 MHz)
167
168
clock = Clock (dut .clk , 100 , units = "ns" )
168
169
cocotb .start_soon (clock .start ())
169
170
170
- # Interact with your design's registers through this TinyQV class.
171
- # This will allow the same test to be run when your design is integrated
172
- # with TinyQV - the implementation of this class will be replaces with a
173
- # different version that uses Risc-V instructions instead of the SPI
174
- # interface to read and write the registers.
175
171
tqv = TinyQV (dut )
176
-
177
- # Reset
178
172
await tqv .reset ()
179
-
180
- dut ._log .info ("Test project behavior" )
173
+ dut ._log .info ("Setting WINDOW_OPEN and WINDOW_CLOSE and not enabling it should result in no trigger." )
181
174
182
175
# WINDOW_START
183
176
await tqv .write_word_reg (1 , 25 )
184
177
# WINDOW_CLOSE
185
178
await tqv .write_word_reg (2 , 50 )
186
- # ENABLE
187
- await tqv .write_word_reg (0 , 0x1 )
188
179
189
180
# wait longer than the watchdog is set for to see if it triggers.
190
- await ClockCycles (dut .clk , 25 )
191
-
181
+ await ClockCycles (dut .clk , 35 )
192
182
# assign uo_out = {interrupt_high, interrupt_low, saw_pat, watchdog_enabled, after_window_start, after_window_close, 2'b00};
193
183
assert dut .uo_out .value != 0b1001_1100
184
+ assert dut .uo_out .value == 0b0100_0000
185
+
194
186
195
187
@cocotb .test ()
196
188
async def test_enabled_with_window_close_no_pat (dut ):
0 commit comments