summaryrefslogtreecommitdiff
path: root/src/python/pybind11
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-03-06 20:43:59 -0800
committerGabe Black <gabeblack@google.com>2019-03-18 23:25:38 +0000
commit2da37b5efa70c34aa3665c947b0ef10c4e2a3ae7 (patch)
treeb9454cf2e18c01be576b53716c7d9769ad90421d /src/python/pybind11
parent7e38637c8dc1cff923c386e6ad74ceb9a1317ef2 (diff)
downloadgem5-2da37b5efa70c34aa3665c947b0ef10c4e2a3ae7.tar.xz
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.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/python/pybind11')
-rw-r--r--src/python/pybind11/pyobject.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/python/pybind11/pyobject.cc b/src/python/pybind11/pyobject.cc
index a2da96d3b..bd363a132 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 @@ connectPorts(SimObject *o1, const std::string &name1, int i1,
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.