Deleted Added
sdiff udiff text old ( 3624:aaba7e06ece4 ) new ( 4081:80f1e833d118 )
full compact
1# Copyright (c) 2004-2006 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

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

648 for child in child_names:
649 self._children[child].unproxy_all()
650
651 def print_ini(self):
652 print '[' + self.path() + ']' # .ini section header
653
654 instanceDict[self.path()] = self
655
656 if hasattr(self, 'type') and not isinstance(self, ParamContext):
657 print 'type=%s' % self.type
658
659 child_names = self._children.keys()
660 child_names.sort()
661 np_child_names = [c for c in child_names \
662 if not isinstance(self._children[c], ParamContext)]
663 if len(np_child_names):
664 print 'children=%s' % ' '.join(np_child_names)
665
666 param_names = self._params.keys()
667 param_names.sort()
668 for param in param_names:
669 value = self._values.get(param)
670 if value != None:
671 print '%s=%s' % (param, self._values[param].ini_str())
672

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

706 def connectPorts(self):
707 for portRef in self._port_refs.itervalues():
708 portRef.ccConnect()
709 for child in self._children.itervalues():
710 child.connectPorts()
711
712 def startDrain(self, drain_event, recursive):
713 count = 0
714 # ParamContexts don't serialize
715 if isinstance(self, SimObject) and not isinstance(self, ParamContext):
716 count += self._ccObject.drain(drain_event)
717 if recursive:
718 for child in self._children.itervalues():
719 count += child.startDrain(drain_event, True)
720 return count
721
722 def resume(self):
723 if isinstance(self, SimObject) and not isinstance(self, ParamContext):
724 self._ccObject.resume()
725 for child in self._children.itervalues():
726 child.resume()
727
728 def changeTiming(self, mode):
729 if isinstance(self, m5.objects.System):
730 # i don't know if there's a better way to do this - calling
731 # setMemoryMode directly from self._ccObject results in calling

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

777 tailport="w"))
778 label += '}'
779 dot.add_node(pydot.Node(self.path,shape="Mrecord",label=label))
780
781 # recursively dump out children
782 for c in self.children:
783 c.outputDot(dot)
784
785class ParamContext(SimObject):
786 pass
787
788# Function to provide to C++ so it can look up instances based on paths
789def resolveSimObject(name):
790 obj = instanceDict[name]
791 return obj.getCCObject()
792
793# __all__ defines the list of symbols that get exported when
794# 'from config import *' is invoked. Try to keep this reasonably
795# short to avoid polluting other namespaces.
796__all__ = ['SimObject', 'ParamContext']
797
798# see comment on imports at end of __init__.py.
799import proxy
800import internal
801import m5