StateMachine.py (8055:e1fd27c723a2) StateMachine.py (8086:bf0335d98250)
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;

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

342 code('$proto')
343
344 if self.EntryType != None:
345 code('''
346
347// Set and Reset for cache_entry variable
348void set_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr, AbstractCacheEntry* m_new_cache_entry);
349void unset_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr);
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;

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

342 code('$proto')
343
344 if self.EntryType != None:
345 code('''
346
347// Set and Reset for cache_entry variable
348void set_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr, AbstractCacheEntry* m_new_cache_entry);
349void unset_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr);
350// Set permissions for the cache_entry
351void set_permission(${{self.EntryType.c_ident}}*& m_cache_entry_ptr, AccessPermission perm);
350''')
351
352 if self.TBEType != None:
353 code('''
354
355// Set and Reset for tbe variable
356void set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${ident}_TBE* m_new_tbe);
357void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr);

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

845 m_cache_entry_ptr = (${{self.EntryType.c_ident}}*)m_new_cache_entry;
846}
847
848void
849$c_ident::unset_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr)
850{
851 m_cache_entry_ptr = 0;
852}
352''')
353
354 if self.TBEType != None:
355 code('''
356
357// Set and Reset for tbe variable
358void set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${ident}_TBE* m_new_tbe);
359void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr);

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

847 m_cache_entry_ptr = (${{self.EntryType.c_ident}}*)m_new_cache_entry;
848}
849
850void
851$c_ident::unset_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr)
852{
853 m_cache_entry_ptr = 0;
854}
855
856void
857$c_ident::set_permission(${{self.EntryType.c_ident}}*& m_cache_entry_ptr,
858 AccessPermission perm)
859{
860 if (m_cache_entry_ptr != NULL) {
861 m_cache_entry_ptr->changePermission(perm);
862 }
863}
853''')
854
855 if self.TBEType != None:
856 code('''
857
858// Set and Reset for tbe variable
859void
860$c_ident::set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${{self.TBEType.c_ident}}* m_new_tbe)

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

1085 ${ident}_State_to_string(state),
1086 ${ident}_State_to_string(next_state),
1087 addr, GET_TRANSITION_COMMENT());
1088
1089 CLEAR_TRANSITION_COMMENT();
1090''')
1091 if self.TBEType != None and self.EntryType != None:
1092 code('${ident}_setState(m_tbe_ptr, m_cache_entry_ptr, addr, next_state);')
864''')
865
866 if self.TBEType != None:
867 code('''
868
869// Set and Reset for tbe variable
870void
871$c_ident::set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${{self.TBEType.c_ident}}* m_new_tbe)

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

1096 ${ident}_State_to_string(state),
1097 ${ident}_State_to_string(next_state),
1098 addr, GET_TRANSITION_COMMENT());
1099
1100 CLEAR_TRANSITION_COMMENT();
1101''')
1102 if self.TBEType != None and self.EntryType != None:
1103 code('${ident}_setState(m_tbe_ptr, m_cache_entry_ptr, addr, next_state);')
1104 code('set_permission(m_cache_entry_ptr, ${ident}_State_to_permission(next_state));')
1093 elif self.TBEType != None:
1094 code('${ident}_setState(m_tbe_ptr, addr, next_state);')
1095 elif self.EntryType != None:
1096 code('${ident}_setState(m_cache_entry_ptr, addr, next_state);')
1105 elif self.TBEType != None:
1106 code('${ident}_setState(m_tbe_ptr, addr, next_state);')
1107 elif self.EntryType != None:
1108 code('${ident}_setState(m_cache_entry_ptr, addr, next_state);')
1109 code('set_permission(m_cache_entry_ptr, ${ident}_State_to_permission(next_state));')
1097 else:
1098 code('${ident}_setState(addr, next_state);')
1099
1100 code('''
1101 } else if (result == TransitionResult_ResourceStall) {
1102 DPRINTFR(ProtocolTrace, "%7s %3s %10s%20s %6s>%-6s %s %s\\n",
1103 g_eventQueue_ptr->getTime(), m_version, "${ident}",
1104 ${ident}_Event_to_string(event),

--- 518 unchanged lines hidden ---
1110 else:
1111 code('${ident}_setState(addr, next_state);')
1112
1113 code('''
1114 } else if (result == TransitionResult_ResourceStall) {
1115 DPRINTFR(ProtocolTrace, "%7s %3s %10s%20s %6s>%-6s %s %s\\n",
1116 g_eventQueue_ptr->getTime(), m_version, "${ident}",
1117 ${ident}_Event_to_string(event),

--- 518 unchanged lines hidden ---