StateMachine.py (7780:42da07116e12) StateMachine.py (7805:f249937228b5)
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;

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

824
825 code = self.symtab.codeFormatter()
826 ident = self.ident
827
828 code('''
829// Auto generated C++ code started by $__file__:$__line__
830// ${ident}: ${{self.short}}
831
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;

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

824
825 code = self.symtab.codeFormatter()
826 ident = self.ident
827
828 code('''
829// Auto generated C++ code started by $__file__:$__line__
830// ${ident}: ${{self.short}}
831
832#include "base/misc.hh"
832#include "mem/ruby/common/Global.hh"
833#include "mem/protocol/${ident}_Controller.hh"
834#include "mem/protocol/${ident}_State.hh"
835#include "mem/protocol/${ident}_Event.hh"
836#include "mem/protocol/Types.hh"
837#include "mem/ruby/system/System.hh"
838
839#define HASH_FUN(state, event) ((int(state)*${ident}_Event_NUM)+int(event))

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

967 # Iterative over all the multiple transitions that share
968 # the same code
969 for trans in transitions:
970 code(' case HASH_FUN($trans):')
971 code(' $case')
972
973 code('''
974 default:
833#include "mem/ruby/common/Global.hh"
834#include "mem/protocol/${ident}_Controller.hh"
835#include "mem/protocol/${ident}_State.hh"
836#include "mem/protocol/${ident}_Event.hh"
837#include "mem/protocol/Types.hh"
838#include "mem/ruby/system/System.hh"
839
840#define HASH_FUN(state, event) ((int(state)*${ident}_Event_NUM)+int(event))

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

968 # Iterative over all the multiple transitions that share
969 # the same code
970 for trans in transitions:
971 code(' case HASH_FUN($trans):')
972 code(' $case')
973
974 code('''
975 default:
975 WARN_EXPR(m_version);
976 WARN_EXPR(g_eventQueue_ptr->getTime());
977 WARN_EXPR(addr);
978 WARN_EXPR(event);
979 WARN_EXPR(state);
980 ERROR_MSG(\"Invalid transition\");
976 fatal("Invalid transition\\n"
977 "version: %d time: %d addr: %s event: %s state: %s\\n",
978 m_version, g_eventQueue_ptr->getTime(), addr, event, state);
981 }
982 return TransitionResult_Valid;
983}
984''')
985 code.write(path, "%s_Transitions.cc" % self.ident)
986
987 def printProfileDumperHH(self, path):
988 code = self.symtab.codeFormatter()

--- 391 unchanged lines hidden ---
979 }
980 return TransitionResult_Valid;
981}
982''')
983 code.write(path, "%s_Transitions.cc" % self.ident)
984
985 def printProfileDumperHH(self, path):
986 code = self.symtab.codeFormatter()

--- 391 unchanged lines hidden ---