X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=dev%2Ftsunami.cc;h=f98254354fde1a6abcc0de037cce09d22b6b8eff;hb=2e0695ec9ae9bbc798c8164e9dd66f59fef93b4e;hp=04ab922b9680681133bba50b371a94dedcead4d5;hpb=22f78a6d03fbc390eca538b906aedea9121ab9bb;p=gem5.git diff --git a/dev/tsunami.cc b/dev/tsunami.cc index 04ab922b9..f98254354 100644 --- a/dev/tsunami.cc +++ b/dev/tsunami.cc @@ -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 @@ -31,21 +31,23 @@ #include #include "cpu/intr_control.hh" -#include "dev/console.hh" +#include "dev/simconsole.hh" #include "dev/etherdev.hh" -#include "dev/adaptec_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, 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, 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; @@ -54,6 +56,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) { @@ -71,6 +109,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tsunami) SimObjectParam system; SimObjectParam cons; SimObjectParam intrctrl; + SimObjectParam pciconfig; Param interrupt_frequency; END_DECLARE_SIM_OBJECT_PARAMS(Tsunami) @@ -80,13 +119,14 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(Tsunami) INIT_PARAM(system, "system"), INIT_PARAM(cons, "system console"), INIT_PARAM(intrctrl, "interrupt controller"), + 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(), system, cons, intrctrl, + return new Tsunami(getInstanceName(), system, intrctrl, pciconfig, interrupt_frequency); }