From 1fa2e367402fb16eca90f9c42b2a8c3df29693b0 Mon Sep 17 00:00:00 2001 From: Hansung Kim Date: Thu, 4 May 2023 16:38:38 -0700 Subject: [PATCH] Add global enable to coalescer config --- src/main/scala/tilelink/Coalescing.scala | 10 +++++++--- src/test/scala/coalescing/CoalescingUnitTest.scala | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) 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,