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 --- 990 unchanged lines hidden (view full) --- 999 # e.g., "obj1.portA[3] = obj2.portB". 1000 def connect(self, other): 1001 if isinstance(other, VectorPortRef): 1002 # reference to plain VectorPort is implicit append 1003 other = other._get_next() 1004 if self.peer and not proxy.isproxy(self.peer): 1005 print "warning: overwriting port", self, \ 1006 "value", self.peer, "with", other |
1007 self.peer.peer = None |
1008 self.peer = other 1009 if proxy.isproxy(other): 1010 other.set_param_desc(PortParamDesc()) 1011 elif isinstance(other, PortRef): 1012 if other.peer is not self: 1013 other.connect(self) 1014 else: 1015 raise TypeError, \ --- 26 unchanged lines hidden (view full) --- 1042 1043 # Call C++ to create corresponding port connection between C++ objects 1044 def ccConnect(self): 1045 from m5.objects.params import connectPorts 1046 1047 if self.ccConnected: # already done this 1048 return 1049 peer = self.peer |
1050 if not self.peer: # nothing to connect to 1051 return |
1052 connectPorts(self.simobj.getCCObject(), self.name, self.index, 1053 peer.simobj.getCCObject(), peer.name, peer.index) 1054 self.ccConnected = True 1055 peer.ccConnected = True 1056 1057# A reference to an individual element of a VectorPort... much like a 1058# PortRef, but has an index. 1059class VectorPortElementRef(PortRef): --- 127 unchanged lines hidden --- |