Deleted Added
sdiff udiff text old ( 10968:bde347fc89ae ) new ( 10972:53d63eeee46f )
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;
9# redistributions in binary form must reproduce the above copyright
10# notice, this list of conditions and the following disclaimer in the

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

81 self.functions = []
82
83 # Data members in the State Machine that have been declared inside
84 # the {} machine. Note that these along with the config params
85 # form the entire set of data members of the machine.
86 self.objects = []
87 self.TBEType = None
88 self.EntryType = None
89
90 def __repr__(self):
91 return "[StateMachine: %s]" % self.ident
92
93 def addState(self, state):
94 assert self.table is None
95 self.states[state.ident] = state
96

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

109 if action.short == other.short:
110 other.warning("Duplicate action shorthand: %s" % other.ident)
111 other.warning(" shorthand = %s" % other.short)
112 action.warning("Duplicate action shorthand: %s" % action.ident)
113 action.error(" shorthand = %s" % action.short)
114
115 self.actions[action.ident] = action
116
117 def addRequestType(self, request_type):
118 assert self.table is None
119 self.request_types[request_type.ident] = request_type
120
121 def addTransition(self, trans):
122 assert self.table is None
123 self.transitions.append(trans)
124

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

265#include <sstream>
266#include <string>
267
268#include "mem/protocol/TransitionResult.hh"
269#include "mem/protocol/Types.hh"
270#include "mem/ruby/common/Consumer.hh"
271#include "mem/ruby/slicc_interface/AbstractController.hh"
272#include "params/$c_ident.hh"
273''')
274
275 seen_types = set()
276 for var in self.objects:
277 if var.type.ident not in seen_types and not var.type.isPrimitive:
278 code('#include "mem/protocol/${{var.type.c_ident}}.hh"')
279 seen_types.add(var.type.ident)
280

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

436 code('''
437/** \\file $c_ident.cc
438 *
439 * Auto generated C++ code started by $__file__:$__line__
440 * Created by slicc definition of Module "${{self.short}}"
441 */
442
443#include <sys/types.h>
444#include <typeinfo>
445#include <unistd.h>
446
447#include <cassert>
448#include <sstream>
449#include <string>
450
451#include "base/compiler.hh"
452#include "base/cprintf.hh"
453#include "debug/RubyGenerated.hh"
454#include "debug/RubySlicc.hh"
455#include "mem/protocol/${ident}_Controller.hh"
456#include "mem/protocol/${ident}_Event.hh"
457#include "mem/protocol/${ident}_State.hh"
458#include "mem/protocol/Types.hh"
459#include "mem/ruby/system/System.hh"
460''')
461 for include_path in includes:
462 code('#include "${{include_path}}"')
463
464 code('''
465
466using namespace std;
467''')

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

1048 if len(self.request_types) == 0:
1049 outputRequest_types = False
1050
1051 code('''
1052// Auto generated C++ code started by $__file__:$__line__
1053// ${ident}: ${{self.short}}
1054
1055#include <sys/types.h>
1056#include <typeinfo>
1057#include <unistd.h>
1058
1059#include <cassert>
1060
1061#include "base/misc.hh"
1062#include "debug/RubySlicc.hh"
1063#include "mem/protocol/${ident}_Controller.hh"
1064#include "mem/protocol/${ident}_Event.hh"
1065#include "mem/protocol/${ident}_State.hh"
1066''')
1067
1068 if outputRequest_types:
1069 code('''#include "mem/protocol/${ident}_RequestType.hh"''')
1070
1071 code('''
1072#include "mem/protocol/Types.hh"
1073#include "mem/ruby/system/System.hh"
1074''')
1075
1076
1077 for include_path in includes:
1078 code('#include "${{include_path}}"')
1079
1080 port_to_buf_map, in_msg_bufs, msg_bufs = self.getBufferMaps(ident)
1081

--- 512 unchanged lines hidden ---