Tiago Mück has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/31420 )

Change subject: mem-ruby: expose transition info to actions
......................................................................

mem-ruby: expose transition info to actions

SLICC compiler generates the curTransitionEvent and
curTransitionNextState functions, which allows actions to check which
event triggered the current transition and what's the next state.

Change-Id: I79c8c4f2839633b7fb3b23cbbdbb32f25db90eab
Signed-off-by: Tiago Mück <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31420
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/slicc/symbols/StateMachine.py
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 1399d00..c019e1b 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -380,6 +380,12 @@
         code('''
                                     Addr addr);

+${ident}_Event m_curTransitionEvent;
+${ident}_State m_curTransitionNextState;
+
+${ident}_Event curTransitionEvent() { return m_curTransitionEvent; }
+${ident}_State curTransitionNextState() { return m_curTransitionNextState; }
+
 int m_counters[${ident}_State_NUM][${ident}_Event_NUM];
 int m_event_counters[${ident}_Event_NUM];
 bool m_possible[${ident}_State_NUM][${ident}_Event_NUM];
@@ -1407,6 +1413,8 @@
         code('''
                                         Addr addr)
 {
+    m_curTransitionEvent = event;
+    m_curTransitionNextState = next_state;
     switch(HASH_FUN(state, event)) {
 ''')

@@ -1427,10 +1435,12 @@
                     # is determined before any actions of the transition
# execute, and therefore the next state calculation cannot
                     # depend on any of the transitionactions.
-                    case('next_state = getNextState(addr);')
+                    case('next_state = getNextState(addr); '
+                         'm_curTransitionNextState = next_state;')
                 else:
                     ns_ident = trans.nextState.ident
-                    case('next_state = ${ident}_State_${ns_ident};')
+                    case('next_state = ${ident}_State_${ns_ident}; '
+                         'm_curTransitionNextState = next_state;')

             actions = trans.actions
             request_types = trans.request_types

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31420
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: I79c8c4f2839633b7fb3b23cbbdbb32f25db90eab
Gerrit-Change-Number: 31420
Gerrit-PatchSet: 5
Gerrit-Owner: Tiago Mück <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Tiago Mück <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Bradford Beckmann <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to