Giacomo Travaglini has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/15896 )

Change subject: python: Always throw TypeError on slave-slave connections
......................................................................

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 <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/15896
Reviewed-by: Andreas Sandberg <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
---
M src/python/m5/params.py
1 file changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 74bd40b..854c8e3 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -1883,12 +1883,9 @@
     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 @@
                 "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,

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/15896
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ia7d0a15df28b96c7bf5e568c4f4917d21a19b824
Gerrit-Change-Number: 15896
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to