StateMachine.py (10311:ad9c042dce54) StateMachine.py (10523:5777a3e55603)
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;

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

280 void wakeup();
281 void resetStats();
282 void regStats();
283 void collateStats();
284
285 void recordCacheTrace(int cntrl, CacheRecorder* tr);
286 Sequencer* getSequencer() const;
287
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;

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

280 void wakeup();
281 void resetStats();
282 void regStats();
283 void collateStats();
284
285 void recordCacheTrace(int cntrl, CacheRecorder* tr);
286 Sequencer* getSequencer() const;
287
288 bool functionalReadBuffers(PacketPtr&);
289 uint32_t functionalWriteBuffers(PacketPtr&);
290
291 void countTransition(${ident}_State state, ${ident}_Event event);
292 void possibleTransition(${ident}_State state, ${ident}_Event event);
293 uint64 getEventCount(${ident}_Event event);
294 bool isPossible(${ident}_State state, ${ident}_Event event);
295 uint64 getTransitionCount(${ident}_State state, ${ident}_Event event);
296

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

983 DPRINTF(RubyGenerated, "executing ${{action.ident}}\\n");
984 ${{action["c_code"]}}
985}
986
987''')
988 for func in self.functions:
989 code(func.generateCode())
990
288 uint32_t functionalWriteBuffers(PacketPtr&);
289
290 void countTransition(${ident}_State state, ${ident}_Event event);
291 void possibleTransition(${ident}_State state, ${ident}_Event event);
292 uint64 getEventCount(${ident}_Event event);
293 bool isPossible(${ident}_State state, ${ident}_Event event);
294 uint64 getTransitionCount(${ident}_State state, ${ident}_Event event);
295

--- 686 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
991 # Function for functional reads from messages buffered in the controller
992 code('''
993bool
994$c_ident::functionalReadBuffers(PacketPtr& pkt)
995{
996''')
997 for var in self.objects:
998 vtype = var.type
999 if vtype.isBuffer:
1000 vid = "m_%s_ptr" % var.ident
1001 code('if ($vid->functionalRead(pkt)) { return true; }')
1002
1003 for var in self.config_parameters:
1004 vtype = var.type_ast.type
1005 if vtype.isBuffer:
1006 vid = "m_%s_ptr" % var.ident
1007 code('if ($vid->functionalRead(pkt)) { return true; }')
1008
1009 code('''
1010 return false;
1011}
1012''')
1013
1014 # Function for functional writes to messages buffered in the controller
1015 code('''
1016uint32_t
1017$c_ident::functionalWriteBuffers(PacketPtr& pkt)
1018{
1019 uint32_t num_functional_writes = 0;
1020''')
1021 for var in self.objects:

--- 529 unchanged lines hidden ---
990 # Function for functional writes to messages buffered in the controller
991 code('''
992uint32_t
993$c_ident::functionalWriteBuffers(PacketPtr& pkt)
994{
995 uint32_t num_functional_writes = 0;
996''')
997 for var in self.objects:

--- 529 unchanged lines hidden ---