summaryrefslogtreecommitdiff
path: root/src/mem/slicc/symbols/Func.py
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2011-06-03 13:52:18 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2011-06-03 13:52:18 -0500
commit3a083edc301327527d954c8cbc5489b9d80b222f (patch)
treee616033d758084e111b97c7b1e97b450c3a972f8 /src/mem/slicc/symbols/Func.py
parent5a78c2d001e24d31d09e272b2a17b81146699cda (diff)
downloadgem5-3a083edc301327527d954c8cbc5489b9d80b222f.tar.xz
SLICC: Remove machine name as prefix to functions
Currently, the machine name is appended before any of the functions defined with in the sm files. This is not necessary and it also means that these functions cannot be used outside the sm files. This patch does away with the prefixes. Note that the generated C++ files in which the code for these functions is present are still named such that the machine name is the prefix.
Diffstat (limited to 'src/mem/slicc/symbols/Func.py')
-rw-r--r--src/mem/slicc/symbols/Func.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mem/slicc/symbols/Func.py b/src/mem/slicc/symbols/Func.py
index 28a0cf93c..f0b92cdc9 100644
--- a/src/mem/slicc/symbols/Func.py
+++ b/src/mem/slicc/symbols/Func.py
@@ -37,15 +37,12 @@ class Func(Symbol):
self.param_strings = param_strings
self.body = body
self.isInternalMachineFunc = False
+ self.c_ident = ident
- if machine is None:
- self.c_ident = ident
- elif "external" in self or "primitive" in self:
- self.c_ident = ident
+ if machine is None or "external" in self or "primitive" in self:
+ pass
else:
self.machineStr = str(machine)
- # Append with machine name
- self.c_ident = "%s_%s" % (self.machineStr, ident)
self.isInternalMachineFunc = True
def __repr__(self):
@@ -107,6 +104,9 @@ ${klass}::${{self.c_ident}}($params)
${{self.body}}
}
''')
- code.write(path, "%s.cc" % self.c_ident)
+ if self.isInternalMachineFunc:
+ code.write(path, "%s_%s.cc" % (self.machineStr,self.c_ident))
+ else:
+ code.write(path, "%s.cc" % self.c_ident)
__all__ = [ "Func" ]