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; --- 324 unchanged lines hidden (view full) --- 333 334 code(''' 335/** \\file $c_ident.cc 336 * 337 * Auto generated C++ code started by $__file__:$__line__ 338 * Created by slicc definition of Module "${{self.short}}" 339 */ 340 |
341#include <cassert> |
342#include <sstream> 343#include <string> 344 345#include "base/cprintf.hh" 346#include "mem/protocol/${ident}_Controller.hh" 347#include "mem/protocol/${ident}_State.hh" 348#include "mem/protocol/${ident}_Event.hh" 349#include "mem/protocol/Types.hh" --- 406 unchanged lines hidden (view full) --- 756 757 code = self.symtab.codeFormatter() 758 ident = self.ident 759 760 code(''' 761// Auto generated C++ code started by $__file__:$__line__ 762// ${ident}: ${{self.short}} 763 |
764#include <cassert> 765 |
766#include "base/misc.hh" 767#include "mem/ruby/common/Global.hh" 768#include "mem/ruby/slicc_interface/RubySlicc_includes.hh" 769#include "mem/protocol/${ident}_Controller.hh" 770#include "mem/protocol/${ident}_State.hh" 771#include "mem/protocol/${ident}_Event.hh" 772#include "mem/protocol/Types.hh" 773#include "mem/ruby/system/System.hh" --- 53 unchanged lines hidden (view full) --- 827 828 code = self.symtab.codeFormatter() 829 ident = self.ident 830 831 code(''' 832// Auto generated C++ code started by $__file__:$__line__ 833// ${ident}: ${{self.short}} 834 |
835#include <cassert> 836 |
837#include "base/misc.hh" |
838#include "base/trace.hh" |
839#include "mem/ruby/common/Global.hh" 840#include "mem/protocol/${ident}_Controller.hh" 841#include "mem/protocol/${ident}_State.hh" 842#include "mem/protocol/${ident}_Event.hh" 843#include "mem/protocol/Types.hh" 844#include "mem/ruby/system/System.hh" 845 846#define HASH_FUN(state, event) ((int(state)*${ident}_Event_NUM)+int(event)) --- 17 unchanged lines hidden (view full) --- 864 865 TransitionResult result = 866 doTransitionWorker(event, state, next_state, addr); 867 868 if (result == TransitionResult_Valid) { 869 DPRINTF(RubyGenerated, "next_state: %s\\n", 870 ${ident}_State_to_string(next_state)); 871 m_profiler.countTransition(state, event); |
872 DPRINTFR(ProtocolTrace, "%7d %3s %10s%20s %6s>%-6s %s %s\\n", 873 g_eventQueue_ptr->getTime(), m_version, "${ident}", 874 ${ident}_Event_to_string(event), 875 ${ident}_State_to_string(state), 876 ${ident}_State_to_string(next_state), 877 addr, GET_TRANSITION_COMMENT()); |
878 |
879 CLEAR_TRANSITION_COMMENT(); 880 ${ident}_setState(addr, next_state); |
881 } else if (result == TransitionResult_ResourceStall) { |
882 DPRINTFR(ProtocolTrace, "%7s %3s %10s%20s %6s>%-6s %s %s\\n", 883 g_eventQueue_ptr->getTime(), m_version, "${ident}", 884 ${ident}_Event_to_string(event), 885 ${ident}_State_to_string(state), 886 ${ident}_State_to_string(next_state), 887 addr, "Resource Stall"); |
888 } else if (result == TransitionResult_ProtocolStall) { 889 DPRINTF(RubyGenerated, "stalling\\n"); |
890 DPRINTFR(ProtocolTrace, "%7s %3s %10s%20s %6s>%-6s %s %s\\n", 891 g_eventQueue_ptr->getTime(), m_version, "${ident}", 892 ${ident}_Event_to_string(event), 893 ${ident}_State_to_string(state), 894 ${ident}_State_to_string(next_state), 895 addr, "Protocol Stall"); |
896 } 897 898 return result; 899} 900 901TransitionResult 902${ident}_Controller::doTransitionWorker(${ident}_Event event, 903 ${ident}_State state, --- 84 unchanged lines hidden (view full) --- 988 989 code(''' 990// Auto generated C++ code started by $__file__:$__line__ 991// ${ident}: ${{self.short}} 992 993#ifndef __${ident}_PROFILE_DUMPER_HH__ 994#define __${ident}_PROFILE_DUMPER_HH__ 995 |
996#include <cassert> |
997#include <iostream> 998#include <vector> 999 1000#include "${ident}_Profiler.hh" 1001#include "${ident}_Event.hh" 1002 1003typedef std::vector<${ident}_Profiler *> ${ident}_profilers; 1004 --- 79 unchanged lines hidden (view full) --- 1084 1085 code(''' 1086// Auto generated C++ code started by $__file__:$__line__ 1087// ${ident}: ${{self.short}} 1088 1089#ifndef __${ident}_PROFILER_HH__ 1090#define __${ident}_PROFILER_HH__ 1091 |
1092#include <cassert> |
1093#include <iostream> 1094 1095#include "mem/ruby/common/Global.hh" 1096#include "mem/protocol/${ident}_State.hh" 1097#include "mem/protocol/${ident}_Event.hh" 1098 1099class ${ident}_Profiler 1100{ --- 21 unchanged lines hidden (view full) --- 1122 def printProfilerCC(self, path): 1123 code = self.symtab.codeFormatter() 1124 ident = self.ident 1125 1126 code(''' 1127// Auto generated C++ code started by $__file__:$__line__ 1128// ${ident}: ${{self.short}} 1129 |
1130#include <cassert> 1131 |
1132#include "mem/protocol/${ident}_Profiler.hh" 1133 1134${ident}_Profiler::${ident}_Profiler() 1135{ 1136 for (int state = 0; state < ${ident}_State_NUM; state++) { 1137 for (int event = 0; event < ${ident}_Event_NUM; event++) { 1138 m_possible[state][event] = false; 1139 m_counters[state][event] = 0; --- 242 unchanged lines hidden --- |