/*
- * 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
#include <vector>
#include "cpu/intr_control.hh"
-#include "dev/console.hh"
+#include "dev/simconsole.hh"
#include "dev/etherdev.hh"
-#include "dev/scsi_ctrl.hh"
+#include "dev/ide_ctrl.hh"
#include "dev/tlaser_clock.hh"
#include "dev/tsunami_cchip.hh"
+#include "dev/tsunami_pchip.hh"
+#include "dev/tsunami_io.hh"
#include "dev/tsunami.hh"
+#include "dev/pciconfigall.hh"
#include "sim/builder.hh"
#include "sim/system.hh"
using namespace std;
-Tsunami::Tsunami(const string &name, ScsiController *s, EtherDev *e,
- TlaserClock *c, TsunamiCChip *cc, SimConsole *con,
- IntrControl *ic, int intr_freq)
- : SimObject(name), intctrl(ic), cons(con), scsi(s), ethernet(e),
- clock(c), cchip(cc), interrupt_frequency(intr_freq)
+Tsunami::Tsunami(const string &name, System *s,
+ IntrControl *ic, PciConfigAll *pci, int intr_freq)
+ : Platform(name, ic, pci, intr_freq), system(s)
{
+ // set the back pointer from the system to myself
+ system->platform = this;
+
for (int i = 0; i < Tsunami::Max_CPUs; i++)
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::serialize(std::ostream &os)
{
BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tsunami)
- SimObjectParam<ScsiController *> scsi;
- SimObjectParam<EtherDev *> ethernet;
- SimObjectParam<TlaserClock *> clock;
- SimObjectParam<TsunamiCChip *> cchip;
+ SimObjectParam<System *> system;
SimObjectParam<SimConsole *> cons;
SimObjectParam<IntrControl *> intrctrl;
+ SimObjectParam<PciConfigAll *> pciconfig;
Param<int> interrupt_frequency;
END_DECLARE_SIM_OBJECT_PARAMS(Tsunami)
BEGIN_INIT_SIM_OBJECT_PARAMS(Tsunami)
- INIT_PARAM(scsi, "scsi controller"),
- INIT_PARAM(ethernet, "ethernet controller"),
- INIT_PARAM(clock, "turbolaser clock"),
- INIT_PARAM(cchip, "cchip"),
+ INIT_PARAM(system, "system"),
INIT_PARAM(cons, "system console"),
INIT_PARAM(intrctrl, "interrupt controller"),
- INIT_PARAM_DFLT(interrupt_frequency, "frequency of interrupts", 1200)
+ INIT_PARAM(pciconfig, "PCI configuration"),
+ INIT_PARAM_DFLT(interrupt_frequency, "frequency of interrupts", 1024)
END_INIT_SIM_OBJECT_PARAMS(Tsunami)
-
CREATE_SIM_OBJECT(Tsunami)
{
- return new Tsunami(getInstanceName(), scsi, ethernet, clock,
- cchip, cons, intrctrl, interrupt_frequency);
+ return new Tsunami(getInstanceName(), system, intrctrl, pciconfig,
+ interrupt_frequency);
}
REGISTER_SIM_OBJECT("Tsunami", Tsunami)
-