From 4d503eeffee054de0aab10962c345ca4bcb54140 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 16 Aug 2019 23:21:56 -0700 Subject: 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 Reviewed-by: Jason Lowe-Power Reviewed-by: Nikos Nikoleris Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- src/cpu/trace/trace_cpu.cc | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/cpu/trace') 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 -- cgit v1.2.3