Lines Matching refs:ident

57     def __init__(self, symtab, ident, location, pairs, config_parameters):
58 super(StateMachine, self).__init__(symtab, ident, location, pairs)
70 var = Var(symtab, param.ident, location, param.type_ast.type,
71 "(*m_%s_ptr)" % param.ident, {}, self)
73 var = Var(symtab, param.ident, location, param.type_ast.type,
74 "m_%s" % param.ident, {}, self)
76 self.symtab.registerSym(param.ident, var)
100 return "[StateMachine: %s]" % self.ident
104 self.states[state.ident] = state
108 self.events[event.ident] = event
115 if action.ident == other.ident:
116 action.warning("Duplicate action definition: %s" % action.ident)
117 action.error("Duplicate action definition: %s" % action.ident)
119 other.warning("Duplicate action shorthand: %s" % other.ident)
121 action.warning("Duplicate action shorthand: %s" % action.ident)
124 self.actions[action.ident] = action
131 self.request_types[request_type.ident] = request_type
152 if type_ident == "%s_TBE" %self.ident:
191 error_msg = "Unused action: %s" % action.ident
198 def getBufferMaps(self, ident):
221 ident = self.ident
223 py_ident = "%s_Controller" % ident
224 c_ident = "%s_Controller" % self.ident
244 code('${{param.ident}} = Param.${{python_type}}(${dflt_str}"")')
258 ident = self.ident
259 c_ident = "%s_Controller" % self.ident
268 #ifndef __${ident}_CONTROLLER_HH__
269 #define __${ident}_CONTROLLER_HH__
285 if var.type.ident not in seen_types and not var.type.isPrimitive:
287 seen_types.add(var.type.ident)
291 extern std::stringstream ${ident}_transitionComment;
317 void countTransition(${ident}_State state, ${ident}_Event event);
318 void possibleTransition(${ident}_State state, ${ident}_Event event);
319 uint64_t getEventCount(${ident}_Event event);
320 bool isPossible(${ident}_State state, ${ident}_Event event);
321 uint64_t getTransitionCount(${ident}_State state, ${ident}_Event event);
330 code('${{param.type_ast.type}}* m_${{param.ident}}_ptr;')
332 code('${{param.type_ast.type}} m_${{param.ident}};')
335 TransitionResult doTransition(${ident}_Event event,
350 TransitionResult doTransitionWorker(${ident}_Event event,
351 ${ident}_State state,
352 ${ident}_State& next_state,
367 int m_counters[${ident}_State_NUM][${ident}_Event_NUM];
368 int m_event_counters[${ident}_Event_NUM];
369 bool m_possible[${ident}_State_NUM][${ident}_Event_NUM];
395 void set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${ident}_TBE* m_new_tbe);
407 code('void ${{action.ident}}(${{self.TBEType.c_ident}}*& '
413 code('void ${{action.ident}}(${{self.TBEType.c_ident}}*& '
418 code('void ${{action.ident}}(${{self.EntryType.c_ident}}*& '
423 code('void ${{action.ident}}(Addr addr);')
432 code('${{var.type.c_ident}}$th* m_${{var.ident}}_ptr;')
436 code('#endif // __${ident}_CONTROLLER_H__')
443 ident = self.ident
444 c_ident = "%s_Controller" % self.ident
470 #include "mem/ruby/protocol/${ident}_Controller.hh"
471 #include "mem/ruby/protocol/${ident}_Event.hh"
472 #include "mem/ruby/protocol/${ident}_State.hh"
488 if var.type.ident not in seen_types and not var.type.isPrimitive:
490 seen_types.add(var.type.ident)
506 stringstream ${ident}_transitionComment;
509 #define APPEND_TRANSITION_COMMENT(str) (${ident}_transitionComment << str)
518 m_machineID.type = MachineType_${ident};
533 code('m_${{param.ident}}_ptr = p->${{param.ident}};')
535 code('m_${{param.ident}} = p->${{param.ident}};')
537 if re.compile("sequencer").search(param.ident) or \
541 if (m_${{param.ident}}_ptr != NULL) {
542 m_${{param.ident}}_ptr->setController(this);
548 for (int state = 0; state < ${ident}_State_NUM; state++) {
549 for (int event = 0; event < ${ident}_Event_NUM; event++) {
554 for (int event = 0; event < ${ident}_Event_NUM; event++) {
565 MachineType machine_type = string_to_MachineType("${{self.ident}}");
577 vid = "m_%s_ptr" % var.ident
614 vid = "m_%s_ptr" % var.ident
635 comment = "Type %s default" % vtype.ident
654 if action.ident == "z_stall":
659 state = "%s_State_%s" % (self.ident, trans.state.ident)
660 event = "%s_Event_%s" % (self.ident, trans.event.ident)
682 if param.ident == "sequencer":
684 seq_ident = "m_%s_ptr" % param.ident
688 if param.ident == "coalescer":
690 coal_ident = "m_%s_ptr" % param.ident
744 for (${ident}_Event event = ${ident}_Event_FIRST;
745 event < ${ident}_Event_NUM; ++event) {
749 ${ident}_Event_to_string(event));
756 for (${ident}_State state = ${ident}_State_FIRST;
757 state < ${ident}_State_NUM; ++state) {
761 for (${ident}_Event event = ${ident}_Event_FIRST;
762 event < ${ident}_Event_NUM; ++event) {
767 ${ident}_State_to_string(state) +
768 "." + ${ident}_Event_to_string(event));
781 for (${ident}_Event event = ${ident}_Event_FIRST;
782 event < ${ident}_Event_NUM; ++event) {
786 rs->m_abstract_controls[MachineType_${ident}].find(i);
787 assert(it != rs->m_abstract_controls[MachineType_${ident}].end());
793 for (${ident}_State state = ${ident}_State_FIRST;
794 state < ${ident}_State_NUM; ++state) {
796 for (${ident}_Event event = ${ident}_Event_FIRST;
797 event < ${ident}_Event_NUM; ++event) {
802 rs->m_abstract_controls[MachineType_${ident}].find(i);
803 assert(it != rs->m_abstract_controls[MachineType_${ident}].end());
812 $c_ident::countTransition(${ident}_State state, ${ident}_Event event)
819 $c_ident::possibleTransition(${ident}_State state,
820 ${ident}_Event event)
826 $c_ident::getEventCount(${ident}_Event event)
832 $c_ident::isPossible(${ident}_State state, ${ident}_Event event)
838 $c_ident::getTransitionCount(${ident}_State state,
839 ${ident}_Event event)
870 for (int state = 0; state < ${ident}_State_NUM; state++) {
871 for (int event = 0; event < ${ident}_Event_NUM; event++) {
876 for (int event = 0; event < ${ident}_Event_NUM; event++) {
929 if param.type_ast.type.ident == "CacheMemory":
931 code('m_${{param.ident}}_ptr->recordCacheContents(cntrl, tr);')
947 $c_ident::${{action.ident}}(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${{self.EntryType.c_ident}}*& m_cache_entry_ptr, Addr addr)
949 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n");
953 fatal("Error in action ${{ident}}:${{action.ident}}: "
968 $c_ident::${{action.ident}}(${{self.TBEType.c_ident}}*& m_tbe_ptr, Addr addr)
970 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n");
983 $c_ident::${{action.ident}}(${{self.EntryType.c_ident}}*& m_cache_entry_ptr, Addr addr)
985 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n");
998 $c_ident::${{action.ident}}(Addr addr)
1000 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n");
1018 vid = "m_%s_ptr" % var.ident
1024 vid = "m_%s_ptr" % var.ident
1038 ident = self.ident
1046 // ${ident}: ${{self.short}}
1060 #include "mem/ruby/protocol/${ident}_Controller.hh"
1061 #include "mem/ruby/protocol/${ident}_Event.hh"
1062 #include "mem/ruby/protocol/${ident}_State.hh"
1067 code('''#include "mem/ruby/protocol/${ident}_RequestType.hh"''')
1079 port_to_buf_map, in_msg_bufs, msg_bufs = self.getBufferMaps(ident)
1086 ${ident}_Controller::wakeup()
1111 code('// ${ident}InPort $port')
1157 code.write(path, "%s_Wakeup.cc" % self.ident)
1163 ident = self.ident
1167 // ${ident}: ${{self.short}}
1175 #include "mem/ruby/protocol/${ident}_Controller.hh"
1176 #include "mem/ruby/protocol/${ident}_Event.hh"
1177 #include "mem/ruby/protocol/${ident}_State.hh"
1181 #define HASH_FUN(state, event) ((int(state)*${ident}_Event_NUM)+int(event))
1183 #define GET_TRANSITION_COMMENT() (${ident}_transitionComment.str())
1184 #define CLEAR_TRANSITION_COMMENT() (${ident}_transitionComment.str(""))
1187 ${ident}_Controller::doTransition(${ident}_Event event,
1204 code('${ident}_State state = getState(m_tbe_ptr, m_cache_entry_ptr, addr);')
1206 code('${ident}_State state = getState(m_tbe_ptr, addr);')
1208 code('${ident}_State state = getState(m_cache_entry_ptr, addr);')
1210 code('${ident}_State state = getState(addr);')
1213 ${ident}_State next_state = state;
1216 *this, curCycle(), ${ident}_State_to_string(state),
1217 ${ident}_Event_to_string(event), addr);
1230 port_to_buf_map, in_msg_bufs, msg_bufs = self.getBufferMaps(ident)
1236 ${ident}_State_to_string(next_state));
1240 curTick(), m_version, "${ident}",
1241 ${ident}_Event_to_string(event),
1242 ${ident}_State_to_string(state),
1243 ${ident}_State_to_string(next_state),
1264 curTick(), m_version, "${ident}",
1265 ${ident}_Event_to_string(event),
1266 ${ident}_State_to_string(state),
1267 ${ident}_State_to_string(next_state),
1272 curTick(), m_version, "${ident}",
1273 ${ident}_Event_to_string(event),
1274 ${ident}_State_to_string(state),
1275 ${ident}_State_to_string(next_state),
1286 ${ident}_Controller::doTransitionWorker(${ident}_Event event,
1287 ${ident}_State state,
1288 ${ident}_State& next_state,
1310 (self.ident, trans.state.ident, self.ident, trans.event.ident)
1324 ns_ident = trans.nextState.ident
1325 case('next_state = ${ident}_State_${ns_ident};')
1346 ''' % (self.ident, request_type.ident)
1357 case('recordRequestType(${ident}_RequestType_${{request_type.ident}}, addr);')
1362 if action.ident == "z_stall":
1371 case('${{action.ident}}(m_tbe_ptr, m_cache_entry_ptr, addr);')
1374 case('${{action.ident}}(m_tbe_ptr, addr);')
1377 case('${{action.ident}}(m_cache_entry_ptr, addr);')
1380 case('${{action.ident}}(addr);')
1410 code.write(path, "%s_Transitions.cc" % self.ident)
1436 name = "%s_action_%s.html" % (self.ident, action.ident)
1442 name = "%s_State_%s.html" % (self.ident, state.ident)
1448 name = "%s_Event_%s.html" % (self.ident, event.ident)
1463 mid = machine.ident
1483 href = "%s_Event_%s.html" % (self.ident, event.ident)
1496 click = "%s_table_%s.html" % (self.ident, state.ident)
1497 over = "%s_State_%s.html" % (self.ident, state.ident)
1523 if action.ident == "z_stall" or \
1524 action.ident == "zz_recycleMandatoryQueue":
1534 elif active_state and next.ident == active_state.ident:
1543 href = "%s_action_%s.html" % (self.ident, action.ident)
1550 click = "%s_table_%s.html" % (self.ident, next.ident)
1551 over = "%s_State_%s.html" % (self.ident, next.ident)
1562 click = "%s_table_%s.html" % (self.ident, state.ident)
1563 over = "%s_State_%s.html" % (self.ident, state.ident)
1576 href = "%s_Event_%s.html" % (self.ident, event.ident)
1587 name = "%s_table_%s.html" % (self.ident, active_state.ident)
1589 name = "%s_table.html" % self.ident