return "[FuncDecl: %s]" % self.ident
def files(self, parent=None):
- if "external" in self or self.statements is None:
- return set()
-
- if parent:
- ident = "%s_%s" % (parent, self.ident)
- else:
- ident = self.ident
- return set(("%s.cc" % ident,))
+ return set()
def generate(self):
types = []
", ".join(self.param_strings))
def writeCodeFiles(self, path):
+ return
+
+ def generateCode(self):
'''This write a function of object Chip'''
if "external" in self:
- return
+ return ""
code = self.symtab.codeFormatter()
- # Header
- code('''
-/** Auto generated C++ code started by $__file__:$__line__ */
-
-#include "debug/RubySlicc.hh"
-#include "mem/protocol/Types.hh"
-''')
-
- if self.isInternalMachineFunc:
- code('#include "mem/protocol/${{self.machineStr}}_Controller.hh"')
-
- code('using namespace std;')
# Generate function header
void_type = self.symtab.find("void", Type)
return_type = self.return_type.c_ident
${{self.body}}
}
''')
- if self.isInternalMachineFunc:
- code.write(path, "%s_%s.cc" % (self.machineStr,self.c_ident))
- else:
- code.write(path, "%s.cc" % self.c_ident)
+ return str(code)
__all__ = [ "Func" ]
self.printProfileDumperCC(path)
self.printProfileDumperHH(path)
- for func in self.functions:
- func.writeCodeFiles(path)
-
def printControllerPython(self, path):
code = self.symtab.codeFormatter()
ident = self.ident
}
''')
+ for func in self.functions:
+ code(func.generateCode())
+
code.write(path, "%s.cc" % c_ident)
def printCWakeup(self, path):