diff options
Diffstat (limited to 'dev/alpha_console.cc')
-rw-r--r-- | dev/alpha_console.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/dev/alpha_console.cc b/dev/alpha_console.cc index 2e9e09e93..111b23c81 100644 --- a/dev/alpha_console.cc +++ b/dev/alpha_console.cc @@ -50,11 +50,12 @@ #include "sim/builder.hh" #include "sim/system.hh" #include "dev/tsunami_io.hh" +#include "sim/sim_object.hh" using namespace std; AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d, - System *system, BaseCPU *cpu, TsunamiIO *clock, + System *system, BaseCPU *cpu, SimObject *clock, int num_cpus, MemoryController *mmu, Addr a, HierParams *hier, Bus *bus) : PioDevice(name), disk(d), console(cons), addr(a) @@ -79,8 +80,14 @@ AlphaConsole::AlphaConsole(const string &name, SimConsole *cons, SimpleDisk *d, alphaAccess->numCPUs = num_cpus; alphaAccess->mem_size = system->physmem->size(); alphaAccess->cpuClock = cpu->getFreq() / 1000000; - alphaAccess->intrClockFrequency = clock->frequency(); - + TsunamiIO *clock_linux = dynamic_cast<TsunamiIO *>(clock); + TlaserClock *clock_tru64 = dynamic_cast<TlaserClock *>(clock); + if (clock_linux) + alphaAccess->intrClockFrequency = clock_linux->frequency(); + else if (clock_tru64) + alphaAccess->intrClockFrequency = clock_tru64->frequency(); + else + panic("clock must be of type TlaserClock or TsunamiIO\n"); alphaAccess->diskUnit = 1; } @@ -267,7 +274,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaConsole) Param<Addr> addr; SimObjectParam<System *> system; SimObjectParam<BaseCPU *> cpu; - SimObjectParam<TsunamiIO *> clock; + SimObjectParam<SimObject *> clock; SimObjectParam<Bus*> io_bus; SimObjectParam<HierParams *> hier; @@ -282,7 +289,7 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaConsole) INIT_PARAM(addr, "Device Address"), INIT_PARAM(system, "system object"), INIT_PARAM(cpu, "Processor"), - INIT_PARAM(clock, "Turbolaser Clock"), + INIT_PARAM(clock, "Clock"), INIT_PARAM_DFLT(io_bus, "The IO Bus to attach to", NULL), INIT_PARAM_DFLT(hier, "Hierarchy global variables", &defaultHierParams) |