StateMachine.py (8337:b9ba22cb23f2) StateMachine.py (8341:30daf1dd5c91)
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;

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

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

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

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

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

859 m_cache_entry_ptr = (${{self.EntryType.c_ident}}*)m_new_cache_entry;
860}
861
862void
863$c_ident::unset_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr)
864{
865 m_cache_entry_ptr = 0;
866}
351''')
352
353 if self.TBEType != None:
354 code('''
355
356// Set and Reset for tbe variable
357void set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${ident}_TBE* m_new_tbe);
358void unset_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr);

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

857 m_cache_entry_ptr = (${{self.EntryType.c_ident}}*)m_new_cache_entry;
858}
859
860void
861$c_ident::unset_cache_entry(${{self.EntryType.c_ident}}*& m_cache_entry_ptr)
862{
863 m_cache_entry_ptr = 0;
864}
867
868void
869$c_ident::set_permission(${{self.EntryType.c_ident}}*& m_cache_entry_ptr,
870 AccessPermission perm)
871{
872 if (m_cache_entry_ptr != NULL) {
873 m_cache_entry_ptr->changePermission(perm);
874 }
875}
876''')
877
878 if self.TBEType != None:
879 code('''
880
881// Set and Reset for tbe variable
882void
883$c_ident::set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${{self.TBEType.c_ident}}* m_new_tbe)

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

1111 ${ident}_State_to_string(state),
1112 ${ident}_State_to_string(next_state),
1113 addr, GET_TRANSITION_COMMENT());
1114
1115 CLEAR_TRANSITION_COMMENT();
1116''')
1117 if self.TBEType != None and self.EntryType != None:
1118 code('setState(m_tbe_ptr, m_cache_entry_ptr, addr, next_state);')
865''')
866
867 if self.TBEType != None:
868 code('''
869
870// Set and Reset for tbe variable
871void
872$c_ident::set_tbe(${{self.TBEType.c_ident}}*& m_tbe_ptr, ${{self.TBEType.c_ident}}* m_new_tbe)

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

1100 ${ident}_State_to_string(state),
1101 ${ident}_State_to_string(next_state),
1102 addr, GET_TRANSITION_COMMENT());
1103
1104 CLEAR_TRANSITION_COMMENT();
1105''')
1106 if self.TBEType != None and self.EntryType != None:
1107 code('setState(m_tbe_ptr, m_cache_entry_ptr, addr, next_state);')
1119 code('set_permission(m_cache_entry_ptr, ${ident}_State_to_permission(next_state));')
1108 code('setAccessPermission(m_cache_entry_ptr, addr, next_state);')
1120 elif self.TBEType != None:
1121 code('setState(m_tbe_ptr, addr, next_state);')
1109 elif self.TBEType != None:
1110 code('setState(m_tbe_ptr, addr, next_state);')
1111 code('setAccessPermission(addr, next_state);')
1122 elif self.EntryType != None:
1123 code('setState(m_cache_entry_ptr, addr, next_state);')
1112 elif self.EntryType != None:
1113 code('setState(m_cache_entry_ptr, addr, next_state);')
1124 code('set_permission(m_cache_entry_ptr, ${ident}_State_to_permission(next_state));')
1114 code('setAccessPermission(m_cache_entry_ptr, addr, next_state);')
1125 else:
1126 code('setState(addr, next_state);')
1115 else:
1116 code('setState(addr, next_state);')
1117 code('setAccessPermission(addr, next_state);')
1127
1128 code('''
1129 } else if (result == TransitionResult_ResourceStall) {
1130 DPRINTFR(ProtocolTrace, "%15s %3s %10s%20s %6s>%-6s %s %s\\n",
1131 curTick(), m_version, "${ident}",
1132 ${ident}_Event_to_string(event),
1133 ${ident}_State_to_string(state),
1134 ${ident}_State_to_string(next_state),

--- 516 unchanged lines hidden ---
1118
1119 code('''
1120 } else if (result == TransitionResult_ResourceStall) {
1121 DPRINTFR(ProtocolTrace, "%15s %3s %10s%20s %6s>%-6s %s %s\\n",
1122 curTick(), m_version, "${ident}",
1123 ${ident}_Event_to_string(event),
1124 ${ident}_State_to_string(state),
1125 ${ident}_State_to_string(next_state),

--- 516 unchanged lines hidden ---