Skip to content

Commit 0502fa5

Browse files
committed
cleanup test #6
1 parent edf1e19 commit 0502fa5

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

test/test.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,37 +160,29 @@ async def test_enabled_with_window_close_no_start_with_pat_twice_then_expire(dut
160160
assert dut.uo_out.value == 0b1011_1100
161161

162162
@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."
164165
dut._log.info("Start")
165166

166167
# Set the clock period to 100 ns (10 MHz)
167168
clock = Clock(dut.clk, 100, units="ns")
168169
cocotb.start_soon(clock.start())
169170

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.
175171
tqv = TinyQV(dut)
176-
177-
# Reset
178172
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.")
181174

182175
# WINDOW_START
183176
await tqv.write_word_reg(1, 25)
184177
# WINDOW_CLOSE
185178
await tqv.write_word_reg(2, 50)
186-
# ENABLE
187-
await tqv.write_word_reg(0, 0x1)
188179

189180
# 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)
192182
# assign uo_out = {interrupt_high, interrupt_low, saw_pat, watchdog_enabled, after_window_start, after_window_close, 2'b00};
193183
assert dut.uo_out.value != 0b1001_1100
184+
assert dut.uo_out.value == 0b0100_0000
185+
194186

195187
@cocotb.test()
196188
async def test_enabled_with_window_close_no_pat(dut):

0 commit comments

Comments
 (0)