summaryrefslogtreecommitdiff
path: root/src/base/intmath.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-07-09 12:35:35 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-07-09 12:35:35 -0400
commit14f9c77dd36fef8ab509bc17ecbe422555daa9c6 (patch)
treeab41774b5efb34fd0b72f06b5f1011cca9260538 /src/base/intmath.hh
parent46d9adb68c96b94ae25bbe92d34e375daf532ece (diff)
downloadgem5-14f9c77dd36fef8ab509bc17ecbe422555daa9c6.tar.xz
Bus: Replace tickNextIdle and inRetry with a state variable
This patch adds a state enum and member variable in the bus, tracking the bus state, thus eliminating the need for tickNextIdle and inRetry, and fixing an issue that allowed the bus to be occupied by multiple packets at once (hopefully it also makes it easier to understand the code). The bus, in its current form, uses tickNextIdle and inRetry to keep track of the state of the bus. However, it only updates tickNextIdle _after_ forwarding a packet using sendTiming, and the result is that the bus is still seen as idle, and a module that receives the packet and starts transmitting new packets in zero time will still see the bus as idle (and this is done by a number of DMA devices). The issue can also be seen in isOccupied where the bus calls reschedule on an event instead of schedule. This patch addresses the problem by marking the bus as _not_ idle already by the time we conclude that the bus is not occupied and we will deal with the packet. As a result of not allowing multiple packets to occupy the bus, some regressions have slight changes in their statistics. A separate patch updates these accordingly. Further ahead, a follow-on patch will introduce a separate state variable for request/responses/snoop responses, and thus implement a split request/response bus with separate flow control for the different message types (even further ahead it will introduce a multi-layer bus).
Diffstat (limited to 'src/base/intmath.hh')
-rw-r--r--src/base/intmath.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base/intmath.hh b/src/base/intmath.hh
index b8c83f05a..f46133764 100644
--- a/src/base/intmath.hh
+++ b/src/base/intmath.hh
@@ -193,9 +193,9 @@ ceilPow2(T n)
return (T)1 << ceilLog2(n);
}
-template <class T>
+template <class T, class U>
inline T
-divCeil(T a, T b)
+divCeil(const T& a, const U& b)
{
return (a + b - 1) / b;
}