system.cc (7580:6f77f379a594) | system.cc (7723:ee4ac00d0774) |
---|---|
1/* 2 * Copyright (c) 2003-2006 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; --- 35 unchanged lines hidden (view full) --- 44#include "mem/physical.hh" 45#include "sim/byteswap.hh" 46#include "sim/system.hh" 47#include "sim/debug.hh" 48 49#if FULL_SYSTEM 50#include "arch/vtophys.hh" 51#include "kern/kernel_stats.hh" | 1/* 2 * Copyright (c) 2003-2006 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; --- 35 unchanged lines hidden (view full) --- 44#include "mem/physical.hh" 45#include "sim/byteswap.hh" 46#include "sim/system.hh" 47#include "sim/debug.hh" 48 49#if FULL_SYSTEM 50#include "arch/vtophys.hh" 51#include "kern/kernel_stats.hh" |
52#include "mem/vport.hh" |
|
52#else 53#include "params/System.hh" 54#endif 55 56using namespace std; 57using namespace TheISA; 58 59vector<System *> System::systemList; 60 61int System::numSystemsRunning = 0; 62 63System::System(Params *p) 64 : SimObject(p), physmem(p->physmem), _numContexts(0), 65#if FULL_SYSTEM 66 init_param(p->init_param), | 53#else 54#include "params/System.hh" 55#endif 56 57using namespace std; 58using namespace TheISA; 59 60vector<System *> System::systemList; 61 62int System::numSystemsRunning = 0; 63 64System::System(Params *p) 65 : SimObject(p), physmem(p->physmem), _numContexts(0), 66#if FULL_SYSTEM 67 init_param(p->init_param), |
67 functionalPort(p->name + "-fport"), 68 virtPort(p->name + "-vport"), | |
69 loadAddrMask(p->load_addr_mask), 70#else 71 page_ptr(0), 72 next_PID(0), 73#endif 74 memoryMode(p->mem_mode), _params(p) 75{ 76 // add self to global system list --- 4 unchanged lines hidden (view full) --- 81 if (!debugSymbolTable) 82 debugSymbolTable = new SymbolTable; 83 84 85 /** 86 * Get a functional port to memory 87 */ 88 Port *mem_port; | 68 loadAddrMask(p->load_addr_mask), 69#else 70 page_ptr(0), 71 next_PID(0), 72#endif 73 memoryMode(p->mem_mode), _params(p) 74{ 75 // add self to global system list --- 4 unchanged lines hidden (view full) --- 80 if (!debugSymbolTable) 81 debugSymbolTable = new SymbolTable; 82 83 84 /** 85 * Get a functional port to memory 86 */ 87 Port *mem_port; |
88 functionalPort = new FunctionalPort(name() + "-fport"); |
|
89 mem_port = physmem->getPort("functional"); | 89 mem_port = physmem->getPort("functional"); |
90 functionalPort.setPeer(mem_port); 91 mem_port->setPeer(&functionalPort); | 90 functionalPort->setPeer(mem_port); 91 mem_port->setPeer(functionalPort); |
92 | 92 |
93 virtPort = new VirtualPort(name() + "-fport"); |
|
93 mem_port = physmem->getPort("functional"); | 94 mem_port = physmem->getPort("functional"); |
94 virtPort.setPeer(mem_port); 95 mem_port->setPeer(&virtPort); | 95 virtPort->setPeer(mem_port); 96 mem_port->setPeer(virtPort); |
96 97 98 /** 99 * Load the kernel code into memory 100 */ 101 if (params()->kernel == "") { 102 inform("No kernel set for full system simulation. Assuming you know what" 103 " you're doing...\n"); 104 } else { 105 // Load kernel code 106 kernel = createObjectFile(params()->kernel); 107 inform("kernel located at: %s", params()->kernel); 108 109 if (kernel == NULL) 110 fatal("Could not load kernel file %s", params()->kernel); 111 112 // Load program sections into memory | 97 98 99 /** 100 * Load the kernel code into memory 101 */ 102 if (params()->kernel == "") { 103 inform("No kernel set for full system simulation. Assuming you know what" 104 " you're doing...\n"); 105 } else { 106 // Load kernel code 107 kernel = createObjectFile(params()->kernel); 108 inform("kernel located at: %s", params()->kernel); 109 110 if (kernel == NULL) 111 fatal("Could not load kernel file %s", params()->kernel); 112 113 // Load program sections into memory |
113 kernel->loadSections(&functionalPort, loadAddrMask); | 114 kernel->loadSections(functionalPort, loadAddrMask); |
114 115 // setup entry points 116 kernelStart = kernel->textBase(); 117 kernelEnd = kernel->bssBase() + kernel->bssSize(); 118 kernelEntry = kernel->entryPoint(); 119 120 // load symbols 121 if (!kernel->loadGlobalSymbols(kernelSymtab)) --- 206 unchanged lines hidden --- | 115 116 // setup entry points 117 kernelStart = kernel->textBase(); 118 kernelEnd = kernel->bssBase() + kernel->bssSize(); 119 kernelEntry = kernel->entryPoint(); 120 121 // load symbols 122 if (!kernel->loadGlobalSymbols(kernelSymtab)) --- 206 unchanged lines hidden --- |