Skip to content

Commit

Permalink
Update fifoConcurrentAssertionTest.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrederikfhf committed Nov 28, 2020
1 parent 5edf081 commit 702ba17
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions assertion/src/test/scala/fifoConcurrentAssertionTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,52 @@ import chiseltest._
}
}

it should "test if" in {
it should "test if assertions listed in test works simple circumstances" in {
test(new BubbleFifo(32, 8)) {
dut => {
val w = 0
dut.io.deq.read.poke(false.B)
dut.io.enq.write.poke(true.B)
dut.io.enq.din.poke(4.U)
val s = assertEventually(dut, () => dut.io.deq.dout.peek.litValue == 4, 8, "Error")
val t = assertEventuallyAlways(dut, () => dut.io.deq.dout.peek.litValue == 4, 8, "Error")
val p = assertOnCycle(dut, () => dut.io.deq.dout.peek.litValue == 4, 8, "Error")
s.join
t.join
p.join
}
}
}
it should "FAIL: test if assertOnCycle fails" in {
test(new BubbleFifo(32, 8)) {
dut => {
val w = 0
dut.io.deq.read.poke(false.B)
dut.io.enq.write.poke(true.B)
dut.io.enq.din.poke(4.U)
val p = assertOnCycle(dut, () => dut.io.deq.dout.peek.litValue == 4, 7, "Shoud fail, no probs")
p.join
}
}
}
it should "FAIL: test if assertions EventuallyAlways fails under" in {
test(new BubbleFifo(32, 8)) {
dut => {
val w = 0
dut.io.deq.read.poke(false.B)
dut.io.enq.write.poke(false.B)
dut.io.enq.din.poke(4.U)
val t = assertEventuallyAlways(dut, () => dut.io.deq.notReady.peek.litValue == 1, 20, "Error")
dut.clock.step(1)
dut.io.deq.read.poke(true.B)
dut.io.enq.write.poke(false.B)
dut.clock.step(8)
dut.io.deq.read.poke(false.B)
dut.io.enq.write.poke(false.B)
t.join
}
}
}




Expand Down

0 comments on commit 702ba17

Please sign in to comment.