StateMachine.py (10010:4aa1135c05d4) | StateMachine.py (10012:ec5a5bfb941d) |
---|---|
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; --- 243 unchanged lines hidden (view full) --- 252 $c_ident(const Params *p); 253 static int getNumControllers(); 254 void init(); 255 MessageBuffer* getMandatoryQueue() const; 256 const std::string toString() const; 257 258 void print(std::ostream& out) const; 259 void wakeup(); | 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; --- 243 unchanged lines hidden (view full) --- 252 $c_ident(const Params *p); 253 static int getNumControllers(); 254 void init(); 255 MessageBuffer* getMandatoryQueue() const; 256 const std::string toString() const; 257 258 void print(std::ostream& out) const; 259 void wakeup(); |
260 void clearStats(); | 260 void resetStats(); |
261 void regStats(); 262 void collateStats(); 263 264 void recordCacheTrace(int cntrl, CacheRecorder* tr); 265 Sequencer* getSequencer() const; 266 267 bool functionalReadBuffers(PacketPtr&); 268 uint32_t functionalWriteBuffers(PacketPtr&); --- 416 unchanged lines hidden (view full) --- 685 if not stall: 686 state = "%s_State_%s" % (self.ident, trans.state.ident) 687 event = "%s_Event_%s" % (self.ident, trans.event.ident) 688 code('possibleTransition($state, $event);') 689 690 code.dedent() 691 code(''' 692 AbstractController::init(); | 261 void regStats(); 262 void collateStats(); 263 264 void recordCacheTrace(int cntrl, CacheRecorder* tr); 265 Sequencer* getSequencer() const; 266 267 bool functionalReadBuffers(PacketPtr&); 268 uint32_t functionalWriteBuffers(PacketPtr&); --- 416 unchanged lines hidden (view full) --- 685 if not stall: 686 state = "%s_State_%s" % (self.ident, trans.state.ident) 687 event = "%s_Event_%s" % (self.ident, trans.event.ident) 688 code('possibleTransition($state, $event);') 689 690 code.dedent() 691 code(''' 692 AbstractController::init(); |
693 clearStats(); | 693 resetStats(); |
694} 695''') 696 697 has_mandatory_q = False 698 for port in self.in_ports: 699 if port.code.find("mandatoryQueue_ptr") >= 0: 700 has_mandatory_q = True 701 --- 8 unchanged lines hidden (view full) --- 710 assert(param.pointer) 711 seq_ident = "m_%s_ptr" % param.name 712 713 code(''' 714 715void 716$c_ident::regStats() 717{ | 694} 695''') 696 697 has_mandatory_q = False 698 for port in self.in_ports: 699 if port.code.find("mandatoryQueue_ptr") >= 0: 700 has_mandatory_q = True 701 --- 8 unchanged lines hidden (view full) --- 710 assert(param.pointer) 711 seq_ident = "m_%s_ptr" % param.name 712 713 code(''' 714 715void 716$c_ident::regStats() 717{ |
718 AbstractController::regStats(); 719 |
|
718 if (m_version == 0) { 719 for (${ident}_Event event = ${ident}_Event_FIRST; 720 event < ${ident}_Event_NUM; ++event) { 721 Stats::Vector *t = new Stats::Vector(); 722 t->init(m_num_controllers); | 720 if (m_version == 0) { 721 for (${ident}_Event event = ${ident}_Event_FIRST; 722 event < ${ident}_Event_NUM; ++event) { 723 Stats::Vector *t = new Stats::Vector(); 724 t->init(m_num_controllers); |
723 t->name(name() + "." + ${ident}_Event_to_string(event)); | 725 t->name(g_system_ptr->name() + ".${c_ident}." + 726 ${ident}_Event_to_string(event)); |
724 t->flags(Stats::pdf | Stats::total | Stats::oneline | 725 Stats::nozero); 726 727 eventVec.push_back(t); 728 } 729 730 for (${ident}_State state = ${ident}_State_FIRST; 731 state < ${ident}_State_NUM; ++state) { 732 733 transVec.push_back(std::vector<Stats::Vector *>()); 734 735 for (${ident}_Event event = ${ident}_Event_FIRST; 736 event < ${ident}_Event_NUM; ++event) { 737 738 Stats::Vector *t = new Stats::Vector(); 739 t->init(m_num_controllers); | 727 t->flags(Stats::pdf | Stats::total | Stats::oneline | 728 Stats::nozero); 729 730 eventVec.push_back(t); 731 } 732 733 for (${ident}_State state = ${ident}_State_FIRST; 734 state < ${ident}_State_NUM; ++state) { 735 736 transVec.push_back(std::vector<Stats::Vector *>()); 737 738 for (${ident}_Event event = ${ident}_Event_FIRST; 739 event < ${ident}_Event_NUM; ++event) { 740 741 Stats::Vector *t = new Stats::Vector(); 742 t->init(m_num_controllers); |
740 t->name(name() + "." + ${ident}_State_to_string(state) + | 743 t->name(g_system_ptr->name() + ".${c_ident}." + 744 ${ident}_State_to_string(state) + |
741 "." + ${ident}_Event_to_string(event)); 742 743 t->flags(Stats::pdf | Stats::total | Stats::oneline | 744 Stats::nozero); 745 transVec[state].push_back(t); 746 } 747 } 748 } --- 88 unchanged lines hidden (view full) --- 837} 838 839void 840$c_ident::print(ostream& out) const 841{ 842 out << "[$c_ident " << m_version << "]"; 843} 844 | 745 "." + ${ident}_Event_to_string(event)); 746 747 t->flags(Stats::pdf | Stats::total | Stats::oneline | 748 Stats::nozero); 749 transVec[state].push_back(t); 750 } 751 } 752 } --- 88 unchanged lines hidden (view full) --- 841} 842 843void 844$c_ident::print(ostream& out) const 845{ 846 out << "[$c_ident " << m_version << "]"; 847} 848 |
845void $c_ident::clearStats() | 849void $c_ident::resetStats() |
846{ 847 for (int state = 0; state < ${ident}_State_NUM; state++) { 848 for (int event = 0; event < ${ident}_Event_NUM; event++) { 849 m_counters[state][event] = 0; 850 } 851 } 852 853 for (int event = 0; event < ${ident}_Event_NUM; event++) { 854 m_event_counters[event] = 0; 855 } 856 | 850{ 851 for (int state = 0; state < ${ident}_State_NUM; state++) { 852 for (int event = 0; event < ${ident}_Event_NUM; event++) { 853 m_counters[state][event] = 0; 854 } 855 } 856 857 for (int event = 0; event < ${ident}_Event_NUM; event++) { 858 m_event_counters[event] = 0; 859 } 860 |
857 AbstractController::clearStats(); | 861 AbstractController::resetStats(); |
858} 859''') 860 861 if self.EntryType != None: 862 code(''' 863 864// Set and Reset for cache_entry variable 865void --- 672 unchanged lines hidden --- | 862} 863''') 864 865 if self.EntryType != None: 866 code(''' 867 868// Set and Reset for cache_entry variable 869void --- 672 unchanged lines hidden --- |