StateMachine.py (7672:d609cd948ca0) | StateMachine.py (7780:42da07116e12) |
---|---|
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; --- 729 unchanged lines hidden (view full) --- 738 if "c_code" not in action: 739 continue 740 741 code(''' 742/** \\brief ${{action.desc}} */ 743void 744$c_ident::${{action.ident}}(const Address& addr) 745{ | 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; --- 729 unchanged lines hidden (view full) --- 738 if "c_code" not in action: 739 continue 740 741 code(''' 742/** \\brief ${{action.desc}} */ 743void 744$c_ident::${{action.ident}}(const Address& addr) 745{ |
746 DEBUG_MSG(GENERATED_COMP, HighPrio, "executing"); | 746 DPRINTF(RubyGenerated, "executing\\n"); |
747 ${{action["c_code"]}} 748} 749 750''') 751 code.write(path, "%s.cc" % c_ident) 752 753 def printCWakeup(self, path): 754 '''Output the wakeup loop for the events''' --- 54 unchanged lines hidden (view full) --- 809 code('') 810 811 code.dedent() 812 code.dedent() 813 code(''' 814 break; // If we got this far, we have nothing left todo 815 } 816 // g_eventQueue_ptr->scheduleEvent(this, 1); | 747 ${{action["c_code"]}} 748} 749 750''') 751 code.write(path, "%s.cc" % c_ident) 752 753 def printCWakeup(self, path): 754 '''Output the wakeup loop for the events''' --- 54 unchanged lines hidden (view full) --- 809 code('') 810 811 code.dedent() 812 code.dedent() 813 code(''' 814 break; // If we got this far, we have nothing left todo 815 } 816 // g_eventQueue_ptr->scheduleEvent(this, 1); |
817 // DEBUG_NEWLINE(GENERATED_COMP, MedPrio); | |
818} 819''') 820 821 code.write(path, "%s_Wakeup.cc" % self.ident) 822 823 def printCSwitch(self, path): 824 '''Output switch statement for transition table''' 825 --- 18 unchanged lines hidden (view full) --- 844 845TransitionResult 846${ident}_Controller::doTransition(${ident}_Event event, 847 ${ident}_State state, 848 const Address &addr) 849{ 850 ${ident}_State next_state = state; 851 | 817} 818''') 819 820 code.write(path, "%s_Wakeup.cc" % self.ident) 821 822 def printCSwitch(self, path): 823 '''Output switch statement for transition table''' 824 --- 18 unchanged lines hidden (view full) --- 843 844TransitionResult 845${ident}_Controller::doTransition(${ident}_Event event, 846 ${ident}_State state, 847 const Address &addr) 848{ 849 ${ident}_State next_state = state; 850 |
852 DEBUG_NEWLINE(GENERATED_COMP, MedPrio); 853 DEBUG_MSG(GENERATED_COMP, MedPrio, *this); 854 DEBUG_EXPR(GENERATED_COMP, MedPrio, g_eventQueue_ptr->getTime()); 855 DEBUG_EXPR(GENERATED_COMP, MedPrio,state); 856 DEBUG_EXPR(GENERATED_COMP, MedPrio,event); 857 DEBUG_EXPR(GENERATED_COMP, MedPrio,addr); | 851 DPRINTF(RubyGenerated, "%s, Time: %lld, state: %s, event: %s, addr: %s\\n", 852 *this, 853 g_eventQueue_ptr->getTime(), 854 ${ident}_State_to_string(state), 855 ${ident}_Event_to_string(event), 856 addr); |
858 859 TransitionResult result = 860 doTransitionWorker(event, state, next_state, addr); 861 862 if (result == TransitionResult_Valid) { | 857 858 TransitionResult result = 859 doTransitionWorker(event, state, next_state, addr); 860 861 if (result == TransitionResult_Valid) { |
863 DEBUG_EXPR(GENERATED_COMP, MedPrio, next_state); 864 DEBUG_NEWLINE(GENERATED_COMP, MedPrio); | 862 DPRINTF(RubyGenerated, "next_state: %s\\n", 863 ${ident}_State_to_string(next_state)); |
865 m_profiler.countTransition(state, event); 866 if (Debug::getProtocolTrace()) { 867 g_system_ptr->getProfiler()->profileTransition("${ident}", 868 m_version, addr, 869 ${ident}_State_to_string(state), 870 ${ident}_Event_to_string(event), 871 ${ident}_State_to_string(next_state), 872 GET_TRANSITION_COMMENT()); --- 6 unchanged lines hidden (view full) --- 879 g_system_ptr->getProfiler()->profileTransition("${ident}", 880 m_version, addr, 881 ${ident}_State_to_string(state), 882 ${ident}_Event_to_string(event), 883 ${ident}_State_to_string(next_state), 884 "Resource Stall"); 885 } 886 } else if (result == TransitionResult_ProtocolStall) { | 864 m_profiler.countTransition(state, event); 865 if (Debug::getProtocolTrace()) { 866 g_system_ptr->getProfiler()->profileTransition("${ident}", 867 m_version, addr, 868 ${ident}_State_to_string(state), 869 ${ident}_Event_to_string(event), 870 ${ident}_State_to_string(next_state), 871 GET_TRANSITION_COMMENT()); --- 6 unchanged lines hidden (view full) --- 878 g_system_ptr->getProfiler()->profileTransition("${ident}", 879 m_version, addr, 880 ${ident}_State_to_string(state), 881 ${ident}_Event_to_string(event), 882 ${ident}_State_to_string(next_state), 883 "Resource Stall"); 884 } 885 } else if (result == TransitionResult_ProtocolStall) { |
887 DEBUG_MSG(GENERATED_COMP, HighPrio, "stalling"); 888 DEBUG_NEWLINE(GENERATED_COMP, MedPrio); | 886 DPRINTF(RubyGenerated, "stalling\\n"); |
889 if (Debug::getProtocolTrace()) { 890 g_system_ptr->getProfiler()->profileTransition("${ident}", 891 m_version, addr, 892 ${ident}_State_to_string(state), 893 ${ident}_Event_to_string(event), 894 ${ident}_State_to_string(next_state), 895 "Protocol Stall"); 896 } --- 485 unchanged lines hidden --- | 887 if (Debug::getProtocolTrace()) { 888 g_system_ptr->getProfiler()->profileTransition("${ident}", 889 m_version, addr, 890 ${ident}_State_to_string(state), 891 ${ident}_Event_to_string(event), 892 ${ident}_State_to_string(next_state), 893 "Protocol Stall"); 894 } --- 485 unchanged lines hidden --- |