diff --git a/src/main/scala/chisel3/tester/DecoupledDriver.scala b/src/main/scala/chisel3/tester/DecoupledDriver.scala index b19f2b0f9..afa94af21 100644 --- a/src/main/scala/chisel3/tester/DecoupledDriver.scala +++ b/src/main/scala/chisel3/tester/DecoupledDriver.scala @@ -6,7 +6,7 @@ import chisel3._ import chisel3.util._ // implicit class, cannot maintain state -class DecoupledDriver[T <: Data](x: DecoupledIO[T]) { +class DecoupledDriver[T <: Data](x: ReadyValidIO[T]) { // Source (enqueue) functions // def initSource(): this.type = { diff --git a/src/main/scala/chisel3/tester/package.scala b/src/main/scala/chisel3/tester/package.scala index 5c500bda5..d36b9afe1 100644 --- a/src/main/scala/chisel3/tester/package.scala +++ b/src/main/scala/chisel3/tester/package.scala @@ -171,7 +171,7 @@ package object tester { } } - implicit def decoupledToDriver[T <: Data](x: DecoupledIO[T]) = new DecoupledDriver(x) + implicit def decoupledToDriver[T <: Data](x: ReadyValidIO[T]) = new DecoupledDriver(x) implicit def validToDriver[T <: Data](x: ValidIO[T]) = new ValidDriver(x) } diff --git a/src/test/scala/chisel3/tests/QueueTest.scala b/src/test/scala/chisel3/tests/QueueTest.scala index b483c3b4d..9905814d9 100644 --- a/src/test/scala/chisel3/tests/QueueTest.scala +++ b/src/test/scala/chisel3/tests/QueueTest.scala @@ -4,6 +4,8 @@ import org.scalatest._ import chisel3._ import chisel3.tester._ +import chisel3.util._ + class QueueTest extends FlatSpec with ChiselScalatestTester { behavior of "Testers2 with Queue" @@ -57,4 +59,22 @@ class QueueTest extends FlatSpec with ChiselScalatestTester { }.join() } } + + it should "work with IrrevocableIO" in{ + test(new Module{ + val io = IO(new Bundle{ + val in = Flipped(Irrevocable(UInt(8.W))) + val out = Irrevocable(UInt(8.W)) + }) + io.out <> Queue(io.in) + }){c => + c.io.in.initSource().setSourceClock(c.clock) + c.io.out.initSink().setSinkClock(c.clock) + parallel( + c.io.in.enqueueSeq(Seq(5.U, 2.U)), + c.io.out.expectDequeueSeq(Seq(5.U, 2.U)) + ) + } + } + }