summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2012-12-11 10:05:56 -0600
committerNilay Vaish <nilay@cs.wisc.edu>2012-12-11 10:05:56 -0600
commitf3d0be210f889da927d921d21a6c27ba94fde746 (patch)
treee72af115a12e885f22d1247c222182e474a21d8a /src/mem/slicc/symbols
parentc120273708ca9843d15f4179c924bccc0f133d65 (diff)
downloadgem5-f3d0be210f889da927d921d21a6c27ba94fde746.tar.xz
ruby: add support for prefetching to MESI protocol
Diffstat (limited to 'src/mem/slicc/symbols')
-rw-r--r--src/mem/slicc/symbols/StateMachine.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index 1547f992b..6c85480ab 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -41,7 +41,8 @@ python_class_map = {"int": "Int",
"Sequencer": "RubySequencer",
"DirectoryMemory": "RubyDirectoryMemory",
"MemoryControl": "MemoryControl",
- "DMASequencer": "DMASequencer"
+ "DMASequencer": "DMASequencer",
+ "Prefetcher":"Prefetcher"
}
class StateMachine(Symbol):
@@ -49,6 +50,7 @@ class StateMachine(Symbol):
super(StateMachine, self).__init__(symtab, ident, location, pairs)
self.table = None
self.config_parameters = config_parameters
+ self.prefetchers = []
for param in config_parameters:
if param.pointer:
@@ -58,6 +60,8 @@ class StateMachine(Symbol):
var = Var(symtab, param.name, location, param.type_ast.type,
"m_%s" % param.name, {}, self)
self.symtab.registerSym(param.name, var)
+ if str(param.type_ast.type) == "Prefetcher":
+ self.prefetchers.append(var)
self.states = orderdict()
self.events = orderdict()
@@ -69,9 +73,9 @@ class StateMachine(Symbol):
self.objects = []
self.TBEType = None
self.EntryType = None
-
self.message_buffer_names = []
+
def __repr__(self):
return "[StateMachine: %s]" % self.ident
@@ -629,6 +633,10 @@ $vid->setDescription("[Version " + to_string(m_version) + ", ${ident}, name=${{v
else:
code('$vid->setRecycleLatency(m_recycle_latency);')
+ # Set the prefetchers
+ code()
+ for prefetcher in self.prefetchers:
+ code('${{prefetcher.code}}.setController(this);')
# Set the queue consumers
code()