Deleted Added
sdiff udiff text old ( 6882:898047a3672c ) new ( 6888:de8e755aca4f )
full compact
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;

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

33
34python_class_map = {"int": "Int",
35 "string": "String",
36 "bool": "Bool",
37 "CacheMemory": "RubyCache",
38 "Sequencer": "RubySequencer",
39 "DirectoryMemory": "RubyDirectoryMemory",
40 "MemoryControl": "RubyMemoryControl",
41 }
42
43class StateMachine(Symbol):
44 def __init__(self, symtab, ident, location, pairs, config_parameters):
45 super(StateMachine, self).__init__(symtab, ident, location, pairs)
46 self.table = None
47 self.config_parameters = config_parameters
48 for param in config_parameters:

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

354 #
355 # After initializing the universal machine parameters, initialize the
356 # this machines config parameters. Also detemine if these configuration
357 # params include a sequencer. This information will be used later for
358 # contecting the sequencer back to the L1 cache controller.
359 #
360 contains_sequencer = False
361 for param in self.config_parameters:
362 if param.name == "sequencer":
363 contains_sequencer = True
364 if param.pointer:
365 code('m_${{param.name}}_ptr = p->${{param.name}};')
366 else:
367 code('m_${{param.name}} = p->${{param.name}};')
368
369 #
370 # For the l1 cache controller, add the special atomic support which
371 # includes passing the sequencer a pointer to the controller.
372 #
373 if self.ident == "L1Cache":
374 if not contains_sequencer:
375 self.error("The L1Cache controller must include the sequencer " \
376 "configuration parameter")
377
378 code('''
379m_sequencer_ptr->setController(this);
380''')
381
382 code('m_num_controllers++;')
383 for var in self.objects:
384 if var.ident.find("mandatoryQueue") >= 0:
385 code('m_${{var.c_ident}}_ptr = new ${{var.type.c_ident}}();')
386
387 code.dedent()
388 code('''
389}

--- 705 unchanged lines hidden ---