summaryrefslogtreecommitdiff
path: root/src/mem/slicc
diff options
context:
space:
mode:
authorTony Gutierrez <anthony.gutierrez@amd.com>2016-01-19 14:28:22 -0500
committerTony Gutierrez <anthony.gutierrez@amd.com>2016-01-19 14:28:22 -0500
commit1a7d3f9fcb76a68540dd948f91413533a383bfde (patch)
tree867510a147cd095f19499d26b7c02d27de4cae9d /src/mem/slicc
parent28e353e0403ea379d244a418e8dc8ee0b48187cf (diff)
downloadgem5-1a7d3f9fcb76a68540dd948f91413533a383bfde.tar.xz
gpu-compute: AMD's baseline GPU model
Diffstat (limited to 'src/mem/slicc')
-rw-r--r--src/mem/slicc/symbols/StateMachine.py44
1 files changed, 35 insertions, 9 deletions
diff --git a/src/mem/slicc/symbols/StateMachine.py b/src/mem/slicc/symbols/StateMachine.py
index a530307ee..fc3f32c3d 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -35,13 +35,17 @@ import re
python_class_map = {
"int": "Int",
+ "NodeID": "Int",
"uint32_t" : "UInt32",
"std::string": "String",
"bool": "Bool",
"CacheMemory": "RubyCache",
"WireBuffer": "RubyWireBuffer",
"Sequencer": "RubySequencer",
+ "GPUCoalescer" : "RubyGPUCoalescer",
+ "VIPERCoalescer" : "VIPERCoalescer",
"DirectoryMemory": "RubyDirectoryMemory",
+ "PerfectCacheMemory": "RubyPerfectCacheMemory",
"MemoryControl": "MemoryControl",
"MessageBuffer": "MessageBuffer",
"DMASequencer": "DMASequencer",
@@ -305,7 +309,7 @@ class $c_ident : public AbstractController
void collateStats();
void recordCacheTrace(int cntrl, CacheRecorder* tr);
- Sequencer* getSequencer() const;
+ Sequencer* getCPUSequencer() const;
int functionalWriteBuffers(PacketPtr&);
@@ -527,8 +531,14 @@ $c_ident::$c_ident(const Params *p)
else:
code('m_${{param.ident}} = p->${{param.ident}};')
- if re.compile("sequencer").search(param.ident):
- code('m_${{param.ident}}_ptr->setController(this);')
+ if re.compile("sequencer").search(param.ident) or \
+ param.type_ast.type.c_ident == "GPUCoalescer" or \
+ param.type_ast.type.c_ident == "VIPERCoalescer":
+ code('''
+if (m_${{param.ident}}_ptr != NULL) {
+ m_${{param.ident}}_ptr->setController(this);
+}
+''')
code('''
@@ -670,6 +680,28 @@ $c_ident::init()
assert(param.pointer)
seq_ident = "m_%s_ptr" % param.ident
+ if seq_ident != "NULL":
+ code('''
+Sequencer*
+$c_ident::getCPUSequencer() const
+{
+ if (NULL != $seq_ident && $seq_ident->isCPUSequencer()) {
+ return $seq_ident;
+ } else {
+ return NULL;
+ }
+}
+''')
+ else:
+ code('''
+
+Sequencer*
+$c_ident::getCPUSequencer() const
+{
+ return NULL;
+}
+''')
+
code('''
void
@@ -796,12 +828,6 @@ $c_ident::getMemoryQueue() const
return $memq_ident;
}
-Sequencer*
-$c_ident::getSequencer() const
-{
- return $seq_ident;
-}
-
void
$c_ident::print(ostream& out) const
{