diff options
author | Matteo Andreozzi <Matteo.Andreozzi@arm.com> | 2018-01-10 13:38:47 +0000 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2018-09-07 13:16:20 +0000 |
commit | 66f80b5a731e2fac5d9e4f841804d87a1267b76a (patch) | |
tree | 6350563636c536a726149a38c5a3d96d8f99348a /src/mem/packet.hh | |
parent | 53cdcdee663c614d134174edea57b98a15385679 (diff) | |
download | gem5-66f80b5a731e2fac5d9e4f841804d87a1267b76a.tar.xz |
mem: Add a QoS-aware Memory Controller type
This is the implementation of QoS algorithms support for gem5 memory
objects. This change-list provides a framework for specifying QoS
algorithm which can be used to prioritise service to specific masters in
the memory controller.
The QoS support implemented here is designed to be extendable so that
new QoS algorithms can be easily plugged into the memory controller as
"QoS Policies".
Change-Id: I0b611f13fce54dd1dd444eb806f8e98afd248bd5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/11970
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r-- | src/mem/packet.hh | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 36a46438a..0f45a7bae 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -347,6 +347,9 @@ class Packet : public Printable */ std::vector<bool> bytesValid; + // Quality of Service priority value + uint8_t _qosValue; + public: /** @@ -670,6 +673,25 @@ class Packet : public Printable bool isBlockCached() const { return flags.isSet(BLOCK_CACHED); } void clearBlockCached() { flags.clear(BLOCK_CACHED); } + /** + * QoS Value getter + * Returns 0 if QoS value was never set (constructor default). + * + * @return QoS priority value of the packet + */ + inline uint8_t qosValue() const { return _qosValue; } + + /** + * QoS Value setter + * Interface for setting QoS priority value of the packet. + * + * @param qos_value QoS priority value + */ + inline void qosValue(const uint8_t qos_value) + { _qosValue = qos_value; } + + inline MasterID masterId() const { return req->masterId(); } + // Network error conditions... encapsulate them as methods since // their encoding keeps changing (from result field to command // field, etc.) @@ -746,8 +768,9 @@ class Packet : public Printable * not be valid. The command must be supplied. */ Packet(const RequestPtr &_req, MemCmd _cmd) - : cmd(_cmd), id((PacketId)_req.get()), req(_req), data(nullptr), - addr(0), _isSecure(false), size(0), headerDelay(0), snoopDelay(0), + : cmd(_cmd), id((PacketId)_req.get()), req(_req), + data(nullptr), addr(0), _isSecure(false), size(0), + _qosValue(0), headerDelay(0), snoopDelay(0), payloadDelay(0), senderState(NULL) { if (req->hasPaddr()) { @@ -768,7 +791,8 @@ class Packet : public Printable */ Packet(const RequestPtr &_req, MemCmd _cmd, int _blkSize, PacketId _id = 0) : cmd(_cmd), id(_id ? _id : (PacketId)_req.get()), req(_req), - data(nullptr), addr(0), _isSecure(false), headerDelay(0), + data(nullptr), addr(0), _isSecure(false), + _qosValue(0), headerDelay(0), snoopDelay(0), payloadDelay(0), senderState(NULL) { if (req->hasPaddr()) { @@ -792,6 +816,7 @@ class Packet : public Printable data(nullptr), addr(pkt->addr), _isSecure(pkt->_isSecure), size(pkt->size), bytesValid(pkt->bytesValid), + _qosValue(pkt->qosValue()), headerDelay(pkt->headerDelay), snoopDelay(0), payloadDelay(pkt->payloadDelay), |