def __init__(self, symtab, ident, location, pairs, config_parameters): super(StateMachine, self).__init__(symtab, ident, location, pairs) self.table = None self.config_parameters = config_parameters self.prefetchers = [] for param in config_parameters: if param.pointer: var = Var(symtab, param.name, location, param.type_ast.type, "(*m_%s_ptr)" % param.name, {}, self) else: var = Var(symtab, param.name, location, param.type_ast.type, "m_%s" % param.name, {}, self) self.symtab.registerSym(param.name, var) if str(param.type_ast.type) == "Prefetcher": self.prefetchers.append(var) self.states = orderdict() self.events = orderdict() self.actions = orderdict() self.request_types = orderdict() self.transitions = [] self.in_ports = [] self.functions = [] self.objects = [] self.TBEType = None self.EntryType = None
def addDataMember(self, ident, type, pairs, init_code): if ident in self.data_members: return False member = DataMember(ident, type, pairs, init_code) self.data_members[ident] = member var = Var(self.symtab, ident, self.location, type, "m_%s" % ident, {}, None) self.symtab.registerSym(ident, var) return True
def __init__(self, symtab, ident, location, pairs, config_parameters): super(StateMachine, self).__init__(symtab, ident, location, pairs) self.table = None # Data members in the State Machine that have been declared before # the opening brace '{' of the machine. Note that these along with # the members in self.objects form the entire set of data members. self.config_parameters = config_parameters self.prefetchers = [] for param in config_parameters: if param.pointer: var = Var(symtab, param.ident, location, param.type_ast.type, "(*m_%s_ptr)" % param.ident, {}, self) else: var = Var(symtab, param.ident, location, param.type_ast.type, "m_%s" % param.ident, {}, self) self.symtab.registerSym(param.ident, var) if str(param.type_ast.type) == "Prefetcher": self.prefetchers.append(var) self.states = orderdict() self.events = orderdict() self.actions = orderdict() self.request_types = orderdict() self.transitions = [] self.in_ports = [] self.functions = [] # Data members in the State Machine that have been declared inside # the {} machine. Note that these along with the config params # form the entire set of data members of the machine. self.objects = [] self.TBEType = None self.EntryType = None self.debug_flags = set() self.debug_flags.add('RubyGenerated') self.debug_flags.add('RubySlicc')
def __init__(self, symtab, ident, location, pairs, config_parameters): super(StateMachine, self).__init__(symtab, ident, location, pairs) self.table = None self.config_parameters = config_parameters for param in config_parameters: if param.pointer: var = Var(symtab, param.name, location, param.type_ast.type, "(*m_%s_ptr)" % param.name, {}, self) else: var = Var(symtab, param.name, location, param.type_ast.type, "m_%s" % param.name, {}, self) self.symtab.registerSym(param.name, var) self.states = orderdict() self.events = orderdict() self.actions = orderdict() self.transitions = [] self.in_ports = [] self.functions = [] self.objects = [] self.message_buffer_names = []