From: Srikant Bharadwaj Date: Tue, 16 Jul 2019 20:34:31 +0000 (-0400) Subject: mem-garnet: Add a check to see if router is already scheduled X-Git-Tag: v20.1.0.0~129 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=028a1fa87ec8a5c8e1c1bcdca0bb0d72daaefb16;p=gem5.git mem-garnet: Add a check to see if router is already scheduled Currently the Switch Allocator takes up most of the simulation wall clock time. This function checks for all VCs to see if it should wakeup next. The input units which are simulated before the switch allocator could have scheduled it already. This patch adds a check for it. Change-Id: I8609d4e7f925aa5e97198f6cd07466530f6fcf4c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32600 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc index 144f2085b..324134306 100644 --- a/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc +++ b/src/mem/ruby/network/garnet2.0/SwitchAllocator.cc @@ -350,6 +350,10 @@ SwitchAllocator::check_for_wakeup() { Tick nextCycle = m_router->clockEdge(Cycles(1)); + if (m_router->alreadyScheduled(nextCycle)) { + return; + } + for (int i = 0; i < m_num_inports; i++) { for (int j = 0; j < m_num_vcs; j++) { if (m_router->getInputUnit(i)->need_stage(j, SA_, nextCycle)) {