Deleted Added
sdiff udiff text old ( 9171:ae88ecf37145 ) new ( 9219:258753d3bc47 )
full compact
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 148 unchanged lines hidden (view full) ---

157 for action in self.actions.itervalues():
158 if not action.used:
159 error_msg = "Unused action: %s" % action.ident
160 if "desc" in action:
161 error_msg += ", " + action.desc
162 action.warning(error_msg)
163 self.table = table
164
165 def writeCodeFiles(self, path):
166 self.printControllerPython(path)
167 self.printControllerHH(path)
168 self.printControllerCC(path)
169 self.printCSwitch(path)
170 self.printCWakeup(path)
171 self.printProfilerCC(path)
172 self.printProfilerHH(path)
173 self.printProfileDumperCC(path)
174 self.printProfileDumperHH(path)
175
176 def printControllerPython(self, path):
177 code = self.symtab.codeFormatter()
178 ident = self.ident

--- 215 unchanged lines hidden (view full) ---

394 if var.type.ident == "MessageBuffer":
395 self.message_buffer_names.append("m_%s_ptr" % var.c_ident)
396
397 code.dedent()
398 code('};')
399 code('#endif // __${ident}_CONTROLLER_H__')
400 code.write(path, '%s.hh' % c_ident)
401
402 def printControllerCC(self, path):
403 '''Output the actions for performing the actions'''
404
405 code = self.symtab.codeFormatter()
406 ident = self.ident
407 c_ident = "%s_Controller" % self.ident
408
409 code('''
410/** \\file $c_ident.cc

--- 13 unchanged lines hidden (view full) ---

424#include "base/cprintf.hh"
425#include "debug/RubyGenerated.hh"
426#include "debug/RubySlicc.hh"
427#include "mem/protocol/${ident}_Controller.hh"
428#include "mem/protocol/${ident}_Event.hh"
429#include "mem/protocol/${ident}_State.hh"
430#include "mem/protocol/Types.hh"
431#include "mem/ruby/common/Global.hh"
432#include "mem/ruby/slicc_interface/RubySlicc_includes.hh"
433#include "mem/ruby/system/System.hh"
434
435using namespace std;
436''')
437
438 # include object classes
439 seen_types = set()
440 for var in self.objects:
441 if var.type.ident not in seen_types and not var.type.isPrimitive:
442 code('#include "mem/protocol/${{var.type.c_ident}}.hh"')

--- 540 unchanged lines hidden (view full) ---

983}
984
985''')
986 for func in self.functions:
987 code(func.generateCode())
988
989 code.write(path, "%s.cc" % c_ident)
990
991 def printCWakeup(self, path):
992 '''Output the wakeup loop for the events'''
993
994 code = self.symtab.codeFormatter()
995 ident = self.ident
996
997 outputRequest_types = True
998 if len(self.request_types) == 0:
999 outputRequest_types = False

--- 15 unchanged lines hidden (view full) ---

1015''')
1016
1017 if outputRequest_types:
1018 code('''#include "mem/protocol/${ident}_RequestType.hh"''')
1019
1020 code('''
1021#include "mem/protocol/Types.hh"
1022#include "mem/ruby/common/Global.hh"
1023#include "mem/ruby/slicc_interface/RubySlicc_includes.hh"
1024#include "mem/ruby/system/System.hh"
1025
1026using namespace std;
1027
1028void
1029${ident}_Controller::wakeup()
1030{
1031 int counter = 0;
1032 while (true) {
1033 // Some cases will put us into an infinite loop without this limit

--- 671 unchanged lines hidden ---