Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/57297 )
Change subject: mem-ruby: AbstractController unaddressed profiling
......................................................................
mem-ruby: AbstractController unaddressed profiling
Adds support for profiling "unaddressed" transactions,
which are associated with a unique ID rather than a memory address,
to AbstractController.
JIRA: https://gem5.atlassian.net/browse/GEM5-1097
Change-Id: Ib75f3f38dc4910acc2ad4f1c7bf88c9193568203
---
M src/mem/ruby/slicc_interface/AbstractController.hh
1 file changed, 55 insertions(+), 9 deletions(-)
diff --git a/src/mem/ruby/slicc_interface/AbstractController.hh
b/src/mem/ruby/slicc_interface/AbstractController.hh
index 9f4f75b..70b99d2 100644
--- a/src/mem/ruby/slicc_interface/AbstractController.hh
+++ b/src/mem/ruby/slicc_interface/AbstractController.hh
@@ -226,23 +226,33 @@
// Tracks outstanding transactions for latency profiling
struct TransMapPair { unsigned transaction; unsigned state; Tick time;
};
- std::unordered_map<Addr, TransMapPair> m_inTrans;
- std::unordered_map<Addr, TransMapPair> m_outTrans;
+ std::unordered_map<Addr, TransMapPair> m_inTransAddressed;
+ std::unordered_map<Addr, TransMapPair> m_outTransAddressed;
+
+ std::unordered_map<Addr, TransMapPair> m_inTransUnaddressed;
+ std::unordered_map<Addr, TransMapPair> m_outTransUnaddressed;
/**
* Profiles an event that initiates a protocol transactions for a
specific
* line (e.g. events triggered by incoming request messages).
* A histogram with the latency of the transactions is generated for
* all combinations of trigger event, initial state, and final state.
+ * This function also supports "unaddressed" transactions,
+ * those not associated with an address in memory but
+ * instead associated with a unique ID.
*
- * @param addr address of the line
+ * @param addr address of the line, or unique transaction ID
* @param type event that started the transaction
* @param initialState state of the line before the transaction
+ * @param isAddressed is addr a line address or a unique ID
*/
template<typename EventType, typename StateType>
void incomingTransactionStart(Addr addr,
- EventType type, StateType initialState, bool retried)
+ EventType type, StateType initialState, bool retried,
+ bool isAddressed=true)
{
+ auto& m_inTrans =
+ isAddressed ? m_inTransAddressed : m_inTransUnaddressed;
assert(m_inTrans.find(addr) == m_inTrans.end());
m_inTrans[addr] = {type, initialState, curTick()};
if (retried)
@@ -251,13 +261,20 @@
/**
* Profiles an event that ends a transaction.
+ * This function also supports "unaddressed" transactions,
+ * those not associated with an address in memory but
+ * instead associated with a unique ID.
*
- * @param addr address of the line with a outstanding transaction
+ * @param addr address or unique ID with an outstanding transaction
* @param finalState state of the line after the transaction
+ * @param isAddressed is addr a line address or a unique ID
*/
template<typename StateType>
- void incomingTransactionEnd(Addr addr, StateType finalState)
+ void incomingTransactionEnd(Addr addr, StateType finalState,
+ bool isAddressed=true)
{
+ auto& m_inTrans =
+ isAddressed ? m_inTransAddressed : m_inTransUnaddressed;
auto iter = m_inTrans.find(addr);
assert(iter != m_inTrans.end());
stats.inTransLatHist[iter->second.transaction]
@@ -271,13 +288,20 @@
/**
* Profiles an event that initiates a transaction in a peer controller
* (e.g. an event that sends a request message)
+ * This function also supports "unaddressed" transactions,
+ * those not associated with an address in memory but
+ * instead associated with a unique ID.
*
- * @param addr address of the line
+ * @param addr address of the line or a unique transaction ID
* @param type event that started the transaction
+ * @param isAddressed is addr a line address or a unique ID
*/
template<typename EventType>
- void outgoingTransactionStart(Addr addr, EventType type)
+ void outgoingTransactionStart(Addr addr, EventType type,
+ bool isAddressed=true)
{
+ auto& m_outTrans =
+ isAddressed ? m_outTransAddressed : m_outTransUnaddressed;
assert(m_outTrans.find(addr) == m_outTrans.end());
m_outTrans[addr] = {type, 0, curTick()};
}
@@ -285,11 +309,18 @@
/**
* Profiles the end of an outgoing transaction.
* (e.g. receiving the response for a requests)
+ * This function also supports "unaddressed" transactions,
+ * those not associated with an address in memory but
+ * instead associated with a unique ID.
*
* @param addr address of the line with an outstanding transaction
+ * @param isAddressed is addr a line address or a unique ID
*/
- void outgoingTransactionEnd(Addr addr, bool retried)
+ void outgoingTransactionEnd(Addr addr, bool retried,
+ bool isAddressed=true)
{
+ auto& m_outTrans =
+ isAddressed ? m_outTransAddressed : m_outTransUnaddressed;
auto iter = m_outTrans.find(addr);
assert(iter != m_outTrans.end());
stats.outTransLatHist[iter->second.transaction]->sample(
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/57297
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib75f3f38dc4910acc2ad4f1c7bf88c9193568203
Gerrit-Change-Number: 57297
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s