params.py (5475:7c18f61da616) params.py (5578:db6756431717)
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
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
1007 self.peer = other
1008 if proxy.isproxy(other):
1009 other.set_param_desc(PortParamDesc())
1010 elif isinstance(other, PortRef):
1011 if other.peer is not self:
1012 other.connect(self)
1013 else:
1014 raise TypeError, \

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

1041
1042 # Call C++ to create corresponding port connection between C++ objects
1043 def ccConnect(self):
1044 from m5.objects.params import connectPorts
1045
1046 if self.ccConnected: # already done this
1047 return
1048 peer = self.peer
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
1049 connectPorts(self.simobj.getCCObject(), self.name, self.index,
1050 peer.simobj.getCCObject(), peer.name, peer.index)
1051 self.ccConnected = True
1052 peer.ccConnected = True
1053
1054# A reference to an individual element of a VectorPort... much like a
1055# PortRef, but has an index.
1056class VectorPortElementRef(PortRef):

--- 127 unchanged lines hidden ---
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 ---