+void
+ThreadState::connectMemPorts(ThreadContext *tc)
+{
+ connectPhysPort();
+ connectVirtPort(tc);
+}
+
+void
+ThreadState::connectPhysPort()
+{
+ // @todo: For now this disregards any older port that may have
+ // already existed. Fix this memory leak once the bus port IDs
+ // for functional ports is resolved.
+ if (physPort)
+ physPort->removeConn();
+ else
+ physPort = new FunctionalPort(csprintf("%s-%d-funcport",
+ baseCpu->name(), _threadId));
+ connectToMemFunc(physPort);
+}
+
+void
+ThreadState::connectVirtPort(ThreadContext *tc)
+{
+ // @todo: For now this disregards any older port that may have
+ // already existed. Fix this memory leak once the bus port IDs
+ // for functional ports is resolved.
+ if (virtPort)
+ virtPort->removeConn();
+ else
+ virtPort = new VirtualPort(csprintf("%s-%d-vport",
+ baseCpu->name(), _threadId), tc);
+ connectToMemFunc(virtPort);
+}