test/SyncFIFOCase: better test bench termination

This commit is contained in:
Robert Jordens 2014-04-07 00:04:36 +02:00 committed by Sebastien Bourdeauducq
parent e94f30f15d
commit ce378f47d3
1 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,11 @@ class SyncFIFOCase(SimCase, unittest.TestCase):
tbp.dut.re = tbp.simulator.cycle_counter % 3 == 0 tbp.dut.re = tbp.simulator.cycle_counter % 3 == 0
# the output if valid must be correct # the output if valid must be correct
if tbp.dut.readable and tbp.dut.re: if tbp.dut.readable and tbp.dut.re:
i = seq.pop(0) try:
i = seq.pop(0)
except IndexError:
print(tbp.dut.level)
raise StopSimulation
self.assertEqual(tbp.dut.dout.a, i) self.assertEqual(tbp.dut.dout.a, i)
self.assertEqual(tbp.dut.dout.b, i*2) self.assertEqual(tbp.dut.dout.b, i*2)
self.run_with(cb, 20) self.run_with(cb)