StateMachine.py (6888:de8e755aca4f) StateMachine.py (6902:b5baf1dc44b4)
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;

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

228 const int & getVersion() const;
229 const string toString() const;
230 const string getName() const;
231 const MachineType getMachineType() const;
232 void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
233 void print(ostream& out) const;
234 void printConfig(ostream& out) const;
235 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;

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

228 const int & getVersion() const;
229 const string toString() const;
230 const string getName() const;
231 const MachineType getMachineType() const;
232 void initNetworkPtr(Network* net_ptr) { m_net_ptr = net_ptr; }
233 void print(ostream& out) const;
234 void printConfig(ostream& out) const;
235 void wakeup();
236 void printStats(ostream& out) const { s_profiler.dumpStats(out); }
237 void clearStats() { s_profiler.clearStats(); }
236 void printStats(ostream& out) const;
237 void clearStats();
238 void blockOnQueue(Address addr, MessageBuffer* port);
239 void unblock(Address addr);
240private:
241''')
242
243 code.indent()
244 # added by SS
245 for param in self.config_parameters:

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

582void $c_ident::printConfig(ostream& out) const {
583 out << "$c_ident config: " << m_name << endl;
584 out << " version: " << m_version << endl;
585 for (map<string, string>::const_iterator it = m_cfg.begin(); it != m_cfg.end(); it++) {
586 out << " " << (*it).first << ": " << (*it).second << endl;
587 }
588}
589
238 void blockOnQueue(Address addr, MessageBuffer* port);
239 void unblock(Address addr);
240private:
241''')
242
243 code.indent()
244 # added by SS
245 for param in self.config_parameters:

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

582void $c_ident::printConfig(ostream& out) const {
583 out << "$c_ident config: " << m_name << endl;
584 out << " version: " << m_version << endl;
585 for (map<string, string>::const_iterator it = m_cfg.begin(); it != m_cfg.end(); it++) {
586 out << " " << (*it).first << ": " << (*it).second << endl;
587 }
588}
589
590void $c_ident::printStats(ostream& out) const {
591''')
592 #
593 # Cache and Memory Controllers have specific profilers associated with
594 # them. Print out these stats before dumping state transition stats.
595 #
596 for param in self.config_parameters:
597 if param.type_ast.type.ident == "CacheMemory" or \
598 param.type_ast.type.ident == "MemoryControl":
599 assert(param.pointer)
600 code(' m_${{param.ident}}_ptr->printStats(out);')
601
602 code('''
603 s_profiler.dumpStats(out);
604}
605
606void $c_ident::clearStats() {
607''')
608 #
609 # Cache and Memory Controllers have specific profilers associated with
610 # them. These stats must be cleared too.
611 #
612 for param in self.config_parameters:
613 if param.type_ast.type.ident == "CacheMemory" or \
614 param.type_ast.type.ident == "MemoryControl":
615 assert(param.pointer)
616 code(' m_${{param.ident}}_ptr->clearStats();')
617
618 code('''
619 s_profiler.clearStats();
620}
621
590// Actions
591''')
592
593 for action in self.actions.itervalues():
594 if "c_code" not in action:
595 continue
596
597 code('''

--- 510 unchanged lines hidden ---
622// Actions
623''')
624
625 for action in self.actions.itervalues():
626 if "c_code" not in action:
627 continue
628
629 code('''

--- 510 unchanged lines hidden ---