Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/17031 )

Change subject: python: Change || to && for MessageBuffers in connectPorts.
......................................................................

python: Change || to && for MessageBuffers in connectPorts.

The connectPorts function currently checks if *either* of the peers in
a port connection are a MessageBuffer, and if so will ignore the
connection. This CL changes that || into a && so that *both* of the
peers need to be a Ruby types (either a MessageBuffer or Network) for
the connection to be ignored. That makes it easier to contain that
abnormal behavior to those types instead of having it apply even when
other types of port owners are involved.

Unfortunately the number of interesting Ruby types is unbounded, but
these are the types with ports as of today. This mechanism will
hopefully be replacedall together so this should be a temporary issue.

Change-Id: I140498770e5d37eb2abd3d99261d47e111f1c8ab
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17031
Reviewed-by: Nikos Nikoleris <nikos.nikole...@arm.com>
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Maintainer: Jason Lowe-Power <ja...@lowepower.com>
---
M src/python/pybind11/pyobject.cc
1 file changed, 6 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Andreas Sandberg: Looks good to me, but someone else must approve
  Nikos Nikoleris: Looks good to me, approved



diff --git a/src/python/pybind11/pyobject.cc b/src/python/pybind11/pyobject.cc
index a2da96d..bd363a1 100644
--- a/src/python/pybind11/pyobject.cc
+++ b/src/python/pybind11/pyobject.cc
@@ -50,7 +50,9 @@
 #include "dev/net/etherint.hh"
 #include "dev/net/etherobject.hh"
 #include "mem/mem_object.hh"
+#include "mem/ruby/network/Network.hh"
 #include "mem/ruby/slicc_interface/AbstractController.hh"
+#include "mem/ruby/system/Sequencer.hh"
 #include "sim/full_system.hh"

 namespace py = pybind11;
@@ -84,8 +86,11 @@
     MessageBuffer *mb1, *mb2;
     mb1 = dynamic_cast<MessageBuffer*>(o1);
     mb2 = dynamic_cast<MessageBuffer*>(o2);
+    Network *nw1, *nw2;
+    nw1 = dynamic_cast<Network*>(o1);
+    nw2 = dynamic_cast<Network*>(o2);

-    if (mb1 || mb2) {
+    if ((mb1 || nw1) && (mb2 || nw2)) {
         // No need to connect anything here currently. MessageBuffer
         // connections in Python only serve to print the connections in
         // the config output.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17031
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: I140498770e5d37eb2abd3d99261d47e111f1c8ab
Gerrit-Change-Number: 17031
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Assignee: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@arm.com>
Gerrit-Reviewer: Nikos Nikoleris <nikos.nikole...@gmail.com>
Gerrit-Reviewer: Weiping Liao <weipingl...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to