summaryrefslogtreecommitdiff
path: root/src/mem/slicc/ast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/slicc/ast')
-rw-r--r--src/mem/slicc/ast/AST.py10
-rw-r--r--src/mem/slicc/ast/PeekStatementAST.py4
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mem/slicc/ast/AST.py b/src/mem/slicc/ast/AST.py
index 5818448ca..8f0d06171 100644
--- a/src/mem/slicc/ast/AST.py
+++ b/src/mem/slicc/ast/AST.py
@@ -54,8 +54,14 @@ class AST(PairContainer):
message = message % args
code = self.slicc.codeFormatter()
code('''
-cerr << "Runtime Error at ${{self.location}}, Ruby Time: " << g_eventQueue_ptr->getTime() << ": "<< $message << ", PID: " << getpid() << endl;
-char c; cerr << "press return to continue." << endl; cin.get(c); abort();
+char c;
+cerr << "Runtime Error at ${{self.location}}, Ruby Time: "
+ << g_eventQueue_ptr->getTime() << ": "
+ << $message
+ << ", PID: " << getpid() << endl
+ << "press return to continue." << endl;
+cin.get(c);
+abort();
''')
return code
diff --git a/src/mem/slicc/ast/PeekStatementAST.py b/src/mem/slicc/ast/PeekStatementAST.py
index b63ce6516..18244f507 100644
--- a/src/mem/slicc/ast/PeekStatementAST.py
+++ b/src/mem/slicc/ast/PeekStatementAST.py
@@ -59,10 +59,12 @@ class PeekStatementAST(StatementAST):
qcode = self.queue_name.var.code
code('''
{
+ // Declare message
const $mtid* in_msg_ptr;
in_msg_ptr = dynamic_cast<const $mtid *>(($qcode).${{self.method}}());
- assert(in_msg_ptr != NULL);
+ assert(in_msg_ptr != NULL); // Check the cast result
''')
+
if self.pairs.has_key("block_on"):
address_field = self.pairs['block_on']
code('''