diff --git a/src/main/scala/tilelink/Coalescing.scala b/src/main/scala/tilelink/Coalescing.scala index 72a6fb1..7c115a9 100644 --- a/src/main/scala/tilelink/Coalescing.scala +++ b/src/main/scala/tilelink/Coalescing.scala @@ -36,6 +36,7 @@ object DefaultInFlightTableSizeEnum extends InFlightTableSizeEnum { } case class CoalescerConfig( + enable: Boolean, // globally enable or disable coalescing numLanes: Int, // number of lanes (or threads) in a warp queueDepth: Int, // request window per lane waitTimeout: Int, // max cycles to wait before forced fifo dequeue, per lane @@ -60,6 +61,7 @@ case class CoalescerConfig( object defaultConfig extends CoalescerConfig( + enable = true, numLanes = 4, queueDepth = 1, waitTimeout = 8, @@ -528,9 +530,11 @@ class MultiCoalescer(windowT: CoalShiftQueue[ReqQueueEntry], coalReqT: ReqQueueE dontTouch(io.invalidate) // debug - // uncomment the following lines to disable coalescing entirely - // io.outReq.valid := false.B - // io.invalidate.valid := false.B + def disable = { + io.coalReq.valid := false.B + io.invalidate.valid := false.B + } + if (!config.enable) disable } class CoalescingUnitImp(outer: CoalescingUnit, config: CoalescerConfig) extends LazyModuleImp(outer) { diff --git a/src/test/scala/coalescing/CoalescingUnitTest.scala b/src/test/scala/coalescing/CoalescingUnitTest.scala index 8f4a77e..585d412 100644 --- a/src/test/scala/coalescing/CoalescingUnitTest.scala +++ b/src/test/scala/coalescing/CoalescingUnitTest.scala @@ -169,6 +169,7 @@ class DummyCoalescingUnitTBImp(outer: DummyCoalescingUnitTB) extends LazyModuleI } object testConfig extends CoalescerConfig( + enable = true, numLanes = 4, queueDepth = 1, waitTimeout = 8, @@ -646,6 +647,7 @@ class CoalShiftQueueTest extends AnyFlatSpec with ChiselScalatestTester { } object uncoalescerTestConfig extends CoalescerConfig( + enable = true, numLanes = 4, queueDepth = 2, waitTimeout = 8,