diff options
author | Nicholas Lindsay <nicholas.lindsay@arm.com> | 2018-07-02 16:07:31 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-01-25 12:46:15 +0000 |
commit | 48f38293c00e0b4e6b575a5cd5ce71cc076a60d5 (patch) | |
tree | b7f4cae8afd8ffa3146f0892ce35d91b4515f474 /src | |
parent | db190b8e68c1b3230ac45b75bf74da41a94c7ca2 (diff) | |
download | gem5-48f38293c00e0b4e6b575a5cd5ce71cc076a60d5.tar.xz |
python: Always throw TypeError on slave-slave connections
params.py checks the validity of memory port-port connections before
they are instantiated in C++. This commit ensures that attempting to
connect two slave ports together will cause a TypeError.
Change-Id: Ia7d0a15df28b96c7bf5e568c4f4917d21a19b824
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15896
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/python/m5/params.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 74bd40b7d..854c8e379 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -1883,12 +1883,9 @@ class PortRef(object): def ccConnect(self): from _m5.pyobject import connectPorts - if self.role == 'SLAVE': - # do nothing and let the master take care of it - return - if self.ccConnected: # already done this return + peer = self.peer if not self.peer: # nothing to connect to return @@ -1899,6 +1896,10 @@ class PortRef(object): "cannot connect '%s' and '%s' due to identical role '%s'" \ % (peer, self, self.role) + if self.role == 'SLAVE': + # do nothing and let the master take care of it + return + try: # self is always the master and peer the slave connectPorts(self.simobj.getCCObject(), self.name, self.index, |