}
void resetFlags() {
- onlyWrites = true;
+ canMergeWrites = true;
std::fill(writesBitmap.begin(), writesBitmap.end(), false);
needsWritable = false;
*
* @param pkt Packet considered for adding
*/
- void updateWriteFlags(PacketPtr pkt) {
- const Request::FlagsType noMergeFlags =
- Request::UNCACHEABLE |
- Request::STRICT_ORDER | Request::MMAPPED_IPR |
- Request::PRIVILEGED | Request::LLSC |
- Request::MEM_SWAP | Request::MEM_SWAP_COND |
- Request::SECURE;
-
- // if we have already seen writes for the full block stop
- // here, this might be a full line write followed by
- // other compatible requests (e.g., reads)
- if (!isWholeLineWrite()) {
- bool can_merge_write = pkt->isWrite() &&
- ((pkt->req->getFlags() & noMergeFlags) == 0);
- onlyWrites &= can_merge_write;
- if (onlyWrites) {
- auto offset = pkt->getOffset(blkSize);
- auto begin = writesBitmap.begin() + offset;
- std::fill(begin, begin + pkt->getSize(), true);
- }
- }
- }
+ void updateWriteFlags(PacketPtr pkt);
/**
* Tests if the flags of this TargetList have their default
*/
bool isReset() const {
return !needsWritable && !hasUpgrade && !allocOnFill &&
- !hasFromCache && onlyWrites;
+ !hasFromCache && canMergeWrites;
}
/**
const std::string &prefix) const;
/**
- * Check if this list contains only compatible writes, and if they
- * span the entire cache line. This is used as part of the
- * miss-packet creation. Note that new requests may arrive after a
- * miss-packet has been created, and for the fill we therefore use
- * the wasWholeLineWrite field.
+ * Check if this list contains writes that cover an entire
+ * cache line. This is used as part of the miss-packet
+ * creation. Note that new requests may arrive after a
+ * miss-packet has been created, and for the corresponding
+ * fill we use the wasWholeLineWrite field.
*/
bool isWholeLineWrite() const
{
- return onlyWrites &&
- std::all_of(writesBitmap.begin(),
- writesBitmap.end(), [](bool i) { return i; });
+ return std::all_of(writesBitmap.begin(), writesBitmap.end(),
+ [](bool i) { return i; });
}
private:
/** Size of the cache block. */
Addr blkSize;
- /** Are we only dealing with writes. */
- bool onlyWrites;
+ /** Indicates whether we can merge incoming write requests */
+ bool canMergeWrites;
// NOTE: std::vector<bool> might not meet satisfy the
// ForwardIterator requirement and therefore cannot be used
assert(inService); return postDowngrade;
}
- bool sendPacket(BaseCache &cache);
+ bool sendPacket(BaseCache &cache) override;
bool allocOnFill() const {
return targets.allocOnFill;
*/
void print(std::ostream &os,
int verbosity = 0,
- const std::string &prefix = "") const;
+ const std::string &prefix = "") const override;
/**
* A no-args wrapper of print(std::ostream...) meant to be
* invoked from DPRINTFs avoiding string overheads in fast mode
* @return string with mshr fields + [deferred]targets
*/
std::string print() const;
+
+ bool matchBlockAddr(const Addr addr, const bool is_secure) const override;
+ bool matchBlockAddr(const PacketPtr pkt) const override;
+ bool conflictAddr(const QueueEntry* entry) const override;
};
#endif // __MEM_CACHE_MSHR_HH__