SimObject.py (4081:80f1e833d118) | SimObject.py (4123:9c80390ea1bb) |
---|---|
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 --- 679 unchanged lines hidden (view full) --- 688 child.createCCObject() 689 690 # Get C++ object corresponding to this object, calling C++ if 691 # necessary to construct it. Does *not* recursively create 692 # children. 693 def getCCObject(self): 694 if not self._ccObject: 695 self._ccObject = -1 # flag to catch cycles in recursion | 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 --- 679 unchanged lines hidden (view full) --- 688 child.createCCObject() 689 690 # Get C++ object corresponding to this object, calling C++ if 691 # necessary to construct it. Does *not* recursively create 692 # children. 693 def getCCObject(self): 694 if not self._ccObject: 695 self._ccObject = -1 # flag to catch cycles in recursion |
696 self._ccObject = internal.main.createSimObject(self.path()) | 696 self._ccObject = internal.sim_object.createSimObject(self.path()) |
697 elif self._ccObject == -1: 698 raise RuntimeError, "%s: recursive call to getCCObject()" \ 699 % self.path() 700 return self._ccObject 701 702 # Create C++ port connections corresponding to the connections in 703 # _port_refs (& recursively for all children) 704 def connectPorts(self): --- 17 unchanged lines hidden (view full) --- 722 for child in self._children.itervalues(): 723 child.resume() 724 725 def changeTiming(self, mode): 726 if isinstance(self, m5.objects.System): 727 # i don't know if there's a better way to do this - calling 728 # setMemoryMode directly from self._ccObject results in calling 729 # SimObject::setMemoryMode, not the System::setMemoryMode | 697 elif self._ccObject == -1: 698 raise RuntimeError, "%s: recursive call to getCCObject()" \ 699 % self.path() 700 return self._ccObject 701 702 # Create C++ port connections corresponding to the connections in 703 # _port_refs (& recursively for all children) 704 def connectPorts(self): --- 17 unchanged lines hidden (view full) --- 722 for child in self._children.itervalues(): 723 child.resume() 724 725 def changeTiming(self, mode): 726 if isinstance(self, m5.objects.System): 727 # i don't know if there's a better way to do this - calling 728 # setMemoryMode directly from self._ccObject results in calling 729 # SimObject::setMemoryMode, not the System::setMemoryMode |
730 system_ptr = internal.main.convertToSystemPtr(self._ccObject) | 730 system_ptr = internal.sim_object.convertToSystemPtr(self._ccObject) |
731 system_ptr.setMemoryMode(mode) 732 for child in self._children.itervalues(): 733 child.changeTiming(mode) 734 735 def takeOverFrom(self, old_cpu): | 731 system_ptr.setMemoryMode(mode) 732 for child in self._children.itervalues(): 733 child.changeTiming(mode) 734 735 def takeOverFrom(self, old_cpu): |
736 cpu_ptr = internal.main.convertToBaseCPUPtr(old_cpu._ccObject) | 736 cpu_ptr = internal.sim_object.convertToBaseCPUPtr(old_cpu._ccObject) |
737 self._ccObject.takeOverFrom(cpu_ptr) 738 739 # generate output file for 'dot' to display as a pretty graph. 740 # this code is currently broken. 741 def outputDot(self, dot): 742 label = "{%s|" % self.path 743 if isSimObject(self.realtype): 744 label += '%s|' % self.type --- 51 unchanged lines hidden --- | 737 self._ccObject.takeOverFrom(cpu_ptr) 738 739 # generate output file for 'dot' to display as a pretty graph. 740 # this code is currently broken. 741 def outputDot(self, dot): 742 label = "{%s|" % self.path 743 if isSimObject(self.realtype): 744 label += '%s|' % self.type --- 51 unchanged lines hidden --- |