better debugging of DMA operations
[gem5.git] / dev / tsunami_io.hh
index 1dd7762e3136801ada693511fbad7f8dd5d23325..d507355c353135e04569266f37c94775911ecdf3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2004 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #ifndef __TSUNAMI_DMA_HH__
 #define __TSUNAMI_DMA_HH__
 
-#include "mem/functional_mem/functional_memory.hh"
+#include "dev/io_device.hh"
+#include "base/range.hh"
 #include "dev/tsunami.hh"
+#include "sim/eventq.hh"
 
 /** How often the RTC interrupts */
 static const int RTC_RATE  = 1024;
@@ -43,7 +45,7 @@ static const int RTC_RATE  = 1024;
  * Tsunami I/O device is a catch all for all the south bridge stuff we care
  * to implement.
  */
-class TsunamiIO : public FunctionalMemory
+class TsunamiIO : public PioDevice
 {
   private:
     /** The base address of this device */
@@ -109,7 +111,20 @@ class TsunamiIO : public FunctionalMemory
          */
         uint8_t Status();
 
-    };
+        /**
+         * Serialize this object to the given output stream.
+         * @param os The stream to serialize to.
+         */
+        virtual void serialize(std::ostream &os);
+
+
+        /**
+         * Reconstruct the state of this object from a checkpoint.
+         * @param cp The checkpoint use.
+         * @param section The section name of this object
+         */
+        virtual void unserialize(Checkpoint *cp, const std::string &section);
+     };
 
     /**
      * Process RTC timer events and generate interrupts appropriately.
@@ -134,7 +149,21 @@ class TsunamiIO : public FunctionalMemory
            * @return a description
            */
           virtual const char *description();
-    };
+
+          /**
+           * Serialize this object to the given output stream.
+           * @param os The stream to serialize to.
+           */
+          virtual void serialize(std::ostream &os);
+
+
+          /**
+           * Reconstruct the state of this object from a checkpoint.
+           * @param cp The checkpoint use.
+           * @param section The section name of this object
+           */
+          virtual void unserialize(Checkpoint *cp, const std::string &section);
+     };
 
     /** uip UpdateInProgess says that the rtc is updating, but we just fake it
      * by alternating it on every read of the bit since we are going to
@@ -192,8 +221,11 @@ class TsunamiIO : public FunctionalMemory
 
 
   public:
-    /** Return the freqency of the RTC */
-    uint32_t  frequency() const { return RTC_RATE; }
+    /**
+     * Return the freqency of the RTC
+     * @return interrupt rate of the RTC
+     */
+    Tick  frequency() const { return RTC_RATE; }
 
 
     /**
@@ -205,7 +237,8 @@ class TsunamiIO : public FunctionalMemory
      * @param mmu pointer to the memory controller that sends us events.
      */
     TsunamiIO(const std::string &name, Tsunami *t, time_t init_time,
-              Addr a, MemoryController *mmu);
+              Addr a, MemoryController *mmu, HierParams *hier, Bus *bus,
+              Tick pio_latency);
 
     /**
      * Create the tm struct from seconds since 1970
@@ -253,6 +286,9 @@ class TsunamiIO : public FunctionalMemory
      * @param section The section name of this object
      */
     virtual void unserialize(Checkpoint *cp, const std::string &section);
+
+
+    Tick cacheAccess(MemReqPtr &req);
 };
 
 #endif // __TSUNAMI_IO_HH__