params.py (13719:74853963ddcf) | params.py (13783:e9a2fef479e7) |
---|---|
1# Copyright (c) 2012-2014, 2017, 2018 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 1929 unchanged lines hidden (view full) --- 1938 except: 1939 print("Error in unproxying port '%s' of %s" % 1940 (self.name, self.simobj.path())) 1941 raise 1942 self.connect(realPeer) 1943 1944 # Call C++ to create corresponding port connection between C++ objects 1945 def ccConnect(self): | 1# Copyright (c) 2012-2014, 2017, 2018 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 1929 unchanged lines hidden (view full) --- 1938 except: 1939 print("Error in unproxying port '%s' of %s" % 1940 (self.name, self.simobj.path())) 1941 raise 1942 self.connect(realPeer) 1943 1944 # Call C++ to create corresponding port connection between C++ objects 1945 def ccConnect(self): |
1946 from _m5.pyobject import connectPorts 1947 | |
1948 if self.ccConnected: # already done this 1949 return 1950 1951 peer = self.peer 1952 if not self.peer: # nothing to connect to 1953 return 1954 | 1946 if self.ccConnected: # already done this 1947 return 1948 1949 peer = self.peer 1950 if not self.peer: # nothing to connect to 1951 return 1952 |
1955 # check that we connect a master to a slave 1956 if self.role == peer.role: 1957 raise TypeError( 1958 "cannot connect '%s' and '%s' due to identical role '%s'" % \ 1959 (peer, self, self.role)) | 1953 port = self.simobj.getPort(self.name, self.index) 1954 peer_port = peer.simobj.getPort(peer.name, peer.index) 1955 port.bind(peer_port) |
1960 | 1956 |
1961 if self.role == 'SLAVE': 1962 # do nothing and let the master take care of it 1963 return 1964 1965 try: 1966 # self is always the master and peer the slave 1967 connectPorts(self.simobj.getCCObject(), self.name, self.index, 1968 peer.simobj.getCCObject(), peer.name, peer.index) 1969 except: 1970 print("Error connecting port %s.%s to %s.%s" % 1971 (self.simobj.path(), self.name, 1972 peer.simobj.path(), peer.name)) 1973 raise | |
1974 self.ccConnected = True | 1957 self.ccConnected = True |
1975 peer.ccConnected = True | |
1976 1977# A reference to an individual element of a VectorPort... much like a 1978# PortRef, but has an index. 1979class VectorPortElementRef(PortRef): 1980 def __init__(self, simobj, name, role, index): 1981 PortRef.__init__(self, simobj, name, role) 1982 self.index = index 1983 --- 184 unchanged lines hidden --- | 1958 1959# A reference to an individual element of a VectorPort... much like a 1960# PortRef, but has an index. 1961class VectorPortElementRef(PortRef): 1962 def __init__(self, simobj, name, role, index): 1963 PortRef.__init__(self, simobj, name, role) 1964 self.index = index 1965 --- 184 unchanged lines hidden --- |