system.cc (3960:1dca397b2bab) system.cc (4762:c94e103c83ad)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 25 unchanged lines hidden (view full) ---

34#include "arch/alpha/ev5.hh"
35#include "arch/alpha/system.hh"
36#include "arch/alpha/remote_gdb.hh"
37#include "arch/vtophys.hh"
38#include "base/loader/object_file.hh"
39#include "base/loader/symtab.hh"
40#include "base/trace.hh"
41#include "mem/physical.hh"
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 25 unchanged lines hidden (view full) ---

34#include "arch/alpha/ev5.hh"
35#include "arch/alpha/system.hh"
36#include "arch/alpha/remote_gdb.hh"
37#include "arch/vtophys.hh"
38#include "base/loader/object_file.hh"
39#include "base/loader/symtab.hh"
40#include "base/trace.hh"
41#include "mem/physical.hh"
42#include "params/AlphaSystem.hh"
42#include "sim/byteswap.hh"
43#include "sim/byteswap.hh"
43#include "sim/builder.hh"
44
45
46using namespace LittleEndianGuest;
47
48AlphaSystem::AlphaSystem(Params *p)
49 : System(p)
50{
51 consoleSymtab = new SymbolTable;
52 palSymtab = new SymbolTable;
53
54
55 /**
56 * Load the pal, and console code into memory
57 */
58 // Load Console Code
44
45
46using namespace LittleEndianGuest;
47
48AlphaSystem::AlphaSystem(Params *p)
49 : System(p)
50{
51 consoleSymtab = new SymbolTable;
52 palSymtab = new SymbolTable;
53
54
55 /**
56 * Load the pal, and console code into memory
57 */
58 // Load Console Code
59 console = createObjectFile(params()->console_path);
59 console = createObjectFile(params()->console);
60 if (console == NULL)
60 if (console == NULL)
61 fatal("Could not load console file %s", params()->console_path);
61 fatal("Could not load console file %s", params()->console);
62
63 // Load pal file
62
63 // Load pal file
64 pal = createObjectFile(params()->palcode);
64 pal = createObjectFile(params()->pal);
65 if (pal == NULL)
65 if (pal == NULL)
66 fatal("Could not load PALcode file %s", params()->palcode);
66 fatal("Could not load PALcode file %s", params()->pal);
67
68
69 // Load program sections into memory
70 pal->loadSections(&functionalPort, AlphaISA::LoadAddrMask);
71 console->loadSections(&functionalPort, AlphaISA::LoadAddrMask);
72
73 // load symbols
74 if (!console->loadGlobalSymbols(consoleSymtab))

--- 132 unchanged lines hidden (view full) ---

207void
208AlphaSystem::unserialize(Checkpoint *cp, const std::string &section)
209{
210 System::unserialize(cp,section);
211 consoleSymtab->unserialize("console_symtab", cp, section);
212 palSymtab->unserialize("pal_symtab", cp, section);
213}
214
67
68
69 // Load program sections into memory
70 pal->loadSections(&functionalPort, AlphaISA::LoadAddrMask);
71 console->loadSections(&functionalPort, AlphaISA::LoadAddrMask);
72
73 // load symbols
74 if (!console->loadGlobalSymbols(consoleSymtab))

--- 132 unchanged lines hidden (view full) ---

207void
208AlphaSystem::unserialize(Checkpoint *cp, const std::string &section)
209{
210 System::unserialize(cp,section);
211 consoleSymtab->unserialize("console_symtab", cp, section);
212 palSymtab->unserialize("pal_symtab", cp, section);
213}
214
215
216BEGIN_DECLARE_SIM_OBJECT_PARAMS(AlphaSystem)
217
218 Param<Tick> boot_cpu_frequency;
219 SimObjectParam<PhysicalMemory *> physmem;
220 SimpleEnumParam<System::MemoryMode> mem_mode;
221
222 Param<std::string> kernel;
223 Param<std::string> console;
224 Param<std::string> pal;
225
226 Param<std::string> boot_osflags;
227 Param<std::string> readfile;
228 Param<std::string> symbolfile;
229 Param<unsigned int> init_param;
230
231 Param<uint64_t> system_type;
232 Param<uint64_t> system_rev;
233
234END_DECLARE_SIM_OBJECT_PARAMS(AlphaSystem)
235
236BEGIN_INIT_SIM_OBJECT_PARAMS(AlphaSystem)
237
238 INIT_PARAM(boot_cpu_frequency, "Frequency of the boot CPU"),
239 INIT_PARAM(physmem, "phsyical memory"),
240 INIT_ENUM_PARAM(mem_mode, "Memory Mode, (1=atomic, 2=timing)",
241 System::MemoryModeStrings),
242 INIT_PARAM(kernel, "file that contains the kernel code"),
243 INIT_PARAM(console, "file that contains the console code"),
244 INIT_PARAM(pal, "file that contains palcode"),
245 INIT_PARAM_DFLT(boot_osflags, "flags to pass to the kernel during boot",
246 "a"),
247 INIT_PARAM_DFLT(readfile, "file to read startup script from", ""),
248 INIT_PARAM_DFLT(symbolfile, "file to read symbols from", ""),
249 INIT_PARAM_DFLT(init_param, "numerical value to pass into simulator", 0),
250 INIT_PARAM_DFLT(system_type, "Type of system we are emulating", 34),
251 INIT_PARAM_DFLT(system_rev, "Revision of system we are emulating", 1<<10)
252
253END_INIT_SIM_OBJECT_PARAMS(AlphaSystem)
254
255CREATE_SIM_OBJECT(AlphaSystem)
215AlphaSystem *
216AlphaSystemParams::create()
256{
217{
257 AlphaSystem::Params *p = new AlphaSystem::Params;
258 p->name = getInstanceName();
259 p->boot_cpu_frequency = boot_cpu_frequency;
260 p->physmem = physmem;
261 p->mem_mode = mem_mode;
262 p->kernel_path = kernel;
263 p->console_path = console;
264 p->palcode = pal;
265 p->boot_osflags = boot_osflags;
266 p->init_param = init_param;
267 p->readfile = readfile;
268 p->symbolfile = symbolfile;
269 p->system_type = system_type;
270 p->system_rev = system_rev;
271 return new AlphaSystem(p);
218 return new AlphaSystem(this);
272}
219}
273
274REGISTER_SIM_OBJECT("AlphaSystem", AlphaSystem)
275
276