summaryrefslogtreecommitdiff
path: root/src/cpu/trace
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-08-16 23:21:56 -0700
committerGabe Black <gabeblack@google.com>2019-08-27 22:18:28 +0000
commit4d503eeffee054de0aab10962c345ca4bcb54140 (patch)
treef85cff96b40616488a885019c902627b484f2695 /src/cpu/trace
parentf4f31b261cdda95fe6e5a5a71ce232ee479686ae (diff)
downloadgem5-4d503eeffee054de0aab10962c345ca4bcb54140.tar.xz
cpu, dev, mem: Use the new Port methods.
Use getPeer, takeOverFrom, and << to simplify the use of ports in some areas. Change-Id: Idfbda27411b5d6b742f5e4927894302ea6d6a53d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20235 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/cpu/trace')
-rw-r--r--src/cpu/trace/trace_cpu.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/cpu/trace/trace_cpu.cc b/src/cpu/trace/trace_cpu.cc
index 6e499dbac..2d26ed062 100644
--- a/src/cpu/trace/trace_cpu.cc
+++ b/src/cpu/trace/trace_cpu.cc
@@ -106,17 +106,8 @@ void
TraceCPU::takeOverFrom(BaseCPU *oldCPU)
{
// Unbind the ports of the old CPU and bind the ports of the TraceCPU.
- assert(!getInstPort().isConnected());
- assert(oldCPU->getInstPort().isConnected());
- Port &inst_peer_port = oldCPU->getInstPort().getSlavePort();
- oldCPU->getInstPort().unbind();
- getInstPort().bind(inst_peer_port);
-
- assert(!getDataPort().isConnected());
- assert(oldCPU->getDataPort().isConnected());
- Port &data_peer_port = oldCPU->getDataPort().getSlavePort();
- oldCPU->getDataPort().unbind();
- getDataPort().bind(data_peer_port);
+ getInstPort().takeOverFrom(&oldCPU->getInstPort());
+ getDataPort().takeOverFrom(&oldCPU->getDataPort());
}
void