changeset ee4ac00d0774 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=ee4ac00d0774
description:
        sim: Use forward declarations for ports.

        Virtual ports need TLB data which means anything touching a file in the 
arch
        directory rebuilds any file that includes system.hh which in everything.

diffstat:

 src/arch/alpha/freebsd/system.cc |   5 +++--
 src/arch/alpha/linux/system.cc   |   6 +++---
 src/arch/alpha/stacktrace.cc     |   1 +
 src/arch/alpha/system.cc         |  17 +++++++++--------
 src/arch/alpha/tru64/system.cc   |   3 ++-
 src/arch/arm/linux/system.cc     |   4 +++-
 src/arch/arm/stacktrace.cc       |   1 +
 src/arch/arm/system.cc           |   1 -
 src/arch/mips/system.cc          |  10 +++++-----
 src/base/remote_gdb.cc           |   1 +
 src/cpu/simple_thread.cc         |   1 +
 src/dev/simple_disk.cc           |   2 +-
 src/dev/sparc/iob.cc             |   1 +
 src/sim/system.cc                |  15 ++++++++-------
 src/sim/system.hh                |   7 ++++---
 15 files changed, 43 insertions(+), 32 deletions(-)

diffs (truncated from 358 to 300 lines):

diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/alpha/freebsd/system.cc
--- a/src/arch/alpha/freebsd/system.cc  Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/alpha/freebsd/system.cc  Mon Nov 08 13:58:22 2010 -0600
@@ -43,6 +43,7 @@
 #include "cpu/thread_context.hh"
 #include "mem/physical.hh"
 #include "mem/port.hh"
+#include "mem/vport.hh"
 #include "sim/byteswap.hh"
 
 #define TIMER_FREQUENCY 1193180
@@ -77,8 +78,8 @@
     ppc_vaddr = (Addr)tc->readIntReg(17);
     timer_vaddr = (Addr)tc->readIntReg(18);
 
-    virtPort.write(ppc_vaddr, (uint32_t)SimClock::Frequency);
-    virtPort.write(timer_vaddr, (uint32_t)TIMER_FREQUENCY);
+    virtPort->write(ppc_vaddr, (uint32_t)SimClock::Frequency);
+    virtPort->write(timer_vaddr, (uint32_t)TIMER_FREQUENCY);
 }
 
 void
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/alpha/linux/system.cc
--- a/src/arch/alpha/linux/system.cc    Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/alpha/linux/system.cc    Mon Nov 08 13:58:22 2010 -0600
@@ -77,7 +77,7 @@
      * Since we aren't using a bootloader, we have to copy the
      * kernel arguments directly into the kernel's memory.
      */
-    virtPort.writeBlob(CommandLine(), (uint8_t*)params()->boot_osflags.c_str(),
+    virtPort->writeBlob(CommandLine(), 
(uint8_t*)params()->boot_osflags.c_str(),
                 params()->boot_osflags.length()+1);
 
     /**
@@ -86,7 +86,7 @@
      * calculated it by using the PIT, RTC, etc.
      */
     if (kernelSymtab->findAddress("est_cycle_freq", addr))
-        virtPort.write(addr, (uint64_t)(SimClock::Frequency /
+        virtPort->write(addr, (uint64_t)(SimClock::Frequency /
                     p->boot_cpu_frequency));
 
 
@@ -97,7 +97,7 @@
      * 255 ASNs.
      */
     if (kernelSymtab->findAddress("dp264_mv", addr))
-        virtPort.write(addr + 0x18, LittleEndianGuest::htog((uint32_t)127));
+        virtPort->write(addr + 0x18, LittleEndianGuest::htog((uint32_t)127));
     else
         panic("could not find dp264_mv\n");
 
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/alpha/stacktrace.cc
--- a/src/arch/alpha/stacktrace.cc      Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/alpha/stacktrace.cc      Mon Nov 08 13:58:22 2010 -0600
@@ -37,6 +37,7 @@
 #include "base/trace.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
+#include "mem/vport.hh"
 #include "sim/system.hh"
 
 using namespace std;
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/alpha/system.cc
--- a/src/arch/alpha/system.cc  Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/alpha/system.cc  Mon Nov 08 13:58:22 2010 -0600
@@ -38,6 +38,7 @@
 #include "base/loader/symtab.hh"
 #include "base/trace.hh"
 #include "mem/physical.hh"
+#include "mem/vport.hh"
 #include "params/AlphaSystem.hh"
 #include "sim/byteswap.hh"
 
@@ -65,8 +66,8 @@
 
 
     // Load program sections into memory
-    pal->loadSections(&functionalPort, loadAddrMask);
-    console->loadSections(&functionalPort, loadAddrMask);
+    pal->loadSections(functionalPort, loadAddrMask);
+    console->loadSections(functionalPort, loadAddrMask);
 
     // load symbols
     if (!console->loadGlobalSymbols(consoleSymtab))
@@ -99,7 +100,7 @@
      * others do.)
      */
     if (consoleSymtab->findAddress("env_booted_osflags", addr)) {
-        virtPort.writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),
+        virtPort->writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),
                 strlen(params()->boot_osflags.c_str()));
     }
 
