StateMachine.py (9273:05b12cb19cc8) | StateMachine.py (9302:c2e70a9bc340) |
---|---|
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; --- 255 unchanged lines hidden (view full) --- 264 void wakeup(); 265 void printStats(std::ostream& out) const; 266 void clearStats(); 267 void blockOnQueue(Address addr, MessageBuffer* port); 268 void unblock(Address addr); 269 void recordCacheTrace(int cntrl, CacheRecorder* tr); 270 Sequencer* getSequencer() const; 271 | 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; --- 255 unchanged lines hidden (view full) --- 264 void wakeup(); 265 void printStats(std::ostream& out) const; 266 void clearStats(); 267 void blockOnQueue(Address addr, MessageBuffer* port); 268 void unblock(Address addr); 269 void recordCacheTrace(int cntrl, CacheRecorder* tr); 270 Sequencer* getSequencer() const; 271 |
272 bool functionalReadBuffers(PacketPtr&); 273 uint32_t functionalWriteBuffers(PacketPtr&); 274 |
|
272private: 273''') 274 275 code.indent() 276 # added by SS 277 for param in self.config_parameters: 278 if param.pointer: 279 code('${{param.type_ast.type}}* m_${{param.ident}}_ptr;') --- 702 unchanged lines hidden (view full) --- 982 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n"); 983 ${{action["c_code"]}} 984} 985 986''') 987 for func in self.functions: 988 code(func.generateCode()) 989 | 275private: 276''') 277 278 code.indent() 279 # added by SS 280 for param in self.config_parameters: 281 if param.pointer: 282 code('${{param.type_ast.type}}* m_${{param.ident}}_ptr;') --- 702 unchanged lines hidden (view full) --- 985 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n"); 986 ${{action["c_code"]}} 987} 988 989''') 990 for func in self.functions: 991 code(func.generateCode()) 992 |
993 # Function for functional reads from messages buffered in the controller 994 code(''' 995bool 996$c_ident::functionalReadBuffers(PacketPtr& pkt) 997{ 998''') 999 for var in self.objects: 1000 vtype = var.type 1001 if vtype.isBuffer: 1002 vid = "m_%s_ptr" % var.c_ident 1003 code('if ($vid->functionalRead(pkt)) { return true; }') 1004 code(''' 1005 return false; 1006} 1007''') 1008 1009 # Function for functional writes to messages buffered in the controller 1010 code(''' 1011uint32_t 1012$c_ident::functionalWriteBuffers(PacketPtr& pkt) 1013{ 1014 uint32_t num_functional_writes = 0; 1015''') 1016 for var in self.objects: 1017 vtype = var.type 1018 if vtype.isBuffer: 1019 vid = "m_%s_ptr" % var.c_ident 1020 code('num_functional_writes += $vid->functionalWrite(pkt);') 1021 code(''' 1022 return num_functional_writes; 1023} 1024''') 1025 |
|
990 code.write(path, "%s.cc" % c_ident) 991 992 def printCWakeup(self, path, includes): 993 '''Output the wakeup loop for the events''' 994 995 code = self.symtab.codeFormatter() 996 ident = self.ident 997 --- 714 unchanged lines hidden --- | 1026 code.write(path, "%s.cc" % c_ident) 1027 1028 def printCWakeup(self, path, includes): 1029 '''Output the wakeup loop for the events''' 1030 1031 code = self.symtab.codeFormatter() 1032 ident = self.ident 1033 --- 714 unchanged lines hidden --- |