summaryrefslogtreecommitdiff
path: root/src/mem/slicc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-09-18 13:27:47 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-09-18 13:27:47 -0500
commit96c999fe88a5f600a1a5ddf8c15eadba3051508b (patch)
treeb1fb5220ffcd3b0688d53cb7f41a6c016eadc0fa /src/mem/slicc
parent216529bf182f58830cfccad090f348e1b8730675 (diff)
downloadgem5-96c999fe88a5f600a1a5ddf8c15eadba3051508b.tar.xz
ruby: print addresses in hex
Changeset 4872dbdea907 replaced Address by Addr, but did not make changes to print statements. So the addresses which were being printed in hex earlier along with their line address, were now being printed in decimals. This patch adds a function printAddress(Addr) that can be used to print the address in hex along with the lines address. This function has been put to use in some of the places. At other places, change has been made to print just the address in hex.
Diffstat (limited to 'src/mem/slicc')
-rw-r--r--src/mem/slicc/symbols/StateMachine.py8
-rw-r--r--src/mem/slicc/symbols/Type.py6
2 files changed, 9 insertions, 5 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 9eaa40d77..a530307ee 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -1155,7 +1155,7 @@ ${ident}_Controller::doTransition(${ident}_Event event,
code('''
${ident}_State next_state = state;
-DPRINTF(RubyGenerated, "%s, Time: %lld, state: %s, event: %s, addr: %s\\n",
+DPRINTF(RubyGenerated, "%s, Time: %lld, state: %s, event: %s, addr: %#x\\n",
*this, curCycle(), ${ident}_State_to_string(state),
${ident}_Event_to_string(event), addr);
@@ -1184,7 +1184,7 @@ if (result == TransitionResult_Valid) {
${ident}_Event_to_string(event),
${ident}_State_to_string(state),
${ident}_State_to_string(next_state),
- addr, GET_TRANSITION_COMMENT());
+ printAddress(addr), GET_TRANSITION_COMMENT());
CLEAR_TRANSITION_COMMENT();
''')
@@ -1208,7 +1208,7 @@ if (result == TransitionResult_Valid) {
${ident}_Event_to_string(event),
${ident}_State_to_string(state),
${ident}_State_to_string(next_state),
- addr, "Resource Stall");
+ printAddress(addr), "Resource Stall");
} else if (result == TransitionResult_ProtocolStall) {
DPRINTF(RubyGenerated, "stalling\\n");
DPRINTFR(ProtocolTrace, "%15s %3s %10s%20s %6s>%-6s %#x %s\\n",
@@ -1216,7 +1216,7 @@ if (result == TransitionResult_Valid) {
${ident}_Event_to_string(event),
${ident}_State_to_string(state),
${ident}_State_to_string(next_state),
- addr, "Protocol Stall");
+ printAddress(addr), "Protocol Stall");
}
return result;
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index 6234f4f7f..a3223b3ac 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -412,7 +412,11 @@ ${{self.c_ident}}::print(ostream& out) const
# For each field
code.indent()
for dm in self.data_members.values():
- code('out << "${{dm.ident}} = " << m_${{dm.ident}} << " ";''')
+ if dm.type.c_ident == "Addr":
+ code('''
+out << "${{dm.ident}} = " << printAddress(m_${{dm.ident}}) << " ";''')
+ else:
+ code('out << "${{dm.ident}} = " << m_${{dm.ident}} << " ";''')
code.dedent()