Skip to content

Commit

Permalink
Make AsyncQueue use Rawmodule
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed May 16, 2023
1 parent 52f8f1d commit 8db7364
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/main/scala/util/AsyncQueue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,8 @@ object ToAsyncBundle

class AsyncQueue[T <: Data](gen: T, params: AsyncQueueParams = AsyncQueueParams()) extends Crossing[T] {
val io = IO(new CrossingIO(gen))
val source = Module(new AsyncQueueSource(gen, params))
val sink = Module(new AsyncQueueSink (gen, params))

source.clock := io.enq_clock
source.reset := io.enq_reset
sink.clock := io.deq_clock
sink.reset := io.deq_reset
val source = withClockAndReset(io.enq_clock, io.enq_reset) { Module(new AsyncQueueSource(gen, params)) }
val sink = withClockAndReset(io.deq_clock, io.deq_reset) { Module(new AsyncQueueSink (gen, params)) }

source.io.enq <> io.enq
io.deq <> sink.io.deq
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/util/Crossing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class CrossingIO[T <: Data](gen: T) extends Bundle {
val deq = Decoupled(gen)
}

abstract class Crossing[T <: Data] extends Module {
abstract class Crossing[T <: Data] extends RawModule {
val io: CrossingIO[T]
}

0 comments on commit 8db7364

Please sign in to comment.