summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols
diff options
context:
space:
mode:
authorDavid Hashe <david.hashe@amd.com>2015-07-20 09:15:18 -0500
committerDavid Hashe <david.hashe@amd.com>2015-07-20 09:15:18 -0500
commit3454a4a36e927f483b36fa66baabe2c85ecf3ddc (patch)
tree3afa6cb6b5626f63418df648918e2832492a985c /src/mem/slicc/symbols
parent93242399227ba2dce443dee108b57f660b39b971 (diff)
downloadgem5-3454a4a36e927f483b36fa66baabe2c85ecf3ddc.tar.xz
slicc: support for arbitrary DPRINTF flags (not just RubySlicc)
This patch allows DPRINTFs to be used in SLICC state machines similar to how they are used by the rest of gem5. Previously all DPRINTFs in the .sm files had to use the RubySlicc flag.
Diffstat (limited to 'src/mem/slicc/symbols')
-rw-r--r--src/mem/slicc/symbols/StateMachine.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index e90abaf44..425bd522d 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -1,5 +1,6 @@
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
+# Copyright (c) 2013 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -86,6 +87,9 @@ class StateMachine(Symbol):
self.objects = []
self.TBEType = None
self.EntryType = None
+ self.debug_flags = set()
+ self.debug_flags.add('RubyGenerated')
+ self.debug_flags.add('RubySlicc')
def __repr__(self):
return "[StateMachine: %s]" % self.ident
@@ -114,6 +118,9 @@ class StateMachine(Symbol):
self.actions[action.ident] = action
+ def addDebugFlag(self, flag):
+ self.debug_flags.add(flag)
+
def addRequestType(self, request_type):
assert self.table is None
self.request_types[request_type.ident] = request_type
@@ -270,6 +277,7 @@ class $py_ident(RubyController):
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/slicc_interface/AbstractController.hh"
#include "params/$c_ident.hh"
+
''')
seen_types = set()
@@ -441,22 +449,26 @@ void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr);
*/
#include <sys/types.h>
-#include <typeinfo>
#include <unistd.h>
#include <cassert>
#include <sstream>
#include <string>
+#include <typeinfo>
#include "base/compiler.hh"
#include "base/cprintf.hh"
-#include "debug/RubyGenerated.hh"
-#include "debug/RubySlicc.hh"
+
+''')
+ for f in self.debug_flags:
+ code('#include "debug/${{f}}.hh"')
+ code('''
#include "mem/protocol/${ident}_Controller.hh"
#include "mem/protocol/${ident}_Event.hh"
#include "mem/protocol/${ident}_State.hh"
#include "mem/protocol/Types.hh"
#include "mem/ruby/system/System.hh"
+
''')
for include_path in includes:
code('#include "${{include_path}}"')
@@ -1053,16 +1065,21 @@ $c_ident::functionalWriteBuffers(PacketPtr& pkt)
// ${ident}: ${{self.short}}
#include <sys/types.h>
-#include <typeinfo>
#include <unistd.h>
#include <cassert>
+#include <typeinfo>
#include "base/misc.hh"
-#include "debug/RubySlicc.hh"
+
+''')
+ for f in self.debug_flags:
+ code('#include "debug/${{f}}.hh"')
+ code('''
#include "mem/protocol/${ident}_Controller.hh"
#include "mem/protocol/${ident}_Event.hh"
#include "mem/protocol/${ident}_State.hh"
+
''')
if outputRequest_types:
@@ -1071,6 +1088,7 @@ $c_ident::functionalWriteBuffers(PacketPtr& pkt)
code('''
#include "mem/protocol/Types.hh"
#include "mem/ruby/system/System.hh"
+
''')