StateMachine.py (9105:b576c490e7d1) StateMachine.py (9171:ae88ecf37145)
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;

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

1032 while (true) {
1033 // Some cases will put us into an infinite loop without this limit
1034 assert(counter <= m_transitions_per_cycle);
1035 if (counter == m_transitions_per_cycle) {
1036 // Count how often we are fully utilized
1037 g_system_ptr->getProfiler()->controllerBusy(m_machineID);
1038
1039 // Wakeup in another cycle and try again
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;

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

1032 while (true) {
1033 // Some cases will put us into an infinite loop without this limit
1034 assert(counter <= m_transitions_per_cycle);
1035 if (counter == m_transitions_per_cycle) {
1036 // Count how often we are fully utilized
1037 g_system_ptr->getProfiler()->controllerBusy(m_machineID);
1038
1039 // Wakeup in another cycle and try again
1040 g_eventQueue_ptr->scheduleEvent(this, 1);
1040 scheduleEvent(this, 1);
1041 break;
1042 }
1043''')
1044
1045 code.indent()
1046 code.indent()
1047
1048 # InPorts

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

1059
1060 code('')
1061
1062 code.dedent()
1063 code.dedent()
1064 code('''
1065 break; // If we got this far, we have nothing left todo
1066 }
1041 break;
1042 }
1043''')
1044
1045 code.indent()
1046 code.indent()
1047
1048 # InPorts

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

1059
1060 code('')
1061
1062 code.dedent()
1063 code.dedent()
1064 code('''
1065 break; // If we got this far, we have nothing left todo
1066 }
1067 // g_eventQueue_ptr->scheduleEvent(this, 1);
1068}
1069''')
1070
1071 code.write(path, "%s_Wakeup.cc" % self.ident)
1072
1073 def printCSwitch(self, path):
1074 '''Output switch statement for transition table'''
1075

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

1121 code('${ident}_State state = getState(m_cache_entry_ptr, addr);')
1122 else:
1123 code('${ident}_State state = getState(addr);')
1124
1125 code('''
1126 ${ident}_State next_state = state;
1127
1128 DPRINTF(RubyGenerated, "%s, Time: %lld, state: %s, event: %s, addr: %s\\n",
1067}
1068''')
1069
1070 code.write(path, "%s_Wakeup.cc" % self.ident)
1071
1072 def printCSwitch(self, path):
1073 '''Output switch statement for transition table'''
1074

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

1120 code('${ident}_State state = getState(m_cache_entry_ptr, addr);')
1121 else:
1122 code('${ident}_State state = getState(addr);')
1123
1124 code('''
1125 ${ident}_State next_state = state;
1126
1127 DPRINTF(RubyGenerated, "%s, Time: %lld, state: %s, event: %s, addr: %s\\n",
1129 *this,
1130 g_eventQueue_ptr->getTime(),
1131 ${ident}_State_to_string(state),
1132 ${ident}_Event_to_string(event),
1133 addr);
1128 *this, g_system_ptr->getTime(), ${ident}_State_to_string(state),
1129 ${ident}_Event_to_string(event), addr);
1134
1135 TransitionResult result =
1136''')
1137 if self.TBEType != None and self.EntryType != None:
1138 code('doTransitionWorker(event, state, next_state, m_tbe_ptr, m_cache_entry_ptr, addr);')
1139 elif self.TBEType != None:
1140 code('doTransitionWorker(event, state, next_state, m_tbe_ptr, addr);')
1141 elif self.EntryType != None:

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

1297 for trans in transitions:
1298 code(' case HASH_FUN($trans):')
1299 code(' $case')
1300
1301 code('''
1302 default:
1303 fatal("Invalid transition\\n"
1304 "%s time: %d addr: %s event: %s state: %s\\n",
1130
1131 TransitionResult result =
1132''')
1133 if self.TBEType != None and self.EntryType != None:
1134 code('doTransitionWorker(event, state, next_state, m_tbe_ptr, m_cache_entry_ptr, addr);')
1135 elif self.TBEType != None:
1136 code('doTransitionWorker(event, state, next_state, m_tbe_ptr, addr);')
1137 elif self.EntryType != None:

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

1293 for trans in transitions:
1294 code(' case HASH_FUN($trans):')
1295 code(' $case')
1296
1297 code('''
1298 default:
1299 fatal("Invalid transition\\n"
1300 "%s time: %d addr: %s event: %s state: %s\\n",
1305 name(), g_eventQueue_ptr->getTime(), addr, event, state);
1301 name(), g_system_ptr->getTime(), addr, event, state);
1306 }
1307 return TransitionResult_Valid;
1308}
1309''')
1310 code.write(path, "%s_Transitions.cc" % self.ident)
1311
1312 def printProfileDumperHH(self, path):
1313 code = self.symtab.codeFormatter()

--- 395 unchanged lines hidden ---
1302 }
1303 return TransitionResult_Valid;
1304}
1305''')
1306 code.write(path, "%s_Transitions.cc" % self.ident)
1307
1308 def printProfileDumperHH(self, path):
1309 code = self.symtab.codeFormatter()

--- 395 unchanged lines hidden ---