Changed the hello_sparc executable back to the cross compiled one
[gem5.git] / dev / tsunami.cc
index ba33fa0967d51b97609c396f8c732d5b5fb7877b..ed011531d05e1cc7a4efc432098aed106922f10b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2004-2005 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+/** @file
+ * Implementation of Tsunami platform.
+ */
+
 #include <deque>
 #include <string>
 #include <vector>
 
 #include "cpu/intr_control.hh"
-#include "dev/console.hh"
-#include "dev/etherdev.hh"
-#include "dev/ide_ctrl.hh"
-#include "dev/tlaser_clock.hh"
+#include "dev/simconsole.hh"
 #include "dev/tsunami_cchip.hh"
 #include "dev/tsunami_pchip.hh"
+#include "dev/tsunami_io.hh"
 #include "dev/tsunami.hh"
 #include "sim/builder.hh"
 #include "sim/system.hh"
 
 using namespace std;
+//Should this be AlphaISA?
+using namespace TheISA;
 
-Tsunami::Tsunami(const string &name, System *s, SimConsole *con,
-                 IntrControl *ic, int intr_freq)
-    : Platform(name, con, ic, intr_freq), system(s)
+Tsunami::Tsunami(const string &name, System *s, IntrControl *ic)
+    : Platform(name, ic), system(s)
 {
     // set the back pointer from the system to myself
     system->platform = this;
@@ -54,6 +57,42 @@ Tsunami::Tsunami(const string &name, System *s, SimConsole *con,
         intr_sum_type[i] = 0;
 }
 
+Tick
+Tsunami::intrFrequency()
+{
+    return io->frequency();
+}
+
+void
+Tsunami::postConsoleInt()
+{
+    io->postPIC(0x10);
+}
+
+void
+Tsunami::clearConsoleInt()
+{
+    io->clearPIC(0x10);
+}
+
+void
+Tsunami::postPciInt(int line)
+{
+    cchip->postDRIR(line);
+}
+
+void
+Tsunami::clearPciInt(int line)
+{
+    cchip->clearDRIR(line);
+}
+
+Addr
+Tsunami::pciToDma(Addr pciAddr) const
+{
+    return pchip->translatePciToDma(pciAddr);
+}
+
 void
 Tsunami::serialize(std::ostream &os)
 {
@@ -69,25 +108,20 @@ Tsunami::unserialize(Checkpoint *cp, const std::string &section)
 BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tsunami)
 
     SimObjectParam<System *> system;
-    SimObjectParam<SimConsole *> cons;
     SimObjectParam<IntrControl *> intrctrl;
-    Param<int> interrupt_frequency;
 
 END_DECLARE_SIM_OBJECT_PARAMS(Tsunami)
 
 BEGIN_INIT_SIM_OBJECT_PARAMS(Tsunami)
 
     INIT_PARAM(system, "system"),
-    INIT_PARAM(cons, "system console"),
-    INIT_PARAM(intrctrl, "interrupt controller"),
-    INIT_PARAM_DFLT(interrupt_frequency, "frequency of interrupts", 1024)
+    INIT_PARAM(intrctrl, "interrupt controller")
 
 END_INIT_SIM_OBJECT_PARAMS(Tsunami)
 
 CREATE_SIM_OBJECT(Tsunami)
 {
-    return new Tsunami(getInstanceName(), system, cons, intrctrl,
-                       interrupt_frequency);
+    return new Tsunami(getInstanceName(), system, intrctrl);
 }
 
 REGISTER_SIM_OBJECT("Tsunami", Tsunami)