summaryrefslogtreecommitdiff
path: root/src/mem/cache/coherence/uni_coherence.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/cache/coherence/uni_coherence.cc')
-rw-r--r--src/mem/cache/coherence/uni_coherence.cc30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/mem/cache/coherence/uni_coherence.cc b/src/mem/cache/coherence/uni_coherence.cc
index 0efe393f9..751de4801 100644
--- a/src/mem/cache/coherence/uni_coherence.cc
+++ b/src/mem/cache/coherence/uni_coherence.cc
@@ -43,20 +43,30 @@ UniCoherence::UniCoherence()
Packet *
UniCoherence::getPacket()
{
- bool unblock = cshrs.isFull();
Packet* pkt = cshrs.getReq();
- cshrs.markInService((MSHR*)pkt->senderState);
- if (!cshrs.havePending()) {
- cache->clearSlaveRequest(Request_Coherence);
- }
- if (unblock) {
- //since CSHRs are always used as buffers, should always get rid of one
- assert(!cshrs.isFull());
- cache->clearBlocked(Blocked_Coherence);
- }
return pkt;
}
+void
+UniCoherence::sendResult(Packet * &pkt, MSHR* cshr, bool success)
+{
+ if (success)
+ {
+ bool unblock = cshrs.isFull();
+ cshrs.markInService(cshr);
+ if (!cshrs.havePending()) {
+ cache->clearSlaveRequest(Request_Coherence);
+ }
+ cshrs.deallocate(cshr);
+ if (unblock) {
+ //since CSHRs are always used as buffers, should always get rid of one
+ assert(!cshrs.isFull());
+ cache->clearBlocked(Blocked_Coherence);
+ }
+ }
+}
+
+
/**
* @todo add support for returning slave requests, not doing them here.
*/