summaryrefslogtreecommitdiff
path: root/src/mem/cache/cache.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-09-25 07:13:54 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2015-09-25 07:13:54 -0400
commit462c288a757bc4fd50324ebe2f1fd697d53838ab (patch)
tree02cc70a4d0682136b458ee59d5c9dad0dfdec00a /src/mem/cache/cache.hh
parent3bd78a141ec60ae65d910286c3d99ae7030ba703 (diff)
downloadgem5-462c288a757bc4fd50324ebe2f1fd697d53838ab.tar.xz
mem: Make the coherent crossbar account for timing snoops
This patch introduces the concept of a snoop latency. Given the requirement to snoop and forward packets in zero time (due to the coherency mechanism), the latency is accounted for later. On a snoop, we establish the latency, and later add it to the header delay of the packet. To allow multiple caches to contribute to the snoop latency, we use a separate variable in the packet, and then take the maximum before adding it to the header delay.
Diffstat (limited to 'src/mem/cache/cache.hh')
-rw-r--r--src/mem/cache/cache.hh17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mem/cache/cache.hh b/src/mem/cache/cache.hh
index 3d439caa7..577eab664 100644
--- a/src/mem/cache/cache.hh
+++ b/src/mem/cache/cache.hh
@@ -300,12 +300,19 @@ class Cache : public BaseCache
bool already_copied, bool pending_inval);
/**
- * Sets the blk to the new state.
- * @param blk The cache block being snooped.
- * @param new_state The new coherence state for the block.
+ * Perform an upward snoop if needed, and update the block state
+ * (possibly invalidating the block). Also create a response if required.
+ *
+ * @param pkt Snoop packet
+ * @param blk Cache block being snooped
+ * @param is_timing Timing or atomic for the response
+ * @param is_deferred Is this a deferred snoop or not?
+ * @param pending_inval Do we have a pending invalidation?
+ *
+ * @return The snoop delay incurred by the upwards snoop
*/
- void handleSnoop(PacketPtr ptk, CacheBlk *blk,
- bool is_timing, bool is_deferred, bool pending_inval);
+ uint32_t handleSnoop(PacketPtr pkt, CacheBlk *blk,
+ bool is_timing, bool is_deferred, bool pending_inval);
/**
* Create a writeback request for the given block.