StateMachine.py (6779:4e611eba2b13) StateMachine.py (6793:bc8c8617c4f0)
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;

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

157#include "mem/ruby/slicc_interface/AbstractController.hh"
158#include "mem/protocol/TransitionResult.hh"
159#include "mem/protocol/Types.hh"
160#include "mem/protocol/${ident}_Profiler.hh"
161''')
162
163 seen_types = set()
164 for var in self.objects:
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;

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

157#include "mem/ruby/slicc_interface/AbstractController.hh"
158#include "mem/protocol/TransitionResult.hh"
159#include "mem/protocol/Types.hh"
160#include "mem/protocol/${ident}_Profiler.hh"
161''')
162
163 seen_types = set()
164 for var in self.objects:
165 if var.type.ident not in seen_types:
165 if var.type.ident not in seen_types and not var.type.isPrimitive:
166 code('#include "mem/protocol/${{var.type.c_ident}}.hh"')
167 seen_types.add(var.type.ident)
168
169 # for adding information to the protocol debug trace
170 code('''
171extern stringstream ${ident}_transitionComment;
172
173class $c_ident : public AbstractController {

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

278#include "mem/protocol/${ident}_Event.hh"
279#include "mem/protocol/Types.hh"
280#include "mem/ruby/system/System.hh"
281''')
282
283 # include object classes
284 seen_types = set()
285 for var in self.objects:
166 code('#include "mem/protocol/${{var.type.c_ident}}.hh"')
167 seen_types.add(var.type.ident)
168
169 # for adding information to the protocol debug trace
170 code('''
171extern stringstream ${ident}_transitionComment;
172
173class $c_ident : public AbstractController {

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

278#include "mem/protocol/${ident}_Event.hh"
279#include "mem/protocol/Types.hh"
280#include "mem/ruby/system/System.hh"
281''')
282
283 # include object classes
284 seen_types = set()
285 for var in self.objects:
286 if var.type.ident not in seen_types:
286 if var.type.ident not in seen_types and not var.type.isPrimitive:
287 code('#include "mem/protocol/${{var.type.c_ident}}.hh"')
288 seen_types.add(var.type.ident)
289
290 code('''
291int $c_ident::m_num_controllers = 0;
292
293stringstream ${ident}_transitionComment;
294#define APPEND_TRANSITION_COMMENT(str) (${ident}_transitionComment << str)

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

334''')
335
336 code.indent()
337 code.indent()
338 for param in self.config_parameters:
339 code('else if (argv[i] == "${{param.name}}")')
340 if param.type_ast.type.ident == "int":
341 code(' m_${{param.name}} = atoi(argv[i+1].c_str());')
287 code('#include "mem/protocol/${{var.type.c_ident}}.hh"')
288 seen_types.add(var.type.ident)
289
290 code('''
291int $c_ident::m_num_controllers = 0;
292
293stringstream ${ident}_transitionComment;
294#define APPEND_TRANSITION_COMMENT(str) (${ident}_transitionComment << str)

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

334''')
335
336 code.indent()
337 code.indent()
338 for param in self.config_parameters:
339 code('else if (argv[i] == "${{param.name}}")')
340 if param.type_ast.type.ident == "int":
341 code(' m_${{param.name}} = atoi(argv[i+1].c_str());')
342 elif param.type_ast.type.ident == "bool":
343 code(' m_${{param.name}} = string_to_bool(argv[i+1]);')
342 else:
344 else:
343 self.error("only int parameters are supported right now")
345 self.error("only int and bool parameters are "\
346 "currently supported")
344 code.dedent()
345 code.dedent()
346 code('''
347 }
348
349 m_net_ptr = net_ptr;
350 m_machineID.type = MachineType_${ident};
351 m_machineID.num = m_version;

--- 871 unchanged lines hidden ---
347 code.dedent()
348 code.dedent()
349 code('''
350 }
351
352 m_net_ptr = net_ptr;
353 m_machineID.type = MachineType_${ident};
354 m_machineID.num = m_version;

--- 871 unchanged lines hidden ---