@@ -110,9 +111,9 @@
     if (consoleSymtab->findAddress("m5_rpb", addr)) {
         uint64_t data;
         data = htog(params()->system_type);
-        virtPort.write(addr+0x50, data);
+        virtPort->write(addr+0x50, data);
         data = htog(params()->system_rev);
-        virtPort.write(addr+0x58, data);
+        virtPort->write(addr+0x58, data);
     } else
         panic("could not find hwrpb\n");
 }
@@ -168,8 +169,8 @@
     // lda  gp,Y(gp): opcode 8, Ra = 29, rb = 29
     const uint32_t gp_lda_pattern  = (8 << 26) | (29 << 21) | (29 << 16);
 
-    uint32_t i1 = virtPort.read<uint32_t>(addr);
-    uint32_t i2 = virtPort.read<uint32_t>(addr + sizeof(MachInst));
+    uint32_t i1 = virtPort->read<uint32_t>(addr);
+    uint32_t i2 = virtPort->read<uint32_t>(addr + sizeof(MachInst));
 
     if ((i1 & inst_mask) == gp_ldah_pattern &&
         (i2 & inst_mask) == gp_lda_pattern) {
@@ -186,7 +187,7 @@
 {
     Addr addr = 0;
     if (consoleSymtab->findAddress("m5AlphaAccess", addr)) {
-        virtPort.write(addr, htog(Phys2K0Seg(access)));
+        virtPort->write(addr, htog(Phys2K0Seg(access)));
     } else {
         panic("could not find m5AlphaAccess\n");
     }
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/alpha/tru64/system.cc
--- a/src/arch/alpha/tru64/system.cc    Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/alpha/tru64/system.cc    Mon Nov 08 13:58:22 2010 -0600
@@ -40,6 +40,7 @@
 #include "kern/system_events.hh"
 #include "mem/physical.hh"
 #include "mem/port.hh"
+#include "mem/vport.hh"
 
 using namespace std;
 
@@ -48,7 +49,7 @@
 {
     Addr addr = 0;
     if (kernelSymtab->findAddress("enable_async_printf", addr)) {
-        virtPort.write(addr, (uint32_t)0);
+        virtPort->write(addr, (uint32_t)0);
     }
 
 #ifdef DEBUG
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/arm/linux/system.cc
--- a/src/arch/arm/linux/system.cc      Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/arm/linux/system.cc      Mon Nov 08 13:58:22 2010 -0600
@@ -43,8 +43,10 @@
 #include "arch/arm/isa_traits.hh"
 #include "arch/arm/linux/atag.hh"
 #include "arch/arm/linux/system.hh"
+#include "arch/arm/utility.hh"
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
+#include "cpu/thread_context.hh"
 #include "mem/physical.hh"
 
 using namespace ArmISA;
@@ -87,7 +89,7 @@
     DPRINTF(Loader, "Boot atags was %d bytes in total\n", size << 2);
     DDUMP(Loader, boot_data, size << 2);
 
-    functionalPort.writeBlob(ParamsList, boot_data, size << 2);
+    functionalPort->writeBlob(ParamsList, boot_data, size << 2);
 
 #ifndef NDEBUG
     kernelPanicEvent = addKernelFuncEvent<BreakPCEvent>("panic");
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/arm/stacktrace.cc
--- a/src/arch/arm/stacktrace.cc        Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/arm/stacktrace.cc        Mon Nov 08 13:58:22 2010 -0600
@@ -37,6 +37,7 @@
 #include "base/trace.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
+#include "mem/vport.hh"
 #include "sim/system.hh"
 
 using namespace std;
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/arm/system.cc
--- a/src/arch/arm/system.cc    Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/arm/system.cc    Mon Nov 08 13:58:22 2010 -0600
@@ -44,7 +44,6 @@
 #include <iostream>
 
 using namespace std;
-using namespace ArmISA;
 using namespace Linux;
 
 ArmSystem::ArmSystem(Params *p)
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/arch/mips/system.cc
--- a/src/arch/mips/system.cc   Sat Nov 06 17:48:58 2010 -0700
+++ b/src/arch/mips/system.cc   Mon Nov 08 13:58:22 2010 -0600
@@ -50,7 +50,7 @@
 #if FULL_SYSTEM
     if (p->bare_iron == true) {
         hexFile = new HexFile(params()->hex_file_name);
-        if (!hexFile->loadSections(&functionalPort))
+        if (!hexFile->loadSections(functionalPort))
             panic("Could not load hex file\n");
     }
 
@@ -70,7 +70,7 @@
     if (console == NULL)
         fatal("Could not load console file %s", params()->console);
     //Load program sections into memory
-    console->loadSections(&functionalPort, loadAddrMask);
+    console->loadSections(functionalPort, loadAddrMask);
 
     //load symbols
     if (!console->loadGlobalSymbols(consoleSymtab))
@@ -92,7 +92,7 @@
      */
     if (consoleSymtab->findAddress("env_booted_osflags", addr)) {
         warn("writing addr starting from %#x", addr);
-        virtPort.writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),
+        virtPort->writeBlob(addr, (uint8_t*)params()->boot_osflags.c_str(),
                 strlen(params()->boot_osflags.c_str()));
     }
 
@@ -103,9 +103,9 @@
     if (consoleSymtab->findAddress("m5_rpb", addr)) {
         uint64_t data;
         data = htog(params()->system_type);
-        virtPort.write(addr + 0x50, data);
+        virtPort->write(addr + 0x50, data);
         data = htog(params()->system_rev);
-        virtPort.write(addr + 0x58, data);
+        virtPort->write(addr + 0x58, data);
     } else {
         panic("could not find hwrpb\n");
     }
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/base/remote_gdb.cc
--- a/src/base/remote_gdb.cc    Sat Nov 06 17:48:58 2010 -0700
+++ b/src/base/remote_gdb.cc    Mon Nov 08 13:58:22 2010 -0600
@@ -126,6 +126,7 @@
 
 #if FULL_SYSTEM
 #include "arch/vtophys.hh"
+#include "mem/vport.hh"
 #endif
 
 #include "base/intmath.hh"
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/cpu/simple_thread.cc
--- a/src/cpu/simple_thread.cc  Sat Nov 06 17:48:58 2010 -0700
+++ b/src/cpu/simple_thread.cc  Mon Nov 08 13:58:22 2010 -0600
@@ -50,6 +50,7 @@
 #include "base/trace.hh"
 #include "cpu/profile.hh"
 #include "cpu/quiesce_event.hh"
+#include "mem/vport.hh"
 #include "sim/serialize.hh"
 #include "sim/sim_exit.hh"
 #else
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/dev/simple_disk.cc
--- a/src/dev/simple_disk.cc    Sat Nov 06 17:48:58 2010 -0700
+++ b/src/dev/simple_disk.cc    Mon Nov 08 13:58:22 2010 -0600
@@ -68,7 +68,7 @@
     for (int i = 0, j = 0; i < count; i += SectorSize, j++)
         image->read(data + i, block + j);
 
-    system->functionalPort.writeBlob(addr, data, count);
+    system->functionalPort->writeBlob(addr, data, count);
 
     DPRINTF(SimpleDisk, "read  block=%#x len=%d\n", (uint64_t)block, count);
     DDUMP(SimpleDiskData, data, count);
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/dev/sparc/iob.cc
--- a/src/dev/sparc/iob.cc      Sat Nov 06 17:48:58 2010 -0700
+++ b/src/dev/sparc/iob.cc      Mon Nov 08 13:58:22 2010 -0600
@@ -39,6 +39,7 @@
 
 #include "arch/sparc/isa_traits.hh"
 #include "arch/sparc/faults.hh"
+#include "base/bitfield.hh"
 #include "base/trace.hh"
 #include "cpu/intr_control.hh"
 #include "dev/sparc/iob.hh"
diff -r c10bc8ad3f97 -r ee4ac00d0774 src/sim/system.cc
--- a/src/sim/system.cc Sat Nov 06 17:48:58 2010 -0700
+++ b/src/sim/system.cc Mon Nov 08 13:58:22 2010 -0600
@@ -49,6 +49,7 @@
 #if FULL_SYSTEM
 #include "arch/vtophys.hh"
 #include "kern/kernel_stats.hh"
+#include "mem/vport.hh"
 #else
 #include "params/System.hh"
 #endif
@@ -64,8 +65,6 @@
     : SimObject(p), physmem(p->physmem), _numContexts(0),
 #if FULL_SYSTEM
       init_param(p->init_param),
-      functionalPort(p->name + "-fport"),
-      virtPort(p->name + "-vport"),
       loadAddrMask(p->load_addr_mask),
 #else
       page_ptr(0),
@@ -86,13 +85,15 @@
      * Get a functional port to memory
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to