summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@gmail.com>2008-06-21 01:04:43 -0400
committerSteve Reinhardt <stever@gmail.com>2008-06-21 01:04:43 -0400
commit6b45238316052f458ba9ebc9d24a91cfa9e41cf1 (patch)
tree25f6faa5422b6e44e51fbd2f50d3d969d63a1e10 /src/cpu
parentc1584e422783a33731c7dfa23517d30bcecf28bc (diff)
downloadgem5-6b45238316052f458ba9ebc9d24a91cfa9e41cf1.tar.xz
Generate more useful error messages for unconnected ports.
Force all non-default ports to provide a name and an owner in the constructor.
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/o3/fetch.hh4
-rw-r--r--src/cpu/o3/fetch_impl.hh2
-rw-r--r--src/cpu/o3/lsq.hh4
-rw-r--r--src/cpu/o3/lsq_impl.hh2
-rwxr-xr-xsrc/cpu/o3/thread_context_impl.hh1
-rw-r--r--src/cpu/ozone/cpu_impl.hh1
-rw-r--r--src/cpu/simple_thread.cc1
-rw-r--r--src/cpu/thread_state.cc4
8 files changed, 8 insertions, 11 deletions
diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh
index d954bd1e7..3ada0328f 100644
--- a/src/cpu/o3/fetch.hh
+++ b/src/cpu/o3/fetch.hh
@@ -80,8 +80,8 @@ class DefaultFetch
public:
/** Default constructor. */
- IcachePort(DefaultFetch<Impl> *_fetch)
- : Port(_fetch->name() + "-iport"), fetch(_fetch)
+ IcachePort(DefaultFetch<Impl> *_fetch, O3CPU *_cpu)
+ : Port(_fetch->name() + "-iport", _cpu), fetch(_fetch)
{ }
bool snoopRangeSent;
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index 7d344fa33..ecfbacd98 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -167,7 +167,7 @@ DefaultFetch<Impl>::DefaultFetch(O3CPU *_cpu, Params *params)
instSize = sizeof(TheISA::MachInst);
// Name is finally available, so create the port.
- icachePort = new IcachePort(this);
+ icachePort = new IcachePort(this, cpu);
icachePort->snoopRangeSent = false;
diff --git a/src/cpu/o3/lsq.hh b/src/cpu/o3/lsq.hh
index 06de608e0..82d73c6ee 100644
--- a/src/cpu/o3/lsq.hh
+++ b/src/cpu/o3/lsq.hh
@@ -296,8 +296,8 @@ class LSQ {
public:
/** Default constructor. */
- DcachePort(LSQ *_lsq)
- : Port(_lsq->name() + "-dport"), lsq(_lsq)
+ DcachePort(LSQ *_lsq, O3CPU *_cpu)
+ : Port(_lsq->name() + "-dport", _cpu), lsq(_lsq)
{ }
bool snoopRangeSent;
diff --git a/src/cpu/o3/lsq_impl.hh b/src/cpu/o3/lsq_impl.hh
index 8ed6f7f54..41ab66dd0 100644
--- a/src/cpu/o3/lsq_impl.hh
+++ b/src/cpu/o3/lsq_impl.hh
@@ -112,7 +112,7 @@ LSQ<Impl>::DcachePort::recvRetry()
template <class Impl>
LSQ<Impl>::LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, Params *params)
- : cpu(cpu_ptr), iewStage(iew_ptr), dcachePort(this),
+ : cpu(cpu_ptr), iewStage(iew_ptr), dcachePort(this, cpu_ptr),
LQEntries(params->LQEntries),
SQEntries(params->SQEntries),
numThreads(params->numberOfThreads),
diff --git a/src/cpu/o3/thread_context_impl.hh b/src/cpu/o3/thread_context_impl.hh
index 865d58635..514d3de64 100755
--- a/src/cpu/o3/thread_context_impl.hh
+++ b/src/cpu/o3/thread_context_impl.hh
@@ -103,7 +103,6 @@ void
O3ThreadContext<Impl>::delVirtPort(VirtualPort *vp)
{
if (vp != thread->getVirtPort()) {
- vp->removeConn();
delete vp;
}
}
diff --git a/src/cpu/ozone/cpu_impl.hh b/src/cpu/ozone/cpu_impl.hh
index 0c7105382..4cb55fa23 100644
--- a/src/cpu/ozone/cpu_impl.hh
+++ b/src/cpu/ozone/cpu_impl.hh
@@ -747,7 +747,6 @@ template <class Impl>
void
OzoneCPU<Impl>::OzoneTC::delVirtPort(VirtualPort *vp)
{
- vp->removeConn();
delete vp;
}
#endif
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 5a5444de4..47b69d05f 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -302,7 +302,6 @@ void
SimpleThread::delVirtPort(VirtualPort *vp)
{
if (vp != virtPort) {
- vp->removeConn();
delete vp;
}
}
diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc
index bcfc9c924..56839ca7f 100644
--- a/src/cpu/thread_state.cc
+++ b/src/cpu/thread_state.cc
@@ -126,7 +126,7 @@ ThreadState::connectPhysPort()
// already existed. Fix this memory leak once the bus port IDs
// for functional ports is resolved.
if (physPort)
- physPort->removeConn();
+ physPort->disconnectFromPeer();
else
physPort = new FunctionalPort(csprintf("%s-%d-funcport",
baseCpu->name(), tid));
@@ -140,7 +140,7 @@ ThreadState::connectVirtPort()
// already existed. Fix this memory leak once the bus port IDs
// for functional ports is resolved.
if (virtPort)
- virtPort->removeConn();
+ virtPort->disconnectFromPeer();
else
virtPort = new VirtualPort(csprintf("%s-%d-vport",
baseCpu->name(), tid));